JP2003102028A5 - - Google Patents

Download PDF

Info

Publication number
JP2003102028A5
JP2003102028A5 JP2002186046A JP2002186046A JP2003102028A5 JP 2003102028 A5 JP2003102028 A5 JP 2003102028A5 JP 2002186046 A JP2002186046 A JP 2002186046A JP 2002186046 A JP2002186046 A JP 2002186046A JP 2003102028 A5 JP2003102028 A5 JP 2003102028A5
Authority
JP
Japan
Prior art keywords
color
pixel
pixels
image
image processing
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.)
Granted
Application number
JP2002186046A
Other languages
Japanese (ja)
Other versions
JP2003102028A (en
JP3702957B2 (en
Filing date
Publication date
Application filed filed Critical
Priority to JP2002186046A priority Critical patent/JP3702957B2/en
Priority claimed from JP2002186046A external-priority patent/JP3702957B2/en
Publication of JP2003102028A publication Critical patent/JP2003102028A/en
Publication of JP2003102028A5 publication Critical patent/JP2003102028A5/ja
Application granted granted Critical
Publication of JP3702957B2 publication Critical patent/JP3702957B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の名称】画像処理装置、画像処理方法および画像処理制御プログラムを記録した媒体
【特許請求の範囲】
【請求項1】複数の要素色からなる画像データに対して所定の画像処理を行う画像処理装置であって、
画像データに含まれる色にじみ画素を検出する色にじみ画素検出手段と、
この検出された色にじみ画素がエッジ画素であるか否かを判断する手段と、
判断結果に応じて演算手法を変化させて色にじみを低減させる画像処理を実行する画像処理手段とを具備することを特徴とする画像処理装置。
【請求項2】上記請求項1に記載の画像処理装置において、上記画像処理手段は、上記色にじみ画素がエッジ画素である場合には、同色にじみ画素を基準とした所定の近隣範囲の画素を対象とした色差成分の中央値を当該色にじみ画素の色差成分に置換し、エッジ画素ではない場合には、同近隣範囲の画素を対象として色差成分を平滑化処理し、平滑化した色差成分を同色にじみ画素の色差成分に置換することを特徴とする画像処理装置。
【請求項3】上記請求項1または請求項2のいずれかに記載の画像処理装置において、上記色にじみ画素検出手段は、各画素ごとに異なる要素色間での階調値の差分データを求め、互いに近接する画素間において同差分データの変化度合が所定のしきい値よりも大きいときに色にじみ画素であると検出することを特徴とする画像処理装置。
【請求項4】上記請求項3に記載の画像処理装置において、上記色にじみ画素検出手段は、各画素ごとに異なる要素色間の階調値の差分データを求めるにあたり上記元画像データにおける低密度の要素色と他の要素色との間の差分データを求めることを特徴とする画像処理装置。
【請求項5】上記請求項4に記載の画像処理装置において、上記色にじみ画素検出手段は、低密度の要素色が複数ある場合、互いに隣接する画素間において低密度の要素色に対する階調値データの差分の変化度合いに基づいて上記色にじみ画素を検出することを特徴とする画像処理装置。
【請求項6】上記請求項3〜請求項5のいずれかに記載の画像処理装置において、上記色にじみ画素検出手段は、隣接する画素のうち低密度の画素との間における上記変化度合いに基づいて上記色にじみ画素を検出することを特徴とする画像処理装置。
【請求項7】複数の要素色からなる画像データに対して所定の画像処理を行う画像処理方法であって、
画像データに含まれる色にじみ画素を検出し、
この検出された色にじみ画素がエッジ画素であるか否かを判断し、
判断結果に応じて演算手法を変化させて色にじみを低減させる画像処理を実行することを特徴とする画像処理方法。
【請求項8】複数の要素色からなる画像データに対してコンピュータにて所定の画像処理を行う画像処理制御プログラムを記録した媒体であって、
画像データに含まれる色にじみ画素を検出する機能と、
この検出された色にじみ画素がエッジ画素であるか否かを判断する機能と、
判断結果に応じて演算手法を変化させて色にじみを低減させる画像処理を実行する機能とを実現させることを特徴とする画像処理制御プログラムを記録した媒体。
【発明の詳細な説明】
【0001】
【発明の属する技術分野】
単板式の固体撮像素子を利用して撮像された画像データに対して画像処理する画像処理装置、画像処理方法および画像処理制御プログラムを記録した媒体に関する。
【0002】
【従来の技術】
固体撮像素子を利用したデジタルスチルカメラ等においては、単板方式が採用されることが多い。この単板方式では、図23(a)に示すように、固体撮像素子の各画素に対応してR,G,B(赤、緑、青)の各色の色フィルタが所定の割合でモザイク状に配設されており、特にGの色フィルタは千鳥状に配設されて成分比が高くなっている。従って、固体撮像素子の各画素においては、R,G,Bのいずれか一色の色信号しか得られず、各色の色信号を得ることができない。そこで、各画素において直接的に得ることができない色信号を隣接する画素の色信号から補間演算してR,G,B全色の色信号を得て階調データに変換して出力し、この階調データに基づいてディスプレイに表示するなどしている。
【0003】
例えば、図23(a)において、矢印(→)で示す中段の色フィルタに着目する。そして、同図(b)に示すように中央から左半分に光が当たっており(白色部分)、同中央から右半分には光が当たっていない(黒色部分)ものとする。ここにおいて、光があたっている状態の各色の色信号レベルを「1」とし、光が当たっていない状態の同色信号レベルを「0」とすると、RおよびGの色信号レベルは、本来、同図(c)に示す値になるはずである。
【0004】
しかし、上述したように、Rの色フィルタからはGの色信号は直接的には得られないし、Gの色フィルタからはRの色信号は直接的に得られないため、Rの色フィルタに対応する画素のGの色信号については、隣接する画素におけるGの色信号を線形補間して得る。他方、Gの色フィルタに対応する画素のRの色信号については、隣接する画素におけるRの色信号を線形補間して得る。すると、各画素におけるGおよびRの色信号レベルは、それぞれ図23(d)および(e)に示す値となる。図からも明らかなように、光が当たる領域と光が当たらない領域との境界付近の画素に偽の色信号が発生し、この偽の色信号により画像上に色にじみ(偽色と呼ぶこともある)が発生する。特に、この色にじみはグレイ・ホワイト間の境界に顕著に現れることが知られている。そこで、このような色にじみを低減するため、画像データを構成する全画素の色差データに対して平滑化フィルタ(ローパスフィルタ)を作用させて色にじみを目立たなくするなどしていた。
【0005】
【発明が解決しようとする課題】
上述した従来の技術においては、次のような課題があった。
平滑化フィルタを作用させるということは、一つの画素の色成分を周辺画素に分散することに相当し、同画素を中心とした5×5画素等のマトリクス演算を行うことになる。例えば5×5画素のマトリクス演算を行う場合、一の画素につき5×5=25回の演算を行うことになる。従って、全画素を対象とした場合、25×画素数という膨大な演算量となってしまって処理時間が多大となることがあった。
一方、上記の平滑化処理を行なうと、画像がぼやけてしまう傾向もある。特に、色にじみ画素が画像の境界部分たるエッジ部分に発生している場合には、当該エッジ部分の画像がぼやけてしまうことがあった。
【0006】
本発明は、上記課題にかんがみてなされたもので、画像データにおける色にじみを低減するにあたり、エッジ部分の画像がぼやけてしまうことを防止し、かつ、処理時間を短縮することが可能な画像処理装置、画像処理方法および画像処理制御プログラムを記録した媒体の提供を目的とする。
【0007】
【課題を解決するための手段】
上記目的を達成するため、請求項1にかかる発明は、複数の要素色からなる画像データに対して所定の画像処理を行う画像処理装置であって、画像データに含まれる色にじみ画素を検出する色にじみ画素検出手段と、この検出された色にじみ画素がエッジ画素であるか否かを判断する手段と、判断結果に応じて演算手法を変化させて色にじみを低減させる画像処理を実行する画像処理手段とを具備する構成としてある。
【0008】
上記のように構成した請求項1にかかる発明においては、色にじみ画素検出手段で画像データに含まれる色にじみ画素を検出すると、この検出された色にじみ画素がエッジ画素であるか否かを判断し、画像処理手段は判断結果に応じて演算手法を変化させて色にじみを低減させる画像処理を実行する。
【0009】
より具体的な構成として、請求項2にかかる発明は、上記請求項1に記載の画像処理装置において、上記画像処理手段は、上記色にじみ画素がエッジ画素である場合には、同色にじみ画素を基準とした所定の近隣範囲の画素を対象とした色差成分の中央値を当該色にじみ画素の色差成分に置換し、エッジ画素ではない場合には、同近隣範囲の画素を対象として色差成分を平滑化処理し、平滑化した色差成分を同色にじみ画素の色差成分に置換する構成としてある。
【0010】
色にじみ画素を基準とした所定範囲の画素を対象として上記の平滑化処理を行い、その後に上記のエッジ強調処理を行えば、平滑化処理によって失われたシャープさを補うことができる。しかし、経験的な見地からすると、色にじみ画素が画像の境界部分たるエッジ部分に発生している場合には、当該エッジ部分の画像がぼやけてしまうことがあった。
【0011】
すなわち、色にじみ画素が検出されると、当該色にじみ画素がエッジ画素であるか否かを判断する。ここにおいて、エッジ画素であると判断された場合には、画像処理手段は上述したようにして色にじみ画素を基準とした所定範囲の画素を対象とした色差成分を検出し、その中で中央の値を有する色差成分を色にじみ画素の色差成分に置き換え、その後に元の要素色成分に戻す。他方、エッジ画素ではないと判断した場合には上述したようにして色にじみ画素を基準とした所定範囲の画素の色差成分を平滑化処理し、その後に元の要素色成分に戻す。
【0012】
例えば、白・黒の境界部分に色にじみ画素が発生していた場合、当該色にじみ画素の色差成分が周辺画素の色差成分に置き換わって純粋に白または黒の画素となるため、色にじみは解消されつつも境界部分がぼやけてしまうことはない。また、エッジ画素であるか否かを判断するにあたっては、エッジ画素において隣接画素間で色差成分の変化度合いが大きくなることから、かかる色差成分の変化度合いと所定のしきい値とを比較し、同色差成分の変化度合いの方が大きい場合にエッジ画素と判断するなどすればよい。むろん、エッジ画素を輝度勾配の大きい画素として捉え、隣接画素間で輝度成分の変化度合いに基づいてエッジ画素を判断するようにしてもよい。
【0013】
なお、所定範囲の画素を対象とした色差成分にて中央の値を選択する具体的な構成としては、所定のメジアンフィルタなどを適用すればよい。
【0014】
一方、色にじみ画素の検出は、各種の手法を採用可能であるが、その一例として、請求項3にかかる発明は、上記請求項1または請求項2のいずれかに記載の画像処理装置において、上記色にじみ画素検出手段は、各画素ごとに異なる要素色間での階調値の差分データを求め、互いに近接する画素間において同差分データの変化度合が所定のしきい値よりも大きいときに色にじみ画素であると検出する構成としてある。
【0015
上記のように構成した請求項3にかかる発明においては、色にじみ画素検出手段が、各画素ごとに異なる要素色間での階調値の差分データを求め、互いに近接する画素間において同差分データの変化度合が所定のしきい値よりも大きいときに色にじみ画素であると検出する。
【0016
例えば、画像処理の対象となる画像データが、単板の固体撮像素子にて撮像されたドットマトリクス状の画素からなる場合、単板の固体撮像素子は複数要素色の色フィルタが非均一密度でモザイク状に配置されているため、均一密度となるように演算にて補充されるが、上述したようにこの演算の際に偽の色成分が生成されて色にじみが発生する。色にじみ画素検出手段は、このような色にじみが発生している色にじみ画素を検出し、画像処理手段は、同検出された色にじみ画素を基準とした所定範囲の画素を対象として色にじみを低減するように画像処理する。
【0017
ある画素について色にじみの有無を検出する際、当該画素についての要素色成分から画一的に色にじみの有無を検出することはできないため、周辺画素と比較して色にじみの有無を検出することになる。また、色にじみの発生は上記のような偽の要素色成分に起因するが、かかる偽の要素色成分は、固体撮像素子において各要素色の色フィルタが非均一密度で配置されていることから低密度の色フィルタに対する要素色成分について発生しやすいと言うことができる。
【0018
そこで、検出対象の画素と当該画素に近接する画素との間で低密度の色フィルタに対する要素色強度(階調値など)に着目し、この要素色強度の変化度合いに基づいて色にじみ画素を検出することができる。
【0019
ここにおいて、色にじみ画素を検出する具体的な手法の一例として、請求項にかかる発明は、上記請求項に記載の画像処理装置において、上記色にじみ画素検出手段は、各画素ごとに異なる要素色間の階調値の差分データを求めるにあたり上記元画像データにおける低密度の要素色と他の要素色との間の差分データを求める構成としてある。
【0020
上記のように構成した請求項にかかる発明においては、上記色にじみ画素検出手段は、上記元画像データにおける低密度の要素色と他の要素色との間の差分データを求め、当該差分データの変化度合いに基づいて色にじみ画素を検出する。
【0021
例えば、図23(a)の中段ラインのように、RおよびGの色フィルタが交互に配置されていることが予め分かっている場合、低密度の色フィルタはRであるから、基準の要素色成分としてGを採用し、両者の差分ΔRG=|RーG|の変化度合いを隣接する画素間で調べる。すると、このΔRGの値は図23(f)に示すようになり、隣接する画素間でΔRGの変化度合いに着目すると、光が当たる領域と光が当たらない領域との境界付近の画素において「0.5」となり、このような画素を色にじみ画素として検出する。
【0022
要素色強度の差分の変化度合いに基づいて色にじみ画素を検出する手法としては、上述したものにとらわれる必要はなく、その一例として、請求項にかかる発明は、請求項に記載の画像処理装置において、上記色にじみ画素検出手段は、低密度の要素色が複数ある場合、互いに隣接する画素間において低密度の要素色に対する階調値データの差分の変化度合いに基づいて上記色にじみ画素を検出する構成としてある。
【0023
上記のように構成した請求項にかかる発明においては、低密度の色フィルタが複数存在するような場合に、上記色にじみ画素検出手段は、互いに隣接する画素間においてそれぞれの低密度の要素色に対する階調値データの差分を求め、同差分の変化度合いに基づいて上記色にじみ画素を検出する。
【0024
すなわち、上述したように偽の要素色成分は低密度の色フィルタに対する要素色について顕著に現れるため、かかる低密度の色フィルタに対する要素色強度の差分に着目する。例えば、図23(a)に示すように、全体に対してGの色フィルタの密度が高く、RおよびBの色フィルタの密度が低い場合、偽の要素色成分はR、Bで顕著に現れることになる。ここにおいて、同様に中段ラインに着目するものとし、この中段ラインの各画素におけるBの色信号レベルを上段ライン側に隣接するBの色フィルタから線形補間するものとする。すると、中段ラインの各画素におけるBの色信号レベルは同図(d)に示すものと同様になり、RとBの色信号レベルの差分ΔRB=|R−B|=ΔRGとなる。従って、隣接する画素間におけるΔRBの値も同図(f)に示すようになるため、光が当たる領域と光が当たらない領域の境界付近の画素において同ΔRBの変化度合いは「0.5」となり、このような画素を色にじみ画素として検出する。
【0025
基準の要素色強度と低密度の要素色強度との差分の変化度合いに着目するか、あるいは低密度の要素色強度間の差分の変化度合いに着目するかにかかわらず、いずれの隣接画素間でかかる変化度合いを調べるかについては様々な態様が考えられる。例えば、水平方向、垂直方向および斜め方向の八方向に隣接する画素間で同変化度合いを調べるようにしてもよいし、適宜、比較方向を削減すれば演算量を低減することができる。上述した理由から低密度の色フィルタに対する画素においては、偽の要素色成分が発生している可能性が高いと言えるため、上記変化度合いを調べる場合、低密度の色フィルタに対する画素間で調べる方が好適である。そこで、請求項にかかる発明は、上記請求項3〜請求項5のいずれかに記載の画像処理装置において、上記色にじみ画素検出手段は、隣接する画素のうち低密度の画素との間における上記変化度合いに基づいて上記色にじみ画素を検出する構成としてある。
【0026
上記のように構成した請求項にかかる発明においては、上記色にじみ画素検出手段は、隣接する低密度の要素色に対応する画素との間で同変化度合いを調べて色にじみ画素を検出する。
【0027
また、平滑化処理によって画像のシャープさが失われることもあるので、上記画像処理手段は、エッジ強調処理する構成としてもよい。
【0028
上記のように構成した場合、上記画像処理手段は、画像データに対してエッジ強調処理を行い、平滑化処理で失われたシャープさを補う。
【0029
このように、エッジ強調処理を行うとしても、上記平滑化処理を行わない領域までエッジ強調すると、同平滑化処理される領域の外側が不自然にエッジ強調されてしまうことも観念されるため、上記画像処理手段は、上記平滑化処理を行う範囲内の画素に対してエッジ強調処理する構成としてもよい。
【0030
上記のように構成した場合、上記画像処理手段は、シャープさが失われがちな上記平滑化処理を行う範囲内の画素に対してエッジ強調処理を行う。
【0031
ところで、平滑化処理を行うにあたり、すべての画像データにおいて、一律に同一範囲の平滑化処理を行うことは得策ではない。例えば、画像サイズの大きな画像データと画像サイズの小さな画像データの両者に対して同一範囲の平滑化処理を施したものとする。この場合、前者における平滑化処理の範囲が画像に対して占める割合と、後者における割合とは異なるため、前者において良好な結果が得られたとしても後者においては全体がぼやけすぎてしまうこともあり得る。そこで、上記画像処理手段は、上記検出された色にじみ画素を基準とした所定範囲の画素を対象として平滑化処理を行うにあたり、処理対象となる画像のサイズが大きい場合に同平滑化処理する範囲を大きくし、同画像のサイズが小さい場合に同平滑化処理する範囲を小さくする構成としてもよい。
【0032
上記のように構成した場合、上記画像処理手段は、予め画像処理の対象となる画像データのサイズを検知し、当該画像データのサイズが大きければ平滑化処理する範囲を大きくするし、同画像データのサイズが小さければ平滑化処理する範囲を小さくする。具体的にはサイズの異なる複数の平滑化フィルタを保持しておき、画像サイズに応じて平滑化フィ ルタを使い分けるようにするなどすれば実現可能である。
【0033
色にじみ画素がエッジ画素であるか否かに応じて演算手法を変える手法は、必ずしも実体のある装置に限られる必要もなく、その一例として、請求項にかかる発明は、複数の要素色からなる画像データに対して所定の画像処理を行う画像処理方法であって、画像データに含まれる色にじみ画素を検出し、この検出された色にじみ画素がエッジ画素であるか否かを判断し、判断結果に応じて演算手法を変化させて色にじみを低減させる画像処理を実行する構成としてある。
【0034
すなわち、必ずしも実体のある装置に限らず、その方法としても有効であることに相違はない。
【0035
ところで、上述したように色にじみ画素を検出して当該色にじみ画素を基準とした所定範囲の画素について色にじみを低減する画像処理装置は単独で存在する場合もあるし、ある機器に組み込まれた状態で利用されることもあるなど、発明の思想としては各種の態様を含むものである。また、ハードウェアで実現されたり、ソフトウェアで実現されるなど、適宜、変更可能である。
【0036
発明の思想の具現化例として画像処理装置を制御するソフトウェアとなる場合には、かかるソフトウェアを記録した記録媒体上においても当然に存在し、利用されるといわざるをえない。その一例として、請求項8にかかる発明は、複数の要素色からなる画像データに対してコンピュータにて所定の画像処理を行う画像処理制御プログラムを記録した媒体であって、画像データに含まれる色にじみ画素を検出する機能と、この検出された色にじみ画素がエッジ画素であるか否かを判断する機能と、判断結果に応じて演算手法を変化させて色にじみを低減させる画像処理を実行する機能とを実現させる構成としてある。
【0037
むろん、その記録媒体は、磁気記録媒体であってもよいし光磁気記録媒体であってもよいし、今後開発されるいかなる記録媒体においても全く同様に考えることができる。また、一次複製品、二次複製品などの複製段階については全く問う余地無く同等である。
【0038
さらに、一部がソフトウェアであって、一部がハードウェアで実現されている場合においても発明の思想において全く異なるものはなく、一部を記録媒体上に記憶しておいて必要に応じて適宜読み込まれるような形態のものとしてあってもよい。
【0039】
【発明の効果】
以上説明したように本発明は、色にじみ画素がエッジ画素であるか否かに応じて演算手法を変えることにより、エッジがぼけてしまうことを防止することが可能となる。
【0040】
その一例として、請求項2にかかる発明によれば、色にじみ画素がエッジ画素である場合に所定範囲の画素の色差成分にて中央の値を色にじみ画素に援用し、エッジ画素ではない場合に平滑化処理を施すようにしたため、画像のエッジ部分がぼやけてしまうことがない。
【0041】
さらに、請求項3にかかる発明によれば、比較的簡易な演算手法によって色にじみ画素を検出し、当該色にじみ画素を基準とした所定範囲の画素を対象として色にじみを低減するようにしたため、演算量を削減して処理時間を短縮することが可能な画像処理装置を提供することができる。
【0042】
さらに、請求項4にかかる発明によれば、低密度の要素色に着目すればよいため、容易に色にじみ画素を検出することができる。
【0043】
すなわち、低密度の要素色と他の要素色との差分の変化度合いを調べればよいため、色にじみ画素の検出演算を容易に行うことができる。
【0044】
さらに、請求項5にかかる発明によれば、低密度の要素色が複数ある場合、一律に低密度の要素色間での差分の変化度合いに着目すればよいため、色にじみ画素の検出演算を容易に行うことができる。
【0045】
さらに、請求項6にかかる発明によれば、低密度の要素色の画素との間で上記差分の変化度合いを調べるようにしたため、より信頼性の高い検出を行うことができる。
【0046】
さらに、平滑化処理により色にじみを低減するについても、色差成分を平滑化処理して元の要素色成分に戻せばよいため、演算を容易に行うことができる。
【0047】
さらに、エッジ強調処理を行うようにすれば、平滑化処理による画像のシャープさの低下を補うことができる。
【0048】
さらに、平滑化処理を行う範囲内の画素に対してエッジ強調処理を行うようにすれば、平滑化処理の範囲外の画素について不自然にシャープさが高まることはない。
さらに、処理対象となる画像のサイズに応じて平滑化処理する範囲を変化させるようにすれば、最適な範囲の平滑化処理を行うことができる。
さらに、所定範囲の画素の色差成分にて中央の値を色にじみ画素に援用するようにし、色にじみを低減することができる。
【0049】
さらに、請求項7にかかる発明によれば、同様にしてエッジがぼけてしまうことのない画像処理方法を提供することができ、請求項8にかかる発明によれば、画像処理制御プログラムを記録した媒体を提供することができる。
【0050】
【発明の実施の形態】
以下、図面にもとづいて本発明の実施形態を説明する。
図1は、本発明の一実施形態にかかる画像処理装置を適用した画像処理システムをブロック図により示しており、図2は具体的ハードウェア構成例を概略ブロック図により示している。
図1において、画像入力装置10は単板式のCCDを利用して撮像した実画像などをドットマトリクス状の画素で表した画像データとして画像処理装置20へ出力する。上述した原理から単板式のCCDにて撮像された画像データには色にじみが発生し、画像処理装置20は入力画像データにおいて色にじみ画素を検出して当該色にじみ画素を基準とした所定範囲で色にじみを低減するように画像処理して画像出力装置30へ出力し、画像出力装置30は画像処理された画像データをドットマトリクス状の画素で出力する。
【0051】
画像処理装置20は、色にじみ画素を検出することから色にじみ画素検出手段を備えているし、当該検出された色にじみを基準として色にじみを低減するように画像処理を行うことから画像処理手段をも備えていると言える。
【0052】
画像入力装置10の具体例は図2における単板式のCCDを備えたフィルムスキャナ11やデジタルスチルカメラ12あるいはビデオカメラ14などが該当する。例えば、図3は同デジタルスチルカメラ12の簡単なハードウェア構成例を概略ブロック図により示している。同図において、入射光は光学系12aを介してCCD12bに受光される。このCCD12bはR,G,B各色の色フィルタが各画素に対応して所定の割合で配置されており、駆動回路12cにて各画素における色信号が出力される。出力された色信号はデジタル変換されて補間演算回路12dに入力され、当該補間演算回路12dにて各画素において直接得ることができない要素色成分についての色信号を周辺の画素からの線形補間演算により取得し、RGBの階調データとして画像メモリ12eに保存する。
【0053】
一方、画像処理装置20の具体例はコンピュータ21とハードディスク22とキーボード23とCD−ROMドライブ24とフロッピーディスクドライブ25とモデム26などからなるコンピュータシステムが該当し、画像出力装置30の具体例はプリンタ31やディスプレイ32等が該当する。なお、モデム26については公衆通信回線に接続され、外部のネットワークに同公衆通信回線を介して接続し、ソフトウェアやデータをダウンロードして導入可能となっている。
【0054】
本実施形態においては、画像入力装置10としてのフィルムスキャナ11やデジタルスチルカメラ12が画像データとしてRGBの階調データを出力するとともに、画像出力装置30としてのプリンタ31は階調データとしてCMY(シアン、マゼンダ、イエロー)あるいはこれに黒を加えたCMYKの二値データを入力として必要とするし、ディスプレイ32はRGBの階調データを入力として必要とする。
【0055】
一方、コンピュータ21内ではオペレーティングシステム21aが稼働しており、プリンタ31やディスプレイ32に対応したプリンタドライバ21bやディスプレイドライバ21cが組み込まれている。また、画像処理アプリケーション21dはオペレーティングシステム21aにて処理の実行を制御され、必要に応じてプリンタドライバ21bやディスプレイドライバ21cと連携して所定の画像処理を実行する。従って、画像処理装置20としてのこのコンピュータ21の具体的役割は、RGBの階調データを入力し、色にじみ画素を検出して色にじみを低減するように画像処理を施したRGBの階調データを作成し、ディスプレイドライバ21cを介してディスプレイ32に表示させるとともに、プリンタドライバ21bを介してCMY(あるいはCMYK)の二値データに変換してプリンタ31に印刷させることになる。
【0056】
このように、本実施形態においては、画像の入出力装置の間にコンピュータシステムを組み込んで画像処理を行うようにしているが、必ずしもかかるコンピュータシステムを必要とするわけではなく、単板式のCCDにて撮像されるとともに上述したように補間演算されて色にじみが発生した画像データに対して色にじみを低減するように画像処理を行うシステムに適用可能である。例えば、図4に示すように単板式のCCDを備えたデジタルスチルカメラ13a内に同様に画像処理する画像処理装置を組み込み、色にじみを低減した画像データを用いてディスプレイ32aに表示させたりプリンタ31aに印字させるようなシステムであっても良い。また、図5に示すように、コンピュータシステムを介することなく画像データを入力して印刷するプリンタ31bにおいては、単板式のCCDを有するフィルムスキャナ11bやデジタルスチルカメラ13b等を介して入力される画像データに対して色にじみを低減して画像処理するように構成することも可能である。
【0057】
上述した色にじみ画素の検出と色にじみを低減する画像処理は、具体的には上記コンピュータ21内にて図6などに示すフローチャートに対応した画像処理プログラムで行っている。
本実施形態において採用する色にじみの低減方法は、後述するように平滑化フィルタなどを作用させて行う点については従来と同様であるが、同平滑化フィルタなどを作用させる領域は色にじみ画素の周辺に限られることで従来とは異なる。ここで、処理対象となる画像データについて、図7(a)および(b)に示すように二種類の画像サイズのビットマップを考え、両者に対して図中斜線部分で示す同一サイズの平滑化フィルタを作用させるものとする。画像サイズが異なるとは、画像データの各画素とCCDの各画素が一対一で対応していれば、使用するCCDの画素数に応じて画像サイズも当然に異なるが、同一画素数のCCDを使用した場合であっても適宜伸縮して画像サイズが変更される場合もあり、かかる場合も含むものとする。
【0058】
図からも明らかなように、同一サイズの平滑化フィルタを適用している限りにおいては、画像サイズが異なれば平滑化処理される領域が画像全体に対して占める割合も異なる。従って、あらゆる画像サイズの画像データに対して一律に同一サイズの平滑化フィルタを作用させてしまうと、図7(a)に示すように適当な大きさの領域が平滑化処理されることもあれば、同図(b)に示すように平滑化処理される領域が画像全体に対して占める割合が大きくなってしまうことがある。平滑化処理するということは、画像をぼやけさせることに他ならないから、同図(b)に示すものにおいては画像の大部分がぼやけてしまうことになりかねない。
【0059】
そこで、本実施形態においては、図8に示すようにな3×3、5×5、7×7画素といった複数の異なるサイズの平滑化フィルタを保持しており、画像サイズに応じてこれらの平滑化フィルタを適宜使い分けるようにしている。ここで、ビットマップ画像の画像サイズを判定するにあたっては、画像の(height)×(width)を算出して画素数を求め、この算出された画素数を指標としてもよいが、本実施形態においては、次式で表されるAに従って処理対象画像の画像サイズを判定する。
【0060】
A=min(height,width) …(1)
ここにおいて、min(height,width)はheightとwidthのいずれか小さい方を意味する。そして、ステップS110では、
A<300ならば、
3×3画素の平滑化フィルタ
300≦A≦600ならば、
5×5画素の平滑化フィルタ
A>600ならば、
7×7画素の平滑化フィルタ
というように分岐し、それぞれステップS122〜ステップS126にて用いる平滑化フィルタの種類をワークエリアに保存する。ワークエリアはコンピュータ21内のRAMであってもよいしハードディスク22であってもよい。
【0061】
ここでmin(height,width)を基準としているのは次のような理由による。平滑化フィルタのサイズが適当か否かを判断するにあたっては、本来的には全画素数に対して平滑化処理される画素数の割合で判断すればよい。しかしながら、例えば、同一画素数の画像データであっても図9(a)に示すビットマップ画像のように幅広の画像もあれば、同図(b)に示すビットマップ画像のように高さ方向に比べて幅方向の長さが若干長い標準的な画像もある。仮に、処理対象画像の全画素数に応じて使用する平滑化フィルタを決定するものとすると、両者で同一の平滑化フィルタが選択されることになる。すると、後者においては同平滑化フィルタのサイズが適当であっても、前者においては高さ方向がほぼ全長にわたって平滑化されることがあり、このような場合、視覚的にはぼやけた印象を受ける。従って、heightとwidthのいずれか小さい方を基準とすれば、このような弊害を回避することができる。
【0062】
図6のフローチャートを参照すると、図10に示すようにドットマトリクス状の画素からなる画像データについて処理対象画素を水平方向に主走査しつつ垂直方向に副走査して移動させ、各画素について色にじみ画素であるか否かを判断している。
【0063】
画像データがドットマトリクス状の画素から構成されている場合には、各画素ごとにRGBの階調データ(「0」〜「255」)で表されている。ステップS122〜ステップS126にて使用する平滑化フィルタの種類をワークエリアに保存したら、次なるステップS130においては、対象画素とその周辺画素におけるRおよびBの階調データの差分ΔRBを算出する。このΔRBは、
ΔRB=|R−B| …(2)
と表される。
【0064】
本実施形態におけるCCDは図23(a)に示すように、各画素に対応してR,G,Bの各色の色フィルタがモザイク状に配置されるとともに、Gの色フィルタのみが千鳥状に配置されて密度が高くなっており、RおよびBの色フィルタが低密度となっている。そして、各画素において直接的に得ることができない色信号を隣接する画素の色信号から線形補間演算してR,G,B全色の色信号を得て階調データに変換している。従って、確率からすれば補間演算の結果、ある画素において低密度のR,Bの階調データについて、本来の強度が得られなかったり、本来必要のない色成分が発生するなど偽の要素色成分により色にじみが発生するということができる。
【0065】
また、色にじみは特に白・黒間の境界付近にて顕著に現れることが知られている。例えば、Rの色フィルタに対応する画素において白色を表現する場合、本来のRGBの階調データは(R,G,B)=(255,255,255)となるところ、補間演算の結果(R,G,B)=(255,255,127)となったりする。ここにおいて、Gの色フィルタは高密度であるからG成分については補間演算により偽の要素色成分が発生する確率が小さく、他方、Rの成分は色フィルタから直接的に得ることができるため偽の色成分が発生することはない。本来的にはある画素において白を表現するならばΔRBは「0」となるし、黒を表現する場合もΔRBは「0」となるはずではあるが、色にじみ画素においてはこれに比べてΔRBの値が大きくなる傾向を示す。
【0066】
むろん、画像データによってはもともとRおよびGの成分が高く、Bの成分が低い画素も当然に存在し得る。しかし、このような場合には各要素色成分は隣接画素においても保持され、当該画素から遠ざかるにつれてΔRBの値はなだらかに変化する場合が多い。これに対して、色にじみは原理的に画素単位で発生しつつ、かつ、互いに隣接する画素のいずれか一方が白または黒などの画素であるから、隣接画素間でΔRBの変化度合いが大きい画素を色にじみ画素としてもあながち間違ってはいないといえる。そこで、本実施形態においては、後述するようにして処理対象画素と周辺画素との間でΔRBの値の変化度合いを調べ、同変化度合いが大きい画素を色にじみ画素として検出する。むろん、Gの色フィルタは高密度であるから補間演算により偽の要素色成分が発生する可能性は低いと言えるため、この要素色成分を基準として(2)式を、
ΔGR=|G−R| …(3)
ΔGB=|G−B| …(4)
という式に代替することも可能である。
【0067】
また、このようなΔRBの変化度合いを調べるにあたっては、低密度の色フィルタに対応する画素間で比較する方が好適である。すなわち、高密度の色フィルタに対応する画素と比べて低密度の色フィルタに対応する画素の方が偽の要素色成分が発生しやすいため、低密度の色フィルタに対応する画素間でΔRBの変化度合いを比較する方がより信頼性の高い検出を行うことができる。
【0068】
実際の色にじみ画素の検出はステップS140にて行われ、このステップS140では上記のようにして算出したΔRBの周辺画素間での変化度合いから色にじみ画素か否かの判定を行う。このとき、図11に示すように、処理対象画素を中心とするとともに、水平方向をx、垂直方向をyとしたマトリクスを考え、
E=4ΔRB(x,y)−2ΔRB(x−1,y−1)
−2ΔRB(x+1,y−1) …(5)
で表されるEの値と所定のしきい値Thとの大小関係を比較する。そして、E≧Thの場合に色にじみ画素であると判断する。従って、上述したステップS130においては、判定対象の画素におけるΔRB(x,y)を求めておくとともに、周辺画素のΔRBの値としてΔRB(x−1,y−1)およびΔRB(x+1,y−1)を求めておくことになる。
【0069】
E≧Thの判定基準に従って色にじみ画素を検出する意味は次のようになる。処理対象画素において色にじみが発生していると、当該画素とその周辺画素間のΔRB値の変化度合いが大きくなるため(5)式を参照するとEの値も大きくなり、所定のしきい値Thを越えた場合に色にじみ画素と判断する。また、(5)式および図11を参照すると、判定対象の画素と斜め方向の画素とでΔRBの変化度合いを調べていることが容易に分かる。ここで、図23(a)を参照すれば、判定対象の画素がRに該当すれば斜め方向の画素はBに該当し、判定対象の画素がBに該当すれば斜め方向の画素はRに該当するし、判定対象の画素がGに該当すれば斜め方向の画素はGに該当する。すなわち、判定対象の画素が低密度の要素色に対応する場合は、隣接する低密度の要素色に対応する画素との間でΔRB値の変化度合いを調べ、判定対象の画素が高密度の要素色に対応する場合は、隣接する高密度の要素色に対応する画素との間でΔRBの変化度合いを調べていることになる。
【0070】
従って、ステップS130,S140にて互いに隣接する画素間において低密度の色フィルタに対する要素色強度間の差分の変化度合いに基づいて色にじみ画素を検出しており、これらを実行するハードウェア構成とソフトウェアとによって色にじみ画素検出手段を構成することになる。
【0071】
ステップS140にて色にじみ画素であるものと判断した場合には、ステップS150にて当該画素がエッジ画素か否かを判定する。エッジ画素であるか否かを判断するにあたっては、色差成分に基づいて行う手法が有効であるため、本実施形態においてはRおよびBの階調データから輝度成分Yを減算してそれぞれ色差成分C1,C2を求める。なお、この色差成分C1,C2は、
C1=R−Y …(6)
C2=B−Y …(7)
と表すことができる。
【0072】
しかしながら、RGBの階調データは直接には輝度の値を持っておらず、輝度を求めるためにLuv表色空間に色変換することも可能であるが、演算量などの問題から得策ではない。このため、テレビジョンなどの場合に利用されているRGBから輝度を直に求める次式の変換式を利用する。
Y=0.30R+0.59G+0.11B …(8)
【0073】
エッジ画素は画像の境界部分であるから、隣接する画素間で色差成分C1,C2の変化度合いが大きいといえるため、次の二つの判定基準のうちでいずれか一方を充足する場合にエッジ画素として判断することができる。
|C1(x,y)−C1(x−1,y−1)|≧Th1 …(9)
|C2(x,y)−C2(x−1,y−1)|≧Th2 …(10)
なお、ここにおけるxは水平方向の座標を示しており、yは垂直方向の座標を示している。
【0074】
すなわち、(9)および(10)式の意味するところは、図12に示すように、当該色にじみ画素を中心としたドットマトリクス状の画素からなる画像データにおいて、隣接する斜め方向の画素間で色差成分C1,C2の変化度合いを求め、それぞれしきい値Th1,Th2以上あるか否かを判定していることに他ならない。そして、いずれか一方の判断基準を充足する場合にエッジ画素と判断していることになる。むろん、本来的には画素は図13に示すように縦横に升目状に配置されており、中央の画素に注目すると八つの隣接画素がある。従って、同様にそれぞれの隣接する画素との間で色差成分C1,C2の変化度合いを求めるとともに、それぞれしきい値Th1,Th2との間で比較演算し、いずれか一つの比較演算にて色差成分C1またはC2の変化度合いがしきい値Th1またはTh2以上ある場合に色にじみ画素と判断すればよい。
【0075】
このように色にじみ画素がエッジ画素であるか否かを判断するにあっては、色差成分C1,C2の変化度合いに基づいて行う手法が有効ではあるものの、一つの色にじみ画素について、隣接する八画素のそれぞれにおいて色差成分C1,C2についての比較演算を行わなければならないため、演算量が多大となって処理速度が低下してしまうことになりかねない。そこで、図14に示すように縦横方向の四画素について比較演算を行ったり、あるいは図15に示すように斜め方向の四画素について比較演算を行うようにし、演算量を低減するようにしてもかまわない。
【0076】
また、エッジ画素であるか否かを輝度勾配の大小で判断するようにしてもよく、この場合には上述した(9)および(10)式を次式に代替すればよい。
|Y(x,y)−Y(x−1,y−1)|≧Th3 …(11)
この(11)式をエッジ画素の判断基準として用いれば、(9)および(10)式を用いる場合に比べて演算量が半減されることは容易に分かることである。
【0077】
ステップS150にて当該色にじみ画素がエッジ画素ではないものと判断した場合には、ステップS152で同色にじみ画素に対してステップS122〜ステップS126にて決定した平滑化フィルタを作用させて同色にじみ画素を基準とした所定範囲の画素に対して平滑化処理を行う。むろん、平滑化処理を行うにあたっては、色差成分の平滑化が有効であるため、本実施形態においては上記(6)、(7)式に基づいて算出した色差成分C1,C2に対して平滑化処理を施す。
【0078】
ここで、平滑化フィルタを用いた平滑化処理について説明する。図8に示す各平滑化フィルタにおいて、中央の数値をマトリクス状の画像データにおける処理対象画素の色差成分C1,C2の重み付けとし、その周辺画素に対して同平滑化フィルタの升目における数値に対応した重み付けをして積算するのに利用される。この場合、すべての升目に「1」が立てられているため、平滑後の色差成分C1'は各升目の色差成分C1を合計して全升目数で除算して求め、平滑後の色差成分C2'も同様にして求められる。むろん、各升目に適宜重み付けを持たせるようにしてもかまわない。ただし、平滑化フィルタを作用させるとういことは、上述したようなマトリクス演算を行うことであるから、各升目に重み付けを持たせれば演算量も増加することになる。すなわち、本実施形態においては、平滑化フィルタの各升目に「1」を立てているため、各画素のデータを合計して升目数で除算すればよいが、各升目に重み付けがなされている場合には升目数だけ乗算演算と加算演算が必要になることから演算量が多大となる。
【0079】
従来のように画像データの全画素を対象としてこのようなマトリクス演算を行うと、演算量が膨大となって多大な処理時間がかかってしまうことがある。従って、本実施形態のように色にじみ画素を検出して当該色にじみ画素の周辺について平滑化処理を行うようにすれば、大幅な演算量の削減が期待され、高速な画像処理を実現可能となる。
【0080】
一方、ステップS150で当該色にじみ画素がエッジ画素であると判断した場合には、ステップS154で同色にじみ画素を中心として5×5画素のメジアンフィルタを作用させる。なお、実際に適用するメジアンフィルタのサイズは、必ずしも5×5画素である必要はなく、3×3画素のメジアンフィルタを適用するなど適宜変更可能である。そこで、説明の便宜上、3×3画素のメジアンフィルタを適用する場合について説明する。
【0081】
例えば、図16に示すように、色にじみ画素を中心とした3×3画素のドットマトリクスを考慮する。なお、各升目の値は色差成分C1の値を示しており、図中の斜め線がエッジ方向に相当する。ここで、3×3画素のメジアンフィルタを適用するということは、全九画素の色差成分C1の値を昇順または降順にソートし、中央の値を選択して色にじみ画素の色差成分C1と置き換えることを意味する。すなわち、同図に示すものにおいては、色差成分C1の値が「10」の画素が六画素存在し、「40」の画素が一画素存在し、「100」の画素が三画素存在しているため、これらの値を仮に昇順にソートしたものとすると図17に示すようになる。すると、同図からも明らかなように中央の値は「10」となり、当該色にじみ画素の色差成分C1は「10」となる。
【0082】
一方、ここにおいて3×3画素の平滑化フィルタを作用させたものとすると、升目の合計値「300」を画素数「9」で除算した値である「33」が平滑化処理後の色差成分C1'となる。この平滑処理後の色差成分C1'は色にじみ画素に対して周辺画素の色差成分C1を平均化して加算したものであるから、滑らかな画像データとしていることになる。このようにして滑らかにしたものはいわゆるローパスフィルタをかけたものと同様の意味あいを持ち、画像は滑らかにされて色にじみが目立たなくなるが、エッジ部分もぼやけた印象となってしまうため得策ではない。そこで、エッジ画素に対しては上述したメジアンフィルタを適用すればエッジ部分がぼやけないことは、上記の演算結果からも明らかである。
【0083】
他方、図16を参照すると、色差成分C1の値が「40」の画素にて色にじみが発生していることが分かる。そこで、この色にじみ画素に対して3×3画素のメジアンフィルタを適用すると、隣接する八画素の中で七画素の色差成分の値が「100」であり、一画素のみ色差成分の値が「10」であるため、当該色にじみ画素の色差成分の値も「100」に置き換わることになり、色にじみが低減されることが分かる。このように、メジアンフィルタはエッジ部分をぼやけさせないようにしつつ、色にじみを低減させる効果をも有しており、上記のステップS150にて当該色にじみ画素がエッジ画素であるか否かを判定する意味はかかる事由によるものである。
【0084】
なお、ここで例示したメジアンフィルタは3×3画素であるが、むろん、本実施形態にて採用する5×5画素のメジアンフィルタの場合、全二十五画素の中で中央の値を選択すればよく、3×3画素の場合と全く同様に考えることができる。また、色差成分C1について例示したが、色差成分C2についても同様であることはいうまでもない。
【0085】
ところで、平滑化フィルタとメジアンフィルタの演算速度を比べると、メジアンフィルタの方が比較的遅いため、メジアンフィルタを適用する場面は可能な限り抑えた方が処理速度上からも好適である。エッジ画素の判断基準として(9)および(10)式を採用する場合、色差成分C1,C2のいずれか一方で同式を充足する場合もあれば、色差成分C1,C2の双方で同式を充足する場合もありうる。ここで、前者の場合において、双方の色差成分についてメジアンフィルタを適用する必要性はないし、処理速度の低下を招くことから、同式を充足する色差成分においてのみステップS154でメジアンフィルタを適用し、別の一方の色差成分についてはステップS152で平滑化フィルタを適用すれば処理速度を全体として向上させることができる。むろん、エッジ画素の判断基準として(11)式を採用する場合には、いずれの色差成分の変化度合いが大きいかといったことは判断し得ないため、この場合にはステップS154で色差成分C1,C2の双方に対してメジアンフィルタを適用することになる。
【0086】
上述したように、色にじみを低減するということは、画像を滑らかにして色にじみを目立たなくすることに他ならず、その部分がぼやけた印象となってしまうことも想定しうる。そこで、本実施形態においては、次なるステップS160にてエッジ強調処理を行う。
【0087】
このエッジ強調処理は、強調前の各画素の輝度Yに対して強調後の輝度Y'が
Y'=Y+(Y−Yunsharp) …(12)
として演算される。ここで、Yunsharp は色にじみ画素の画像データに対してアンシャープマスク処理を施したものであり、次にアンシャープマスク処理について説明する。本実施形態においては、図18に示すように3×3、5×5、7×7画素からなる三種類のアンシャープマスクを備えており、それぞれステップS122〜S126で決定した平滑化フィルタのサイズに対応している。例えば、3×3画素の平滑化フィルタを選択したら、3×3画素のアンシャープマスクを選択することになる。これらのアンシャープマスクも上述した平滑化フィルタと同様に、中央の数値を各画素におけるY(x,y)の重み付けとし、その周辺画素に対して同マスクの升目における数値に対応した重み付けをして積算するのに利用される。例えば、3×3画素のアンシャープマスクを使用する場合、
【0088】
【数1】

Figure 2003102028
なる演算式に基づいて積算する。この(13)式において、「136」とは重み付け係数の合計値であり、サイズの異なる平滑化フィルタにおいては、それぞれ升目の合計値となる。すなわち、5×5画素であれば「400」となるし、7×7画素であれば「900」となる。また、Mijはアンシャープマスクの升目に記載されている重み付け係数であり、Y(x,y)は各画素における輝度成分である。さらに、ijについてはアンシャープマスクに対して横列と縦列の座標値で示している。
【0089】
Yunsharp (x,y)は色にじみ画素に対して周辺画素の重み付けを低くして加算したものであるから、この場合も同様にローパスフィルタをかけたものと同じ意味あいを持つ。従って、「Y(x,y)−Yunsharp (x,y)」とは本来の全成分から低周波成分を引いたことになってハイパスフィルタをかけたものと同様の意味あいを持つ。そして、ハイパスフルタを通過したこの高周波成分を「Y(x,y)」に加えれば高周波成分を増したことになり、エッジが強調される結果となって画像のシャープさが向上する。
【0090】
なお、これらのアンシャープマスクは図18からも明らかなように、中央部にて最も重み付けが大きく、周縁に向かうにつれて徐々に重み付け係数が小さくなっている。従って、周縁側の重み付け係数が升目の合計値に与える影響はわずかであるといえる。一方、(13)式等で示されるマトリクス演算は、処理対象画素の周囲の画素に対して、採用するアンシャープマスクの升目数だけ乗算演算と加算演算が必要になることから演算量が多大となることも観念される。そこで、本実施形態においては、予め周縁側の重み付け係数を省いて構成した3×3、5×5、7×7画素のアンシャープマスクを使用することにより演算量を削減して処理速度を高めるようにしている。
【0091】
ところで、本実施形態においては、平滑化フィルタのサイズとアンシャープマスクのサイズを同一としているが、これは次のような理由による。例えば、図19で示すビットマップ画像に図中斜線部分で示す領域に対して平滑化処理を行い、図中波線部分で示す領域に対してアンシャープマスク処理を行って輝度を強調したものとする。上述したように輝度を強調する意味は、平滑化処理されて失われたシャープさを補償するものであるから、平滑化領域の外側まで輝度を強調してしまうと、この外側の領域において不自然にシャープさが向上してしまうことが発生し得る。このため、本実施形態では平滑化フィルタとアンシャープマスクを同一サイズとしているが、むろん、前者に比べて後者のサイズが小さくなるようにしてもかまわない。
【0092】
ステップS160では上記のようなエッジ強調処理を行うとともに、強調後の輝度Y'と処理後の色差成分を用いつつ(6)〜(8)式に基づいてR',G',B'の階調データを得る。すなわち、ステップS152,S154にて色にじみを低減するとともに、ステップS160にて階調データを生成しており、これらを実行するハードウェア構成とソフトウェアとによって画像処理手段を構成することになる。
【0093】
なお、ステップS160において、強調した輝度Y'を使用することからR',G',B'の階調データが負の値となったり、「255」を越えるような値となることがある。しかし、階調幅としては、「0」〜「255」の範囲であるため、負の階調データは一律に「0」とし、「255」を越える階調データは一律に「255」とする。そして、次のステップS170にて処理対象画素を移動させ、ステップS180にて全画素について終了したと判断するまで同様の処理を繰り返す。
【0094】
ところで、色にじみ画素を中心として平滑化フィルタを適用し、その後にエッジ強調処理を行えば、平滑化処理によって色にじみが低減され、エッジ強調処理によって平滑化処理で失われた画像のシャープさが補償される。従って、本来的には色にじみ画素がエッジ画素であるか否かを問わず、全ての色にじみ画素に対して一律にかかる処理を実行すればよく、このような構成としても効果を得ることができる。しかし、かかる構成においては、経験的な見地からエッジ部分がぼやけてしまうことがあったため、色にじみ画素がエッジ画素である場合にメジアンフィルタを適用したところ良好な結果を得ることができた。
【0095】
ここで、本実施形態の平滑化処理およびエッジ強調処理の効果について、簡単な一次元のシミュレーションモデルを例示しつつ説明する。
図20は、エッジ強調処理を行わない場合の一次元シミュレーションモデルにおいて各種のパラメータの値を示す表である。同図において、左端のR,G,BのマトリクスはCCDの色フィルタ配列を示している。このマトリクスの右隣に示す「IN」は光の入射状況を示しており、「1(階調データは255)」ならば光があたっている、すなわち「白」を意味し、「0(階調データは0)」ならば「黒」を意味する。そして、CCDの各画素において、直接得ることができない色信号は隣接する画素の色信号から線形補間演算により得ているものとする。
【0096】
ここで、本来二次元の配列で考察するべきではあるが、説明を簡略化するため、上記R,G,Bのマトリクスの中央縦列に着目する。この意味において、一次元のシミュレーションモデルという。すると、上述した原理から白・黒の境界付近にそれぞれG(B)=0.5、R=0.5というように偽の色信号が発生し、この偽の色信号が発生した画素が色にじみ画素として検出される。色にじみ画素が検出されると、(6)〜(8)式に従って色差成分C1およびC2が算出され、この色差成分C1,C2が平滑化処理されて色差成分C1',C2'が得られる。なお、ここでは一次元の平滑化フィルタとして「1,1,1,1,1,1,1」を適用している。すなわち、処理対象画素の前後それぞれの三画素の画素値を合計して「7」で除算する。そして、得られた色差信号C1',C2'を(6)〜(8)式に基づいて元の色信号に戻し、平滑処理後のR',G',B'が得られる。図からも明らかなように白・黒の境界付近の画素における(R',G',B')はそれぞれ(0.75,0.61,0.61)と、(0.25,0.11,0.11)となり、本来の「IN」の値に近づいて色にじみが低減されたことがわかる。
【0097】
また、図21は、平滑化処理を行うとともに、平滑化フィルタと同一サイズのアンシャープマスクを用いてエッジ強調処理を行った場合の一次元シミュレーションモデルを同様に示している。この場合も色差成分C1,C2を求めて平滑化処理を行うことは上述したものと相違はないが、(6)〜(8)式を用いて元の色信号に戻す際に、「1,6,18,25,18,6,1」の重み付けを持たせた一次元のアンシャープマスクを利用して強調処理した輝度信号Y'を使用する。すると、白・黒の境界付近の画素における(R',G',B')はそれぞれ(0.81,0.67,0.67)と、(0.10,−0.04,−0.04)となる。むろん、RGBの信号値としてとり得る値は「0」〜「1」であるからから実際には後者のデータは(0.10,0,0)となり、図20に示すものに比べて色にじみがさらに解消されたことがわかる。
【0098】
さらに、図22は、平滑化フィルタよりも小さいサイズのアンシャープマスクを用いてエッジ強調処理を行った場合の一次元シミュレーションモデルを同様に示している。この場合、一次元の「1,11,25,11,1」という平滑化フィルタのサイズ(7桁)よりも小さい5桁のアンシャープマスクを使用している。そして、上述したものと同様にして演算を行うと、白・黒の境界付近の画素における(R',G',B')はそれぞれ(0.79,0.65,0.65)と、(0.10,−0.04,−0.04)となる。このように、図21に示すものに比べれば、色にじみの解消程度は劣るものの、図20に示すものに比べれば色にじみがさらに解消されていることがわかる。
【0099】
次に、上記構成からなる本実施形態の動作を説明する。
単板式のCCDを有するデジタルスチルカメラ12で撮像した実画像をコンピュータ21に取り込んで、プリンタ31にて印刷する場合を想定する。すると、まず、コンピュータ21にてオペレーティングシステム21aが稼働しているもとで、画像処理アプリケーション21dを起動させ、デジタルスチルカメラ12から画像データを取り込む。画像データが同オペレーティングシステム21aを介して画像処理アプリケーション21dに取り込まれたら、ステップS110にて(1)式に基づいて画像のサイズを判定するための指標値を取得するとともに、この指標値と所定のしきい値とを比較し、ステップS122〜ステップS126にて使用する平滑化フィルタおよびアンシャープマスクのサイズを決定してワークエリアに保存する。
【0100】
そして、ステップS130にて処理対象画素を初期位置に設定し、(2)式に従って当該画素とその周辺画素におけるΔRBの値を算出する。その後、ステップS140にて(5)式に基づいて処理対象画素とその周辺画素との間で同ΔRBの値の変化度合いを調べ、所定のしきい値Thと比較して同変化度合いが大きい場合に色にじみ画素と判断する。
【0101】
色にじみ画素と判断されたら、ステップS150にて(6)〜(8)式に基づいて処理対象画素およびその周辺画素について色差成分C1,C2を算出し、(9)および(10)式、あるいは(11)式などの判定基準に従って当該色にじみ画素がエッジ画素であるか否かを判断する。ここで、エッジ画素ではないものと判断した場合には、ステップS152でステップS122〜ステップS126にてワークエリアに保存しておいたフィルタサイズに等しい平滑化フィルタを作用させる。すなわち、色差成分C1,C2のそれぞれにつき、平滑化フィルタの升目に対応する画素の色差成分を合計して升目数で除算することにより平滑化処理された色差成分C1',C2'を得る。
【0102】
一方、ステップS150にて当該色にじみ画素がエッジ画素であると判断した場合には、ステップS154で同色にじみ画素を中心とした5×5画素のメジアンフィルタを作用させる。すなわち、色にじみ画素を中心とした全二十五画素の色差成分の値を昇順または降順にソートし、中央の値を選択して色にじみ画素の色差成分と置き換える。このとき、ステップS150にて(9)および(10)式の判定基準を採用した場合には、色差成分C1,C2のそれぞれにて同式を充足する色差成分についてステップS154でメジアンフィルタを適用し、同式を充足しない色差成分についてはステップS152で上記の平滑化フィルタを適用する。むろん、ここにおいて双方の色差成分について同式を充足する場合にはステップS154で色差成分C1,C2の双方についてメジアンフィルタを適用する。他方、ステップS150にて(11)式の判定基準を採用する場合には、ステップS154で色差成分C1,C2の双方に対してメジアンフィルタを適用することになる。
【0103】
その後、ステップS160にてステップS122〜S126で決定したサイズのアンシャープマスクを使用して処理対象画素およびその周辺画素について輝度成分Yの低周波成分Yunsharp を求めるとともに、元の輝度成分Yから同低周波成分Yunsharp を減算することにより高周波成分を求め、同元の輝度成分Yに当該高周波成分を加算して強調後の輝度成分Y'を得る。具体的には、(13)式などに基づいて演算を行うことになる。そして、この強調後の輝度成分Y'と処理後の色差成分を用いつつ、(6)〜(8)式に基づいて平滑処理後のR',G',B'の階調データを得る。以上の処理をステップS170にて処理対象画素を移動させながらステップS180にて全画素について実行したと判断するまで繰り返す。
【0104】
全画素について実行し終えたら、画像処理された画像データをディスプレイドライバ21cを介してディスプレイ32に表示し、良好であればプリンタドライバ21bを介してプリンタ31にて印刷させる。すなわち、同プリンタドライバ21bは色にじみが低減されたRGBの階調データを入力し、所定の解像度変換を経てプリンタ31の印字ヘッド領域に対応したラスタライズを行なうとともに、ラスタライズデータをRGBからCMYKへ色変換し、その後でCMYKの階調データから二値データへ変換してプリンタ31へ出力する。
【0105】
以上の処理により、デジタルスチルカメラ12から取り込んだ実画像データは自動的に色にじみが発生している部分のみ色にじみを低減するように画像処理されてディスプレイ32に表示された後、プリンタ31にて印刷される。すなわち、色にじみが発生している部分のみ色にじみを低減するように画像処理するため、演算量を削減して高速な画像処理を実現することができる。
【0106】
このように、画像処理の中枢をなすコンピュータ21はステップS130,S140にて低密度の要素色強度に基づいて処理対象画素が色にじみ画素か否かを判定するとともに、色にじみ画素と判定した場合にステップS150にてエッジ画素であるか否かを判断し、エッジ画素でない場合にはステップS152にて平滑化フィルタを作用させ、他方、エッジ画素である場合にはステップS154にてメジアンフィルタを作用させることにより、色にじみを低減すべく画像処理するようにしたため、演算量を削減して高速な画像処理を実行することができる。
【図面の簡単な説明】
【図1】本発明の一実施形態にかかる画像処理装置を適用した画像処理システムのブロック図である。
【図2】同画像処理装置の具体的ハードウェアのブロック図である。
【図3】デジタルスチルカメラの簡単なハードウェア構成例を示すブロック図である。
【図4】本発明の画像処理装置の他の適用例を示す概略ブロック図である。
【図5】本発明の画像処理装置の他の適用例を示す概略ブロック図である。
【図6】本発明の画像処理装置における色にじみ画素の判定と画像処理部分を示すフローチャートである。
【図7】画像サイズと平滑化領域との関係を示す図である。
【図8】3×3、5×5および7×7画素の平滑化フィルタである。
【図9】同一画素数の画像データにおいてheightとwidthの関係を示す図である。
【図10】処理対象画素を移動させていく状態を示す図である。
【図11】要素色成分の変化度合いを斜め方向の隣接画素における差分値で求める場合の説明図である。
【図12】画像の変化度合いを斜め方向の隣接画素における差分値で求める場合の説明図である。
【図13】隣接する全画素間で画像の変化度合いを求める場合の説明図である。
【図14】隣接する画素間で画像の変化度合いを求める変形例の説明図である。
【図15】隣接する画素間で画像の変化度合いを求める別の変形例の説明図である。
【図16】色にじみ画素を含むエッジ部分の画像データにおいて各画素の色差成分値の一例を示す図である。
【図17】メジアンフィルタによる演算処理の一例を説明するための図である。
【図18】3×3、5×5および7×7画素のアンシャープマスクである。
【図19】平滑化領域とエッジ強調領域との関係を示す図である。
【図20】エッジ強調処理を行わない場合の一次元シミュレーションモデルにおける各種パラメータの値を示す表である。
【図21】平滑化フィルタと同一サイズのアンシャープマスクを用いてエッジ強調処理を行った場合の一次元シミュレーションモデルにおける各種パラメータの値を示す表である。
【図22】平滑化フィルタよりも小さいサイズのアンシャープマスクを用いてエッジ強調処理を行った場合の一次元シミュレーションモデルにおける各種パラメータの値を示す表である。
【図23】色にじみの発生原理を説明するための図である。
【符号の説明】
10…画像入力装置
20…画像処理装置
21…コンピュータ
21a…オペレーティングシステム
21b…プリンタドライバ
21c…ディスプレイドライバ
21d…画像処理アプリケーション
22…ハードディスク
23…キーボード
24…CD−ROMドライブ
25…フロッピーディスクドライブ
26…モデム
30…画像出力装置Patent application title: IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND MEDIUM CONTAINING IMAGE PROCESSING CONTROL PROGRAM
1. An image processing apparatus for performing predetermined image processing on image data consisting of a plurality of element colors, comprising:
Color blur pixel detection means for detecting color blur pixels included in image data;
A means for determining whether the detected color blur pixel is an edge pixel;
What is claimed is: 1. An image processing apparatus comprising: image processing means for executing image processing for reducing color bleeding by changing an operation method according to a judgment result.
2. The image processing apparatus according to claim 1, wherein the image processing means, when the color bleeding pixel is an edge pixel, comprises pixels in a predetermined neighboring range based on the same color bleeding pixel. The median value of the target color difference component is replaced with the color difference component of the color blur pixel, and when it is not an edge pixel, the color difference component is smoothed by using the color difference component as a target for pixels in the same neighboring range. An image processing apparatus characterized by replacing the color difference component of the same color bleeding pixel.
3. The image processing apparatus according to claim 1, wherein said color blur pixel detection means determines difference data of gradation values between different element colors for each pixel. An image processing apparatus characterized by detecting a color blur pixel when the degree of change of the same difference data is larger than a predetermined threshold between pixels adjacent to each other .
4. The image processing apparatus according to claim 3, wherein said color blur pixel detection means determines a low density of said original image data in order to obtain difference data of gradation values between different element colors for each pixel. An image processing apparatus for obtaining difference data between an element color of the image and another element color.
5. The image processing apparatus according to claim 4, wherein said color blur pixel detection means, when there are a plurality of low density element colors, the gradation value for the low density element colors between adjacent pixels. An image processing apparatus characterized by detecting the color-blurred pixels based on the degree of change in difference of data.
6. The image processing apparatus according to any one of claims 3 to 5, wherein said color blur pixel detection means is based on said degree of change with respect to a low density pixel among adjacent pixels. An image processing apparatus characterized by detecting a color blur pixel.
7. An image processing method for performing predetermined image processing on image data consisting of a plurality of element colors, comprising:
Detect color blur pixels included in image data,
It is determined whether the detected color blur pixel is an edge pixel,
An image processing method characterized by executing image processing to reduce color blur by changing an operation method according to a determination result.
8. A medium storing an image processing control program for performing predetermined image processing by a computer on image data consisting of a plurality of element colors, comprising:
A function of detecting color blur pixels included in image data;
A function of determining whether the detected color blur pixel is an edge pixel;
Medium recording an image processing control program characterized Rukoto according to a determination result by changing the calculation method by and a function that executes an image processing for reducing the color blur.
Detailed Description of the Invention
[0001]
Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and a medium recording an image processing control program for performing image processing on image data and the like captured using a single-plate solid-state imaging device.
[0002]
[Prior Art]
In a digital still camera or the like using a solid-state imaging device, a single-plate method is often employed. In this single-plate method, as shown in FIG. 23A, color filters of R, G and B (red, green and blue) corresponding to each pixel of a solid-state imaging device are mosaic-like in a predetermined ratio In particular, the G color filters are arranged in a staggered manner to increase the component ratio. Therefore, in each pixel of the solid-state imaging device, only one color signal of R, G, B can be obtained, and color signals of each color can not be obtained. Therefore, color signals which can not be obtained directly in each pixel are interpolated from the color signals of the adjacent pixels to obtain color signals of all R, G and B colors, converted into gradation data, and output. It is displayed on the display based on the gradation data.
[0003]
For example, in FIG. 23A, attention is focused on the middle-stage color filter indicated by an arrow (→). And as shown to the figure (b), light shall be from the center to the left half (white part), and light shall not be from the center to the right half (black part). Here, assuming that the color signal level of each color in the lighted state is “1” and the same color signal level in the lightless state is “0”, the color signal levels of R and G are originally the same. It should be the value shown in Figure (c).
[0004]
However, as described above, the G color signal can not be obtained directly from the R color filter, and the R color signal can not be obtained directly from the G color filter. The G color signal of the corresponding pixel is obtained by linear interpolation of the G color signal of the adjacent pixel. On the other hand, the R color signal of the pixel corresponding to the G color filter is obtained by linear interpolation of the R color signal in the adjacent pixel. Then, the G and R color signal levels in each pixel have values shown in FIGS. 23 (d) and (e), respectively. As apparent from the figure, a false color signal is generated in the pixels near the boundary between the area where the light strikes and the area where the light strikes, and this false color signal causes color bleeding (called false color on the image). Also occurs ) . In particular, this color bleeding is known to be prominent at the gray-white boundary. Therefore, in order to reduce such color bleeding, a smoothing filter (low pass filter) is applied to the color difference data of all the pixels constituting the image data to make the color blurring less noticeable.
[0005]
[Problems to be solved by the invention]
The conventional techniques described above have the following problems.
Applying the smoothing filter corresponds to dispersing the color component of one pixel to peripheral pixels, and performing matrix calculation of 5 × 5 pixels or the like centering on the same pixel. For example, in the case of performing a matrix operation of 5 × 5 pixels, 5 × 5 = 25 operations are performed per pixel. Therefore, in the case of targeting all the pixels, the processing amount may be a huge amount of calculation of 25 × the number of pixels, and the processing time may be long.
On the other hand, when the above-described smoothing processing is performed, the image also tends to be blurred. In particular, when color bleeding pixels occur at an edge portion which is a boundary portion of the image, the image of the edge portion may be blurred.
[0006]
The present invention has been made in view of the above problems , and it is an image processing capable of preventing blurring of an image at an edge portion and shortening processing time in reducing color bleeding in image data. An object of the present invention is to provide an apparatus, an image processing method, and a medium storing an image processing control program.
[0007]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to claim 1 is an image processing apparatus which performs predetermined image processing on image data composed of a plurality of element colors, and detects color blur pixels included in the image data. Color blur pixel detection means, means for determining whether the detected color blur pixel is an edge pixel, and an image for executing image processing for reducing color blur by changing the calculation method according to the determination result And processing means .
[0008]
In the invention according to claim 1 configured as described above, when the color blur pixel detection means detects a color blur pixel included in the image data, it is determined whether the detected color blur pixel is an edge pixel or not. Then, the image processing means executes the image processing to reduce the color blur by changing the calculation method according to the judgment result .
[0009]
More specifically, in the invention according to claim 2, in the image processing apparatus according to claim 1, the image processing means, when the color bleeding pixel is an edge pixel, the same color bleeding pixel The median value of the color difference component for pixels in a predetermined nearby range as a reference is replaced with the color difference component of the color blur pixel, and if it is not an edge pixel, the color difference component is smoothed for pixels in the same nearby range. The color difference component that has been subjected to the conversion processing and smoothed is replaced with the color difference component of the same color blur pixel .
[0010]
If the above-described smoothing processing is performed on pixels in a predetermined range based on color blur pixels and then the above-described edge enhancement processing is performed, it is possible to compensate for the sharpness lost by the smoothing processing. However, from an empirical point of view, when color-blurred pixels occur at an edge portion which is a boundary portion of the image, the image of the edge portion may be blurred.
[0011]
That is, when a color blur pixel is detected, it is determined whether the color blur pixel is an edge pixel. In this case, when it is determined that the pixel is an edge pixel, the image processing means detects the color difference component for a pixel in a predetermined range based on the color blur pixel as described above, and The color difference component having the value is replaced with the color difference component of the color blur pixel, and then the original element color component is restored. On the other hand, when it is determined that the pixel is not an edge pixel, as described above, the color difference components of pixels in a predetermined range based on the color blur pixel are smoothed and then returned to the original element color components.
[0012]
For example, when a color blur pixel is generated at the boundary between white and black, the color difference component of the color blur pixel is replaced with the color difference component of the peripheral pixel to become a purely white or black pixel, so the color blur is eliminated. Even if it is done, the boundary part will not be blurred. Further, in determining whether or not the pixel is an edge pixel, since the degree of change in color difference component between adjacent pixels in the edge pixel becomes large, the degree of change in color difference component is compared with a predetermined threshold value; When the change degree of the same color difference component is larger, it may be determined as an edge pixel. Of course, edge pixels may be regarded as pixels having a large luminance gradient, and edge pixels may be determined based on the degree of change in luminance component between adjacent pixels.
[0013]
A specific median filter or the like may be applied as a specific configuration for selecting the central value of the color difference components for pixels in a predetermined range.
[0014]
On the other hand, various methods can be adopted for detection of color blur pixels, but as an example, the invention according to claim 3 relates to the image processing apparatus according to any one of claim 1 or 2 The color blur pixel detection unit obtains difference data of gradation values between different element colors for each pixel, and when the change degree of the difference data between pixels adjacent to each other is larger than a predetermined threshold value It is configured to detect that it is a color blur pixel .
[00 15 ]
In the invention as set forth above, in the invention according to the third aspect , the color blur pixel detection means obtains difference data of gradation values between different element colors for each pixel, and the difference data between adjacent pixels is the same. When the degree of change of is larger than a predetermined threshold value, it is detected as a color blur pixel.
[00 16 ]
For example, image data to be subjected to image processing, when made of dot matrix of pixels imaged by a single-plate solid-state imaging device, the solid-state image pickup device of a single plate color filter of a plurality of element colors are in a non-uniform density Since they are arranged like a mosaic, they are supplemented by calculation so as to obtain uniform density, but as described above, false color components are generated during this calculation to cause color bleeding. The color blur pixel detection unit detects a color blur pixel in which such color blur occurs, and the image processing unit detects a color blur in a predetermined range of pixels based on the detected color blur pixel. Image processing to reduce.
[00 17 ]
When detecting the presence or absence of color bleeding for a certain pixel, it is impossible to uniformly detect the presence or absence of color bleeding from the element color components for the pixel, so it is necessary to detect the presence or absence of color bleeding as compared to peripheral pixels. become. Also, although the occurrence of color bleeding is caused by the above-mentioned false element color components, such false element color components are caused by the fact that color filters of each element color are arranged at non-uniform density in the solid-state imaging device. It can be said that component color components for low density color filters are likely to be generated.
[00 18 ]
Therefore, attention is paid to element color intensity (such as gradation value) for a low density color filter between the pixel to be detected and a pixel close to the pixel, and the color blur pixel is determined based on the change degree of this element color intensity. It can be detected.
[00 19 ]
Here, as an example of a specific method for detecting color blur pixels, the invention according to claim 4 relates to the image processing apparatus according to claim 3 , wherein the color blur pixel detection unit is different for each pixel In order to obtain difference data of gradation values between element colors, difference data between a low density element color and other element colors in the original image data is obtained.
[00 20 ]
In the invention according to Claim 4 as constructed above, the pixel detector blur the color determines the difference data between the low density component color and other element color in the original image data, the difference data Color blur pixels are detected based on the degree of change of.
[00 21 ]
For example, if it is known in advance that the R and G color filters are alternately arranged, as in the middle line in FIG. 23A, the low density color filter is R, so the reference element color G is employed as a component, and the degree of change of the difference ΔRG = | R−G | between the two is examined between adjacent pixels. Then, the value of this ΔRG is as shown in FIG. 23 (f). Focusing on the degree of change of ΔRG between adjacent pixels, “0” at the pixel near the boundary between the area where the light strikes and the area not lit. .5 ”, and such pixels are detected as color blur pixels.
[00 22 ]
The method for detecting color-blurred pixels based on the degree of change in the difference in element color intensity does not have to be confined to the above-described one. For example, the invention according to claim 5 relates to the image processing according to claim 4 In the apparatus, when there are a plurality of low-density element colors , the color-blur pixel detection means detects the color-blurring pixels based on the degree of change in the gradation value data to the low-density element colors between adjacent pixels. It is as composition to detect.
[00 23 ]
In the invention according to claim 5 configured as described above, when the low-density color filters there are a plurality of pixel detector blur the color, each low-density element color of between pixels adjacent to each other The difference of the gradation value data with respect to is calculated, and the color blur pixel is detected based on the change degree of the difference.
[00 24 ]
That is, as described above, since the false element color components appear prominently with respect to the element color for the low density color filter, attention is paid to the difference between the element color intensities for the low density color filter. For example, as shown in FIG. 23A, when the density of the G color filter is high and the density of the R and B color filters is low, false element color components appear prominently in R and B. It will be. In this case, it is assumed that the middle line is similarly focused, and the color signal level of B in each pixel of the middle line is linearly interpolated from the B color filter adjacent to the upper line side. Then, the color signal level of B in each pixel of the middle line becomes the same as that shown in FIG. 6D, and the difference ΔRB = | R−B | = ΔRG between the color signal levels of R and B. Accordingly, since the value of ΔRB between adjacent pixels is also as shown in FIG. 6F, the change degree of ΔRB is “0.5” in the pixels near the boundary between the light incident region and the light non-incident region. And such pixels are detected as color blur pixels.
[00 25 ]
Regardless of whether you focus on the degree of change in the difference between the reference element color intensity and the low density element color intensity or on the degree of change in the difference between the low density element color intensities, between adjacent pixels Various aspects can be considered as to whether to examine the degree of change. For example, the degree of change may be checked among pixels adjacent in eight directions, that is, the horizontal direction, the vertical direction, and the oblique direction, and the amount of calculation can be reduced by appropriately reducing the comparison direction. For the reason described above, it can be said that false element color components are likely to be generated in pixels for low density color filters. Therefore, when examining the degree of change, it is better to investigate between pixels for low density color filters Is preferred. Therefore, according to the invention as claimed in claim 6 , in the image processing apparatus according to any one of claims 3 to 5, the color-blurring pixel detection means is between adjacent pixels having a low density. The color blur pixel is detected based on the degree of change.
[00 26 ]
In the invention as set forth above, in the invention according to claim 6 , the color blur pixel detection means detects a color blur pixel by checking the degree of change with the pixel corresponding to the adjacent low density element color. .
[00 27 ]
Further, since sometimes sharpness of the image is lost by the smoothing processing, the image processing means may configured to edge enhancement processing.
[00 28 ]
When configured as above, the image processing means performs edge enhancement processing on the image data to compensate for the sharpness lost in the smoothing process.
[00 29 ]
As described above, even if edge enhancement processing is performed, it is also thought that if the edge enhancement is performed to the area where the above-described smoothing processing is not performed, the outside of the area to be smoothed is unnaturally edge-emphasized. The image processing means may be configured to perform edge enhancement processing on pixels in a range to be subjected to the smoothing processing.
[00 30 ]
When configured as described above, the image processing means performs edge enhancement processing on pixels within a range to be subjected to the smoothing processing where sharpness tends to be lost.
[00 31 ]
By the way, when performing the smoothing process, it is not a good idea to perform the smoothing process of the same range uniformly in all the image data. For example, it is assumed that smoothing processing in the same range is performed on both image data having a large image size and image data having a small image size. In this case, since the ratio of the range of smoothing processing in the former to the image and the ratio in the latter are different, even if good results are obtained in the former, the whole may be too blurry in the latter. obtain. Therefore, when performing the smoothing process on pixels in a predetermined range based on the detected color blur pixels, the image processing means performs the smoothing process when the size of the image to be processed is large. the greatly, it may be configured to reduce the range to handle the smoothing when the size of the image is small.
[00 32 ]
When configured as described above, the image processing means detects in advance the size of the image data to be subjected to the image processing, and if the size of the image data is large, the range to be subjected to the smoothing process is enlarged. If the size of is smaller, the range to be smoothed is reduced. Specifically it holds the plurality of smoothing filters having different sizes can be realized by such as to selectively smoothing filter in accordance with the image size.
[00 33 ]
The method of changing the calculation method depending on whether or not the color-blurred pixels are edge pixels is not necessarily limited to the device having a substance, and as an example, the invention according to claim 7 uses a plurality of element colors An image processing method of performing predetermined image processing on the image data, detecting a color blur pixel included in the image data, and determining whether the detected color blur pixel is an edge pixel; According to the determination result, the calculation method is changed to execute image processing for reducing color blur .
[00 34 ]
That is, the present invention is not necessarily limited to a device having substance, and there is no difference in that the method is effective.
[00 35 ]
By the way, as described above, an image processing apparatus that detects color bleeding pixels and reduces color bleeding for a predetermined range of pixels based on the color bleeding pixels may be present alone or may be incorporated in a certain device. The concept of the invention includes various aspects, such as being used in a state. In addition, it can be changed as appropriate, such as hardware or software.
[00 36 ]
In the case of software for controlling an image processing apparatus as an embodiment of the concept of the invention, it naturally can be said to be present and used also on a recording medium on which such software is recorded. As an example thereof, the invention according to claim 8 is a medium recording an image processing control program for performing predetermined image processing with a computer on image data consisting of a plurality of element colors, and the color included in the image data A function to detect a blur pixel, a function to determine whether or not the detected color blur pixel is an edge pixel, and an image processing to reduce color blur by changing the calculation method according to the determination result It is as composition which realizes a function .
[00 37 ]
Of course, the recording medium may be a magnetic recording medium or a magneto-optical recording medium, and any recording medium developed in the future can be considered in the same way. In addition, the replication stages of the primary copy, the secondary copy, etc. are the same without any doubt.
[00 38 ]
Furthermore, even when a part is software and a part is realized by hardware, there is no difference in the concept of the invention, and a part is stored on a recording medium, and as needed, as appropriate. It may be in a form to be read.
[0039]
【Effect of the invention】
As described above, according to the present invention, it is possible to prevent the edge from being blurred by changing the calculation method in accordance with whether or not the color blur pixel is an edge pixel.
[0040]
As an example, according to the second aspect of the present invention, when the color blur pixel is an edge pixel, the central value of color difference components of pixels in a predetermined range is used as a color blur pixel and not an edge pixel. Since the smoothing process is performed, the edge portion of the image is not blurred.
[0041]
Furthermore, according to the invention of claim 3, color blur pixels are detected by a relatively simple calculation method, and color blur is reduced for pixels in a predetermined range based on the color blur pixels. It is possible to provide an image processing apparatus capable of reducing the amount of calculation and shortening the processing time .
[0042]
Furthermore, according to the fourth aspect of the present invention, since it is sufficient to pay attention to the low density element color, it is possible to easily detect color blur pixels .
[0043]
That is, since the degree of change of the difference between the low density element color and the other element colors may be examined, the color blur pixel detection operation can be easily performed.
[0044]
Furthermore, according to the invention of claim 5, when there are a plurality of low density element colors, it is sufficient to uniformly pay attention to the degree of change of the difference between the low density element colors. easily it can line Ukoto.
[0045]
Further, according to the invention of claim 6, since the degree of change of the difference between the low density element color pixel and the low density element color pixel is checked, more reliable detection can be performed.
[0046]
Furthermore, even when color bleeding is reduced by the smoothing process, the color difference component may be smoothed to return to the original element color component, so that the calculation can be easily performed.
[0047]
Furthermore, if edge enhancement processing is performed, it is possible to compensate for the reduction in image sharpness due to the smoothing processing .
[0048]
Furthermore, if edge enhancement processing is performed on the pixels in the range to be subjected to the smoothing processing, the sharpness does not increase unnaturally for pixels outside the range of the smoothing processing.
Furthermore, if the range to be subjected to the smoothing process is changed according to the size of the image to be processed, it is possible to perform the smoothing process of the optimum range.
Furthermore, it is possible to reduce color bleeding by using the central value as the color bleeding pixel in the color difference components of pixels in a predetermined range .
[0049]
Furthermore, according to the seventh aspect of the present invention, it is possible to provide an image processing method in which the edge is not blurred in the same manner. According to the eighth aspect of the present invention, the image processing control program is recorded. A medium can be provided.
[0050]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described based on the drawings.
FIG. 1 is a block diagram showing an image processing system to which an image processing apparatus according to an embodiment of the present invention is applied, and FIG. 2 is a schematic block diagram showing a specific hardware configuration example.
In FIG. 1, the image input device 10 outputs to the image processing device 20 as image data in which an actual image or the like captured using a single-plate CCD is represented by pixels in a dot matrix. According to the principle described above, color blur occurs in image data captured by a single-plate CCD, and the image processing apparatus 20 detects color blur pixels in the input image data and within a predetermined range based on the color blur pixels The image processing is performed so as to reduce color bleeding and the image is output to the image output device 30, and the image output device 30 outputs the image data subjected to the image processing in dot matrix pixels.
[0051]
The image processing apparatus 20 is provided with a color blur pixel detection means for detecting color blur pixels, and an image processing means for performing image processing so as to reduce color blur based on the detected color blur. It can be said that it is equipped with
[0052]
A specific example of the image input device 10 corresponds to the film scanner 11, the digital still camera 12 or the video camera 14 provided with the single-plate type CCD in FIG. For example, FIG. 3 is a schematic block diagram showing an example of a simple hardware configuration of the digital still camera 12. In the figure, incident light is received by the CCD 12b via the optical system 12a. In the CCD 12b, color filters of R, G and B colors are arranged at a predetermined ratio corresponding to each pixel, and a driving circuit 12c outputs a color signal of each pixel. The output color signal is digitally converted and input to the interpolation operation circuit 12d, and the color signal for an element color component which can not be directly obtained in each pixel by the interpolation operation circuit 12d is calculated by linear interpolation operation from surrounding pixels. It is acquired and stored in the image memory 12e as RGB gradation data.
[0053]
A specific example of the image processing apparatus 20 corresponds to a computer system including a computer 21, a hard disk 22, a keyboard 23, a CD-ROM drive 24, a floppy disk drive 25 and a modem 26. A specific example of the image output apparatus 30 is a printer 31 and display 32 grade | etc., Correspond. The modem 26 is connected to a public communication line, connected to an external network via the public communication line, and can download and introduce software and data.
[0054]
In the present embodiment, the film scanner 11 as the image input device 10 and the digital still camera 12 output RGB gradation data as image data, and the printer 31 as the image output device 30 outputs CMY (cyan) as gradation data. The display 32 needs as input the RGB gray scale data as an input, and also requires CMYK binary data with magenta, yellow, or black added thereto.
[0055]
On the other hand, in the computer 21, an operating system 21a is in operation, and a printer driver 21b and a display driver 21c corresponding to the printer 31 and the display 32 are incorporated. The image processing application 21 d is controlled by the operating system 21 a to execute processing, and executes predetermined image processing in cooperation with the printer driver 21 b and the display driver 21 c as necessary. Therefore, the specific role of the computer 21 as the image processing apparatus 20 is to input RGB gradation data, detect color blur pixels, and perform image processing on the image to reduce color blur. Is displayed on the display 32 via the display driver 21c, and converted to binary data of CMY (or CMYK) via the printer driver 21b and printed on the printer 31.
[0056]
As described above, in the present embodiment, a computer system is incorporated between image input / output devices to perform image processing, but such a computer system is not necessarily required, and a single-plate type CCD may be used. The present invention can be applied to a system that performs image processing to reduce color bleeding with respect to image data that has been picked up and subjected to interpolation calculation as described above to cause color bleeding. For example, as shown in FIG. 4, an image processing apparatus for performing image processing is similarly incorporated in a digital still camera 13a provided with a single-plate CCD, and displayed on a display 32a using image data with reduced color bleeding. It may be a system for printing on a computer. Further, as shown in FIG. 5, in the printer 31b which inputs and prints image data without passing through a computer system, an image is inputted through a film scanner 11b having a single-plate type CCD, a digital still camera 13b or the like. It is also possible to configure the image processing so as to reduce color bleeding to the data.
[0057]
Specifically, the above-described image processing for detecting the color-blurring pixels and reducing the color-blurring is performed in the computer 21 using an image processing program corresponding to the flowchart shown in FIG.
The method of reducing color bleeding employed in this embodiment is the same as the conventional method in that it is performed by causing a smoothing filter or the like to act as described later, but the area to which the smoothing filter or the like is applied is color bleeding pixel It is different from the conventional one by being limited to the periphery. Here, with regard to the image data to be processed, consider bitmaps of two different image sizes as shown in FIGS. 7A and 7B and perform smoothing with the same size indicated by hatched portions in the drawing for both of them. Let the filter act. If the image size is different, if each pixel of the image data and each pixel of the CCD correspond one to one, the image size naturally varies according to the number of pixels of the CCD used, but CCDs of the same number of pixels Even in the case of use, the image size may be changed appropriately by expansion and contraction, and such a case shall be included.
[0058]
As apparent from the figure, as long as the smoothing filter of the same size is applied, if the image size is different, the ratio of the area to be smoothed to the entire image is also different. Therefore, if a smoothing filter of the same size is uniformly applied to image data of any image size, an area of an appropriate size may be smoothed as shown in FIG. 7A. For example, as shown in FIG. 6B, the ratio of the area to be smoothed to the entire image may be large. Since the smoothing process is nothing but blurring the image, most of the image may be blurred in the case shown in FIG.
[0059]
Therefore, in the present embodiment, smoothing filters of a plurality of different sizes such as 3 × 3, 5 × 5, 7 × 7 pixels as shown in FIG. 8 are held, and these smoothings are performed according to the image size. Filters are used appropriately. Here, in determining the image size of the bitmap image, (height) × (width) of the image may be calculated to obtain the number of pixels, and the calculated number of pixels may be used as an index. The image size of the processing target image is determined according to A represented by the following equation.
[0060]
A = min (height, width) ... (1)
Here, min (height, width) means either height or width, whichever is smaller. And, in step S110,
If A <300, then
If 3 × 3 pixel smoothing filter 300 ≦ A ≦ 600, then
If 5 × 5 pixel smoothing filter A> 600, then
The processing branches as a 7 × 7 pixel smoothing filter, and the type of smoothing filter used in steps S122 to S126 is stored in the work area. The work area may be a RAM in the computer 21 or a hard disk 22.
[0061]
The reason why min (height, width) is used here is as follows. In order to determine whether the size of the smoothing filter is appropriate, it may be determined by the ratio of the number of pixels to be subjected to the smoothing process to the total number of pixels. However, for example, even if the image data has the same number of pixels, if there is a wide image as in the bitmap image shown in FIG. 9A, the height direction as in the bitmap image shown in FIG. Some standard images have a slightly longer width than in the width direction. Assuming that the smoothing filter to be used is determined according to the total number of pixels of the processing target image, the same smoothing filter is selected by both. Then, even if the size of the smoothing filter is appropriate in the latter, the height direction may be smoothed over almost the entire length in the former, and in such a case, an impression of being visually blurred may be received. . Therefore, such a bad effect can be avoided by using the smaller one of height and width as a reference.
[0062]
Referring to the flowchart of FIG. 6, as shown in FIG. 10, with respect to the image data consisting of pixels in a dot matrix, the processing object pixel is subscanned and moved in the vertical direction while being main scanned in the horizontal direction. It is determined whether or not it is a pixel.
[0063]
When the image data is composed of dot matrix pixels, each pixel is represented by RGB gradation data ("0" to "255"). After storing the type of smoothing filter used in steps S122 to S126 in the work area, the difference ΔRB between the gradation data of R and B in the target pixel and its peripheral pixels is calculated in the next step S130. This ΔRB is
ΔRB = | R−B | (2)
It is expressed as
[0064]
As shown in FIG. 23A, in the CCD according to this embodiment, color filters of R, G, and B are arranged in a mosaic corresponding to each pixel, and only the G color filter is in a zigzag form. It is placed and denser, and the R and B color filters are less dense. Then, color signals which can not be obtained directly in each pixel are subjected to linear interpolation calculation from color signals of adjacent pixels to obtain color signals of all colors R, G and B, and converted into gradation data. Therefore, from the probability, as a result of the interpolation operation, for the low density R and B gradation data at a certain pixel, the original intensity can not be obtained, or a color component that is not originally necessary is generated. Can be said to cause color bleeding.
[0065]
In addition, color bleeding is known to be prominent particularly near the boundary between white and black. For example, when white is expressed in a pixel corresponding to the R color filter, the original RGB gradation data is (R, G, B) = (255, 255, 255). , G, B) = (255, 255, 127). In this case, since the G color filter has a high density, the probability of generating a false element color component by interpolation calculation is small for the G component, while the R component can be obtained directly from the color filter. Color component does not occur. Basically, if white is expressed in a certain pixel, ΔRB is “0”, and even if black is expressed, ΔRB should be “0”, but in color-blurred pixels, ΔRB is compared with this. The tendency of the value of
[0066]
Of course, depending on the image data, pixels with high R and G components and low B components may naturally be present. However, in such a case, each element color component is held also in the adjacent pixel, and the value of ΔRB often changes gently as it goes away from the pixel. On the other hand, while color bleeding occurs in principle in pixel units, and one of the adjacent pixels is a pixel such as white or black, a pixel having a large change in ΔRB between adjacent pixels It can be said that there is no mistake in making a pixel into a color. Therefore, in the present embodiment, as described later, the degree of change in the value of ΔRB is checked between the processing target pixel and the peripheral pixels, and a pixel with a large degree of change is detected as a color blur pixel. Of course, since the G color filter has a high density, it can be said that the possibility of generating a false element color component due to the interpolation operation is low, so equation (2) is based on this element color component
ΔGR = | G−R | (3)
ΔGB = | G−B | (4)
It is possible to substitute for the expression
[0067]
Further, in order to check the degree of change of such ΔRB, it is preferable to compare between pixels corresponding to low density color filters. That is, since false element color components are more likely to be generated in the pixels corresponding to the low density color filter compared to the pixels corresponding to the high density color filter, ΔRB between the pixels corresponding to the low density color filter It is possible to perform more reliable detection by comparing the degree of change.
[0068]
The detection of an actual color blur pixel is performed in step S140. In this step S140, it is determined whether or not it is a color blur pixel based on the degree of change between .DELTA.RB calculated in the above manner among the peripheral pixels. At this time, as shown in FIG. 11, consider a matrix centered on the processing target pixel, x in the horizontal direction and y in the vertical direction,
E = 4ΔRB (x, y) -2ΔRB (x-1, y-1)
−2ΔRB (x + 1, y−1) (5)
The magnitude relationship between the value of E represented by and the predetermined threshold value Th is compared. Then, if E ≧ Th, it is determined that the pixel is a color blur pixel. Therefore, in step S130 described above, ΔRB (x, y) in the pixel to be determined is obtained in advance, and ΔRB (x−1, y−1) and ΔRB (x + 1, y−) as values of ΔRB in the peripheral pixels are obtained. I will ask for 1).
[0069]
The meaning of detecting color-blurred pixels according to the judgment criteria of E ETh is as follows. If color blur occurs in the pixel to be processed, the degree of change in ΔRB value between the pixel and its peripheral pixels becomes large, and the value of E also becomes large according to equation (5), and the predetermined threshold Th When it exceeds, it is judged as a color blur pixel. Further, referring to equation (5) and FIG. 11, it can be easily understood that the degree of change in ΔRB is examined between the pixel to be determined and the pixel in the oblique direction. Here, referring to FIG. 23A, if the pixel to be judged corresponds to R, the pixel in the oblique direction corresponds to B, and if the pixel to be judged corresponds to B, the pixel in the diagonal direction to R If the pixel to be determined corresponds to G, the pixel in the diagonal direction corresponds to G. That is, when the pixel to be determined corresponds to a low density element color, the change degree of the ΔRB value is checked with the pixels corresponding to the adjacent low density element color, and the element to be determined has a high density If it corresponds to a color, it means that the degree of change in ΔRB is examined between pixels corresponding to adjacent high density element colors.
[0070]
Therefore, in steps S130 and S140, color blur pixels are detected based on the degree of change in difference between element color intensities for low density color filters between pixels adjacent to each other. To constitute a color blur pixel detection means.
[0071]
If it is determined in step S140 that the pixel is a color blur pixel, it is determined in step S150 whether the pixel is an edge pixel. Since the method based on the color difference component is effective in determining whether or not the pixel is an edge pixel, in the present embodiment, the luminance component Y is subtracted from the gradation data of R and B, and the color difference component C1 is calculated. , C2. The color difference components C1 and C2 are
C1 = RY (6)
C2 = B-Y (7)
It can be expressed as.
[0072]
However, although the gradation data of RGB does not directly have a luminance value, and it is possible to perform color conversion to the Luv color space to obtain the luminance, it is not a solution because of problems such as the amount of calculation. Therefore, the conversion equation of the following equation is used to directly obtain the luminance from RGB used in the case of a television or the like.
Y = 0.30 R + 0.59 G + 0.11 B (8)
[0073]
Since the edge pixel is a boundary portion of the image, it can be said that the degree of change of the color difference components C1 and C2 is large between adjacent pixels. Therefore, when one of the following two judgment criteria is satisfied, it is used as an edge pixel It can be judged.
| C1 (x, y) -C1 (x-1, y-1) | ≧ Th1 (9)
| C2 (x, y) -C2 (x-1, y-1) | ≧ Th2 (10)
Here, x indicates the coordinate in the horizontal direction, and y indicates the coordinate in the vertical direction.
[0074]
That is, as shown in FIG. 12, the meaning of the equations (9) and (10) is that, in image data composed of pixels in a dot matrix form centering on the color blur pixels, adjacent pixels in the oblique direction The degree of change of the color difference components C1 and C2 is obtained, and it is determined that it is determined whether or not the threshold values Th1 and Th2 or more are present. Then, when one of the judgment criteria is satisfied, it is judged as an edge pixel. Of course, the pixels are inherently arranged in a grid in the vertical and horizontal directions as shown in FIG. 13, and focusing on the central pixel, there are eight adjacent pixels. Therefore, similarly, while obtaining the degree of change of the color difference components C1 and C2 between respective adjacent pixels, the comparison operation is performed between the threshold values Th1 and Th2, respectively, and the color difference component is obtained by any one comparison operation. When the degree of change of C1 or C2 is equal to or greater than the threshold Th1 or Th2, it may be determined as a color bleeding pixel.
[0075]
As described above, although it is effective to determine whether the color bleeding pixel is an edge pixel based on the degree of change of the color difference components C1 and C2, one color bleeding pixel is adjacent. Since it is necessary to perform the comparison operation on the color difference components C1 and C2 in each of the eight pixels, the amount of operation may be large and the processing speed may be reduced. Therefore, as shown in FIG. 14, the comparison operation may be performed on four pixels in the vertical and horizontal directions, or the comparison operation may be performed on four pixels in the diagonal direction as shown in FIG. Absent.
[0076]
In addition, whether or not the pixel is an edge pixel may be determined based on the magnitude of the luminance gradient. In this case, the above equations (9) and (10) may be substituted by the following equation.
| Y (x, y) −Y (x−1, y−1) | ≧ Th3 (11)
It is easy to see that if the equation (11) is used as the judgment criterion of the edge pixel, the amount of operation can be halved as compared with the case where the equations (9) and (10) are used.
[0077]
If it is determined in step S150 that the color bleeding pixel is not an edge pixel, the smoothing filter determined in step S122 to step S126 is applied to the same color bleeding pixel in step S152 to generate the same color bleeding pixel. A smoothing process is performed on pixels in a predetermined range as a reference. Of course, since the smoothing of the color difference component is effective in performing the smoothing process, in the present embodiment, the color difference components C1 and C2 calculated based on the equations (6) and (7) are smoothed. Apply processing
[0078]
Here, the smoothing processing using the smoothing filter will be described. In each smoothing filter shown in FIG. 8, the central numerical value is used as weighting of the color difference components C1 and C2 of the processing target pixel in the matrix-like image data, and the peripheral pixels correspond to the numerical values in the square of the smoothing filter. Used for weighting and integration. In this case, since “1” is set in all the squares, the smoothed color difference component C1 ′ is obtained by summing the color difference components C1 of the respective squares and dividing by the total number of squares, and the smoothed color difference component C2 'Is also obtained in the same way. Of course, each grid may be appropriately weighted. However, since applying a smoothing filter is performing the matrix operation as described above, if each cell is given a weight, the amount of operation also increases. That is, in the present embodiment, since "1" is set in each cell of the smoothing filter, data of each pixel may be summed and divided by the number of cells, but weighting is performed for each cell In this case, the number of operations is increased because multiplication and addition operations are required by the number of cells.
[0079]
If such a matrix operation is performed on all the pixels of the image data as in the prior art, the amount of operation may be enormous and a long processing time may be required. Therefore, if color blur pixels are detected and smoothing processing is performed on the periphery of the color blur pixels as in the present embodiment, a significant reduction in the amount of calculation is expected, and high-speed image processing can be realized. Become.
[0080]
On the other hand, if it is determined in step S150 that the color bleeding pixel is an edge pixel, then in step S154, a median filter of 5 × 5 pixels is applied centering on the same color bleeding pixel. The size of the median filter to be actually applied does not necessarily have to be 5 × 5 pixels, and can be changed as appropriate, such as applying a 3 × 3 pixel median filter. Therefore, for convenience of explanation, the case of applying a 3 × 3 pixel median filter will be described.
[0081]
For example, as shown in FIG. 16, a dot matrix of 3 × 3 pixels centering on color blur pixels is considered. The value of each grid indicates the value of the color difference component C1, and the diagonal lines in the figure correspond to the edge direction. Here, applying a 3 × 3 pixel median filter sorts the values of the color difference components C1 of all nine pixels in ascending or descending order, selects the center value and replaces the color difference component C1 of the color blur pixel It means that. That is, in the example shown in the figure, six pixels of the color difference component C1 of "10" exist, one pixel of "40" exists, and three pixels of "100" exist. Therefore, if these values are temporarily sorted in ascending order, they are as shown in FIG. Then, as is clear from the same figure, the central value is "10", and the color difference component C1 of the color blur pixel is "10".
[0082]
On the other hand, assuming that a smoothing filter of 3 × 3 pixels is applied here, “33”, which is a value obtained by dividing the total value “300” of the squares by the number of pixels “9”, is the color difference component after the smoothing process. It becomes C1 '. The color difference component C1 ′ after the smoothing processing is obtained by averaging and adding the color difference components C1 of the peripheral pixels to the color blur pixel, and therefore, the image data is smooth. In this way, the smoothed image has the same meaning as the so-called low-pass filtered image, and the image is smoothed to make the color blur less noticeable, but the edge portion also looks blurry. Absent. Therefore, it is apparent from the above calculation result that the edge portion is not blurred if the above-described median filter is applied to the edge pixel.
[0083]
On the other hand, referring to FIG. 16, it can be seen that color bleeding occurs at a pixel whose value of the color difference component C1 is "40". Therefore, when a median filter of 3 × 3 pixels is applied to this color bleeding pixel, the value of the color difference component of seven pixels among the adjacent eight pixels is “100”, and the value of the color difference component of only one pixel is “ 10, the value of the color difference component of the color blur pixel is also replaced with “100”, and it is understood that the color blur is reduced. As described above, the median filter also has the effect of reducing color bleeding while preventing the edge portion from being blurred, and it is determined in step S150 whether or not the color bleeding pixel is an edge pixel. The meaning is due to this reason.
[0084]
Although the median filter illustrated here is 3 × 3 pixels, of course, in the case of the 5 × 5 pixel median filter adopted in the present embodiment, it is possible to select the center value among all twenty-five pixels. This can be considered exactly the same as in the case of 3 × 3 pixels. Further, although the color difference component C1 has been illustrated, it goes without saying that the same applies to the color difference component C2.
[0085]
By the way, comparing the operation speeds of the smoothing filter and the median filter, the median filter is relatively slow, so it is preferable from the viewpoint of processing speed to suppress the scene where the median filter is applied as much as possible. When the equations (9) and (10) are adopted as the judgment criteria of the edge pixel, the equation may be satisfied by either one of the color difference components C1 and C2 or by both of the color difference components C1 and C2. There is also a possibility of fulfillment. Here, in the former case, there is no need to apply a median filter to both color difference components, and the processing speed is reduced, so the median filter is applied in step S154 only to the color difference components satisfying the equation, The processing speed can be improved as a whole by applying a smoothing filter in step S152 for another color difference component. Of course, when equation (11) is adopted as the determination criterion of the edge pixel, it can not be determined which change component of the color difference component is large. In this case, the color difference components C1 and C2 are selected in step S154. Apply the median filter to both
[0086]
As described above, reducing color bleeding is nothing but making the image smooth so as to make the color blurring less noticeable, and it can also be assumed that the portion becomes a blurred impression. Therefore, in the present embodiment, edge enhancement processing is performed in the next step S160.
[0087]
In this edge enhancement processing, the luminance Y ′ after enhancement is Y ′ = Y + (Y−Yunsharp) (12) with respect to the luminance Y of each pixel before enhancement.
Calculated as Here, “Yunsharp” is obtained by applying unsharp mask processing to image data of color blur pixels, and the unsharp mask processing will be described next. In the present embodiment, as shown in FIG. 18, three unsharp masks consisting of 3 × 3, 5 × 5, 7 × 7 pixels are provided, and the size of the smoothing filter determined in steps S122 to S126, respectively. It corresponds to For example, if a 3 × 3 pixel smoothing filter is selected, a 3 × 3 pixel unsharp mask is selected. In these unsharp masks, as in the case of the smoothing filter described above, the central numerical value is weighted for Y (x, y) at each pixel, and the peripheral pixels are weighted corresponding to the numerical values at the squares of the mask. It is used to calculate the For example, when using a 3 × 3 pixel unsharp mask,
[0088]
[Equation 1]
Figure 2003102028
The integration is performed based on the following equation. In the equation (13), "136" is the total value of weighting coefficients, and in the case of smoothing filters having different sizes, the total value of squares is obtained. That is, if it is 5x5 pixels, it will be "400", and if it is 7x7 pixels, it will be "900". Further, M ij is a weighting coefficient described in the square of the unsharp mask, and Y (x, y) is a luminance component at each pixel. Further, ij is indicated by row and column coordinate values for the unsharp mask.
[0089]
Since Yunsharp (x, y) is a color-blurred pixel and weighted with peripheral pixels at a low weight, it has the same meaning as in the low-pass filter. Therefore, "Y (x, y) -Yunsharp (x, y)" has the same meaning as the one obtained by subtracting the low frequency component from the original total component and applying the high pass filter. Then, will be increased high-frequency components be added to the high-frequency component passed through the high pass I filter to "Y (x, y)", sharpness of image is improved resulted in edge is emphasized.
[0090]
As is apparent from FIG. 18, these unsharp masks have the largest weighting at the central portion, and the weighting coefficients gradually decrease toward the periphery. Therefore, it can be said that the influence of the peripheral side weighting factor on the total value of the cells is small. On the other hand, the matrix operation represented by equation (13) or the like requires a large amount of operation since multiplication operation and addition operation are required for the pixels around the processing target pixel by the number of cells of the unsharp mask to be adopted. It is also thought that it will be. Therefore, in the present embodiment, the processing amount is increased by using a 3 × 3, 5 × 5, 7 × 7 pixel unsharp mask configured by omitting the weighting coefficient on the peripheral side in advance, to increase the processing speed. It is like that.
[0091]
By the way, in the present embodiment, the size of the smoothing filter and the size of the unsharp mask are the same, but this is because of the following reason. For example, in the bitmap image shown in FIG. 19, the smoothing process is performed on the area shown by the hatched portion in the drawing, and the unsharp mask process is performed on the area shown by the dashed line in the drawing to emphasize the luminance. . As mentioned above, the meaning of emphasizing the luminance is to compensate for the sharpness which has been smoothed and lost, so if emphasizing the luminance to the outside of the smoothed area, it is unnatural in the area outside this area. It may happen that the sharpness is improved. Therefore, although the smoothing filter and the unsharp mask have the same size in this embodiment, the size of the latter may of course be smaller than the former.
[0092]
In step S160, the above-described edge enhancement processing is performed, and while using the luminance Y 'after enhancement and the color difference components after processing, the steps of R', G ', and B' are performed based on the equations (6) Get key data. That is, color blurring is reduced in steps S152 and S154, and gradation data is generated in step S160, and an image processing means is configured by the hardware configuration that executes these and software.
[0093]
In step S160, the gradation data of R ′, G ′, B ′ may have negative values or values exceeding “255” because the emphasized luminance Y ′ is used. However, since the gradation width is in the range of “0” to “255”, negative gradation data is uniformly “0”, and gradation data exceeding “255” is uniformly “255”. Then, the pixel to be processed is moved in the next step S170, and the same processing is repeated until it is determined in step S180 that all pixels have been completed.
[0094]
By applying a smoothing filter centered on color blur pixels and then performing edge enhancement processing, color blur is reduced by the smoothing processing, and the sharpness of the image lost by the smoothing processing is reduced by the edge enhancement processing. Be compensated. Therefore, it is sufficient to execute such processing uniformly on all color bleeding pixels, regardless of whether the color bleeding pixels are edge pixels or not in principle. it can. However, in such a configuration, the edge portion may be blurred from an empirical point of view, so that it was possible to obtain good results when the median filter was applied when the color blur pixel was an edge pixel.
[0095]
Here, the effects of the smoothing processing and the edge enhancement processing according to the present embodiment will be described while illustrating a simple one-dimensional simulation model.
FIG. 20 is a table showing values of various parameters in the one-dimensional simulation model when the edge enhancement processing is not performed. In the figure, the matrix of R, G, B at the left end indicates the color filter array of the CCD. “IN” shown on the right of this matrix indicates the incident condition of light, and “1 (gradation data is 255)” means light is illuminated, that is, “white”, “0 (floor If the tone data is 0), it means "black". In each pixel of the CCD, it is assumed that color signals which can not be obtained directly are obtained from color signals of adjacent pixels by linear interpolation.
[0096]
Here, although it should originally be considered in a two-dimensional arrangement, in order to simplify the explanation, attention is focused on the central column of the above-mentioned R, G, B matrix. In this sense, it is called a one-dimensional simulation model. Then, according to the principle described above, false color signals such as G (B) = 0.5 and R = 0.5 are generated near the boundary of white and black, respectively, and the pixel where the false color signal is generated is a color It is detected as a bleed pixel. When a color blur pixel is detected, color difference components C1 and C2 are calculated according to equations (6) to (8), and the color difference components C1 and C2 are smoothed to obtain color difference components C1 ′ and C2 ′. Here, "1, 1, 1, 1, 1, 1, 1" is applied as a one-dimensional smoothing filter. That is, the pixel values of three pixels before and after the processing target pixel are summed and divided by “7”. Then, the obtained color difference signals C1 ′ and C2 ′ are returned to the original color signals based on the equations (6) to (8), and R ′, G ′ and B ′ after the smoothing process are obtained. As apparent from the figure, (R ′, G ′, B ′) in the pixels near the white- black boundary are (0.75, 0.61, 0.61) and (0.25, 0. 11, 0.11), and it can be seen that the color bleeding is reduced by approaching the original "IN" value.
[0097]
Further, FIG. 21 similarly shows a one-dimensional simulation model in the case where the smoothing process is performed and the edge enhancement process is performed using the unsharp mask having the same size as the smoothing filter. Also in this case, performing the smoothing process by obtaining the color difference components C1 and C2 is the same as that described above, but when restoring the original color signal using the equations (6) to (8), The luminance signal Y ′ which has been subjected to emphasis processing using a one-dimensional unsharp mask given a weighting of 6, 18, 25, 18, 6, 1 is used. Then, (R ′, G ′, B ′) in the pixels near the white-black boundary are (0.81, 0.67, 0.67) and (0.10, −0.04, −0), respectively. .04) Of course, since possible values for RGB signal values are “0” to “1”, the latter data is actually (0.10, 0, 0), and the color blur is more than that shown in FIG. It can be seen that the
[0098]
Furthermore, FIG. 22 similarly shows a one-dimensional simulation model in the case where edge enhancement processing is performed using an unsharp mask of a size smaller than that of the smoothing filter. In this case, a five-digit unsharp mask smaller than the size (seven digits) of the one-dimensional "1, 11, 25, 11, 1" smoothing filter is used. Then, when the calculation is performed in the same manner as described above, (R ′, G ′, B ′) in the pixels near the boundary between white and black are respectively (0.79, 0.65, 0.65), It becomes (0.10, -0.04, -0.04). As described above, although the degree of elimination of color bleeding is inferior to that shown in FIG. 21, it is understood that color bleeding is further eliminated as compared with that shown in FIG.
[0099]
Next, the operation of the present embodiment configured as described above will be described.
It is assumed that an actual image captured by a digital still camera 12 having a single-plate CCD is taken into the computer 21 and printed by the printer 31. Then, first, under the operating system 21 a operating on the computer 21, the image processing application 21 d is started and image data is taken in from the digital still camera 12. When the image data is taken into the image processing application 21d via the operating system 21a, an index value for determining the size of the image is acquired based on the equation (1) in step S110, and the index value and the predetermined value are determined. The sizes of the smoothing filter and the unsharp mask to be used in steps S122 to S126 are determined and stored in the work area.
[0100]
Then, in step S130, the processing target pixel is set to the initial position, and the value of ΔRB in the pixel and its peripheral pixels is calculated according to the equation (2). Thereafter, in step S140, the degree of change of the value ΔRB is checked between the processing target pixel and its peripheral pixels based on equation (5), and the degree of change is larger than the predetermined threshold value Th. It is judged as a color blur pixel.
[0101]
If it is determined to be a color blur pixel, color difference components C1 and C2 are calculated for the pixel to be processed and its peripheral pixels based on equations (6) to (8) in step S150, and equations (9) and (10), or (11) It is determined whether the color-blurred pixel is an edge pixel according to the determination standard such as the equation. If it is determined that the pixel is not an edge pixel, a smoothing filter equal to the filter size stored in the work area in steps S122 to S126 is applied in step S152. That is, for each of the color difference components C1 and C2, color difference components of pixels corresponding to the cells of the smoothing filter are summed and divided by the number of cells to obtain color difference components C1 ′ and C2 ′ which are smoothed.
[0102]
On the other hand, when it is determined in step S150 that the color bleeding pixel is an edge pixel, a median filter of 5 × 5 pixels centering on the same color bleeding pixel is applied in step S154. That is, the values of the color difference components of all twenty-five pixels centered on the color bleeding pixels are sorted in ascending or descending order, the central value is selected, and the color difference components of the color bleeding pixels are replaced. At this time, when the determination criteria of the equations (9) and (10) are adopted in step S150, the median filter is applied in step S154 for the color difference components satisfying the equation in each of the color difference components C1 and C2. The above-mentioned smoothing filter is applied in step S152 for color difference components that do not satisfy the equation. Of course, if the same equation is satisfied for both color difference components, a median filter is applied to both color difference components C1 and C2 in step S154. On the other hand, when the determination criterion of the equation (11) is adopted in step S150, the median filter is applied to both of the color difference components C1 and C2 in step S154.
[0103]
Thereafter, in step S160, using the unsharp mask of the size determined in steps S122 to S126, the low frequency component Yunsharp of the luminance component Y is determined for the processing target pixel and its peripheral pixels. The high frequency component is determined by subtracting the frequency component Yunsharp, and the high frequency component is added to the same luminance component Y to obtain a luminance component Y ′ after emphasis. Specifically, the calculation is performed based on the equation (13) or the like. Then, while using the luminance component Y ′ after enhancement and the color difference components after processing, the gradation data of R ′, G ′, B ′ after the smoothing processing are obtained based on the equations (6) to (8). The above process is repeated until it is determined in step S180 that all pixels have been executed while moving the processing target pixel in step S170.
[0104]
After execution for all the pixels, the image data subjected to image processing is displayed on the display 32 via the display driver 21c, and if it is good, the printer 31 is made to print via the printer driver 21b. That is, the printer driver 21b inputs RGB gradation data with reduced color bleeding, performs predetermined resolution conversion, and rasterizes corresponding to the print head area of the printer 31, and colorizes rasterized data from RGB to CMYK. After conversion, the gradation data of CMYK is converted to binary data and output to the printer 31.
[0105]
With the above processing, the actual image data read from the digital still camera 12 is automatically image-processed to reduce color bleeding only in the part where color bleeding is generated, and displayed on the display 32, and then displayed on the printer 31. Is printed. That is, since image processing is performed so as to reduce color bleeding only in a portion where color bleeding occurs, high-speed image processing can be realized by reducing the amount of calculation.
[0106]
As described above, the computer 21, which forms the core of image processing, determines whether the processing target pixel is a color bleeding pixel based on the low density element color intensity in steps S130 and S140, and determines that the pixel is a color bleeding pixel. In step S150, it is determined whether the pixel is an edge pixel. If the pixel is not an edge pixel, a smoothing filter is applied in step S152. If it is an edge pixel, a median filter is applied in step S154. By doing this, image processing is performed in order to reduce color bleeding, so that the amount of computation can be reduced and high-speed image processing can be performed.
Brief Description of the Drawings
FIG. 1 is a block diagram of an image processing system to which an image processing apparatus according to an embodiment of the present invention is applied.
FIG. 2 is a block diagram of specific hardware of the image processing apparatus.
FIG. 3 is a block diagram showing an example of a simple hardware configuration of a digital still camera.
FIG. 4 is a schematic block diagram showing another application example of the image processing apparatus of the present invention.
FIG. 5 is a schematic block diagram showing another application example of the image processing apparatus of the present invention.
FIG. 6 is a flowchart showing determination of color blur pixels and an image processing portion in the image processing apparatus of the present invention.
FIG. 7 is a diagram showing the relationship between the image size and the smoothed area.
FIG. 8 is a smoothing filter of 3 × 3, 5 × 5 and 7 × 7 pixels.
FIG. 9 is a diagram showing the relationship between height and width in image data of the same number of pixels.
FIG. 10 is a diagram showing a state in which a processing target pixel is moved.
FIG. 11 is an explanatory diagram in the case of determining a change degree of an element color component by a difference value between adjacent pixels in a diagonal direction.
FIG. 12 is an explanatory diagram in the case of determining the degree of change of an image by using a difference value between adjacent pixels in a diagonal direction;
FIG. 13 is an explanatory diagram in the case of obtaining the degree of change of an image between all adjacent pixels.
FIG. 14 is an explanatory diagram of a modification in which the degree of change of an image is obtained between adjacent pixels;
FIG. 15 is an explanatory diagram of another modified example for obtaining the degree of change of an image between adjacent pixels.
FIG. 16 is a diagram showing an example of color difference component values of respective pixels in image data of an edge portion including color blur pixels.
FIG. 17 is a diagram for describing an example of arithmetic processing by a median filter;
FIG. 18 is an unsharp mask of 3 × 3, 5 × 5 and 7 × 7 pixels.
FIG. 19 is a diagram showing the relationship between a smoothed area and an edge emphasis area;
FIG. 20 is a table showing values of various parameters in a one-dimensional simulation model when edge enhancement processing is not performed.
FIG. 21 is a table showing values of various parameters in a one-dimensional simulation model when edge enhancement processing is performed using an unsharp mask of the same size as the smoothing filter.
FIG. 22 is a table showing values of various parameters in a one-dimensional simulation model when edge enhancement processing is performed using an unsharp mask smaller in size than the smoothing filter.
FIG. 23 is a view for explaining the generation principle of color bleeding;
[Description of the code]
DESCRIPTION OF SYMBOLS 10 ... Image input apparatus 20 ... Image processing apparatus 21 ... Computer 21a ... Operating system 21b ... Printer driver 21c ... Display driver 21d ... Image processing application 22 ... Hard disk 23 ... CD-ROM drive 25 ... Floppy disk drive 26 ... Modem 30: Image output device

JP2002186046A 1997-11-25 2002-06-26 Image processing apparatus, image processing method, and medium on which image processing control program is recorded Expired - Fee Related JP3702957B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002186046A JP3702957B2 (en) 1997-11-25 2002-06-26 Image processing apparatus, image processing method, and medium on which image processing control program is recorded

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP32301397 1997-11-25
JP9-323013 1997-11-25
JP2002186046A JP3702957B2 (en) 1997-11-25 2002-06-26 Image processing apparatus, image processing method, and medium on which image processing control program is recorded

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP24346198A Division JP3925588B2 (en) 1997-11-25 1998-08-28 Image processing apparatus, image processing method, and medium on which image processing control program is recorded

Publications (3)

Publication Number Publication Date
JP2003102028A JP2003102028A (en) 2003-04-04
JP2003102028A5 true JP2003102028A5 (en) 2004-12-02
JP3702957B2 JP3702957B2 (en) 2005-10-05

Family

ID=26571023

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002186046A Expired - Fee Related JP3702957B2 (en) 1997-11-25 2002-06-26 Image processing apparatus, image processing method, and medium on which image processing control program is recorded

Country Status (1)

Country Link
JP (1) JP3702957B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100683060B1 (en) 2004-12-08 2007-02-15 한국전자통신연구원 Device and method for deblocking of video frame
JP5486273B2 (en) 2008-12-26 2014-05-07 キヤノン株式会社 Image processing apparatus and image processing method

Similar Documents

Publication Publication Date Title
JP3925588B2 (en) Image processing apparatus, image processing method, and medium on which image processing control program is recorded
EP1395041A2 (en) Colour correction of images
JP4803178B2 (en) Image processing apparatus, computer program product, and image processing method
EP0891075A2 (en) An image processing apparatus and method, and an image evaluation device and method
JP2008227759A (en) Image processing device, image forming device, image processing method, image processing program, and computer readable recording medium
JP2008167461A (en) Edge-enhancement processing apparatus, output device, edge-enhancement processing method and computer readable recording medium
JP4079814B2 (en) Image processing method, image processing apparatus, image forming apparatus, imaging apparatus, and computer program
US9646367B2 (en) Image processing apparatus and image processing method each with a function of applying edge enhancement to input image data
JP6976824B2 (en) Image processing equipment, image processing methods, and programs
JP4243362B2 (en) Image processing apparatus, image processing method, and recording medium recording image processing program
JPH118768A (en) Image processor, image processing method and medium recording image processing control program
JP3702956B2 (en) Image processing apparatus, image processing method, and medium on which image processing control program is recorded
JP6953183B2 (en) Image processing equipment, image processing methods and programs
JP2003102027A5 (en)
JP3702957B2 (en) Image processing apparatus, image processing method, and medium on which image processing control program is recorded
JP2003102028A5 (en)
JP4161141B2 (en) Edge enhancement processing apparatus, edge enhancement processing method, and computer-readable recording medium recording an edge enhancement processing program
JP2006304015A (en) Image processing apparatus, image forming apparatus, method of processing image, computer program and recording medium
JP4404457B2 (en) Halftoning method, halftoning apparatus, and computer-readable recording medium on which halftoning program is recorded
JP4792893B2 (en) Image processing apparatus and program
JPH10340332A (en) Image processor, image processing method and medium recording image processing control program
JP3501151B2 (en) Image processing apparatus, image processing method, medium recording image processing control program
JP3736632B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JPH07298074A (en) Image processing unit
JP2000357237A (en) Image processor, image reading device and image forming device mounted with the processor, image processing method, and computer-readable storage medium stored with image processing procedure