JP2003085546A5 - - Google Patents

Download PDF

Info

Publication number
JP2003085546A5
JP2003085546A5 JP2002180778A JP2002180778A JP2003085546A5 JP 2003085546 A5 JP2003085546 A5 JP 2003085546A5 JP 2002180778 A JP2002180778 A JP 2002180778A JP 2002180778 A JP2002180778 A JP 2002180778A JP 2003085546 A5 JP2003085546 A5 JP 2003085546A5
Authority
JP
Japan
Prior art keywords
image
image processing
color
colors
luminance
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
JP2002180778A
Other languages
Japanese (ja)
Other versions
JP3953897B2 (en
JP2003085546A (en
Filing date
Publication date
Application filed filed Critical
Priority to JP2002180778A priority Critical patent/JP3953897B2/en
Priority claimed from JP2002180778A external-priority patent/JP3953897B2/en
Publication of JP2003085546A publication Critical patent/JP2003085546A/en
Publication of JP2003085546A5 publication Critical patent/JP2003085546A5/ja
Application granted granted Critical
Publication of JP3953897B2 publication Critical patent/JP3953897B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の名称】画像処理装置、画像処理方法および画像処理プログラムを記録した媒体
【特許請求の範囲】
【請求項1】複数の画素からなる画像の画像データに対して所定の画像処理を行う画像処理装置であって、
上記画像データを入力し利用色数を検知する色数検知手段と、
この検知された利用色数に応じて実行する画像処理の分岐を行なう画像処理手段とを具備することを特徴とする画像処理装置。
【請求項2】上記請求項1に記載の画像処理装置において、上記色数検知手段は、各画素の輝度に相当する情報を色と見なして利用色数を検知することを特徴とする画像処理装置。
【請求項3】上記請求項2に記載の画像処理装置において、画像データが輝度に対応した複数の成分値で表される場合において、上記色数検知手段は、同成分値の重みづけ積算により輝度を求めることを特徴とする画像処理装置。
【請求項4】上記請求項1〜請求項3のいずれかに記載の画像処理装置において、上記色数検知手段は、画像データからサンプリングした画素について色数を検知することを特徴とする画像処理装置。
【請求項5】上記請求項1〜請求項4のいずれかに記載の画像処理装置において、上記画像処理手段は、上記画像データの利用色数が多い場合に輝度分布を拡大させる画像処理を行なうとともに利用色数が少ない場合に輝度分布を拡大させないようにすることを特徴とする画像処理装置。
【請求項6】上記請求項1〜請求項5のいずれかに記載の画像処理装置において、上記画像処理手段は、上記画像データの利用色数が多い場合に彩度を強調させる画像処理を行なうとともに利用色数が少ない場合に彩度を強調させないようにすることを特徴とする画像処理装置。
【請求項7】上記請求項1〜請求項6のいずれかに記載の画像処理装置において、上記画像処理手段は、上記画像データの利用色数が多い場合ににエッジ強調させる画像処理を行なうとともに利用色数が少ない場合にエッジ強調させないようにすることを特徴とする画像処理装置。
【請求項8】上記請求項1〜請求項7のいずれかに記載の画像処理装置において、変換元の表色空間での格子点に変換先の表色空間での階調表色データを対応させたテーブルを備えつつ変換元の階調表色データを当該テーブルの格子点に対応した階調表色データに階調変換してから同テーブルを参照して対応する階調表色データを読み出して色変換するプレ階調変換手段と、上記テーブルの格子点間で補間演算にて対応する階調表色データに色変換可能であるとともにこの色変換の情報を保存する高速読込可能な記憶エリアを有して同記憶エリアに記憶されていない場合に補間演算で色変換させるキャッシュ利用の補間色変換手段とを有し、上記画像データの利用色数が多い場合に同プレ階調変換手段を使用して色変換するし、同画像データの利用色数が少ない場合に同補間色変換手段を利用して色変換することを特徴とする画像処理装置。
【請求項9】複数の画素からなる画像の画像データに対して所定の画像処理を行う画像処理方法であって、上記画像データを入力して利用色数を検知し、この検知された利用色数に応じて実行する画像処理を選択し、同選択した画像処理を実行することを特徴とする画像処理方法。
【請求項10】複数の画素からなる画像の画像データコンピュータにて入力し、所定の画像処理を行う画像処理プログラムを記録した媒体であって、
上記画像データを入力し利用色数を検知するステップと、
この検知された利用色数に応じて画像処理を選択して実行するステップとを具備することを特徴とする画像処理プログラムを記録した媒体。
【発明の詳細な説明】
【0001】
【発明の属する技術分野】
本発明は、画像処理装置、画像処理方法および画像処理プログラムを記録した媒体に関し、特に、画像データの種類に応じた所定の処理を実行する画像処理装置、画像処理方法および画像処理プログラムを記録した媒体に関する。
【0002】
【従来の技術】
従来より、写真など自然画の画像データやドロー系の非自然画の画像データについて、各種のエフェクト処理を行うソフトウェアが知られている。このようなソフトウェアでは、画像データをディスプレイなどに表示させ、作業者が所望の処理を施して見栄えの良い画像データを形成している。
【0003】
ここにおいて、各種のエフェクト処理のうちには、自然画をより美しく変換するものがある一方、ドロー系の画像のようにあえて手を加える必要はないようなものもある。
【0004】
【発明が解決しようとする課題】
上述した従来のソフトウェアで構成された画像処理装置においては、作業者がディスプレイ上で画像の種類を判別して各種のエフェクト処理を選択しなければならず、自動化できないという課題があった。
【0005】
本発明は、上記課題にかんがみてなされたもので、画像データの種別を自動的に判定して適当な処理を行うことが可能な画像処理装置、画像処理方法および画像処理プログラムを記録した媒体の提供を目的とする。
【0006】
【課題を解決するための手段】
上記目的を達成するため、請求項1にかかる発明は、複数の画素からなる画像の画像データに対して所定の画像処理を行う画像処理装置であって、上記画像データを入力し利用色数を検知する色数検知手段と、この検知された利用色数に応じて実行する画像処理の分岐を行なう画像処理手段とを具備する構成としてある。
【0007】
画像の種類に応じて利用する色数が異なる。例えば、写真などの自然画であれば被撮影物が同一の青色であったとしても陰影によって複数の色となるなど、かなりの色を利用している。一方、ドロー系のデータであったり、ビジネスグラフであったりするときには、もともと作業者が色を指定して描かれているものであるため、自ずから色数には限度がある。従って、利用色数から画像種類が判定できる。一方、画像データの利用色数を検知する手法として、まず、マトリクス状の各画素における現実の色を判定してヒストグラム状に集計して検知するものが上げられる。
【0008】
しかしながら、必ずしも正確な値が必要であるわけではないし、いわゆるフルカラーといわれるものでは1670万色もの色数があり得るため、正確な色数を検出すること自体が手間になりかねない。
【0009】
このような前提のもと、上記のように構成した請求項1にかかる発明においては、色数検知手段が上記画像データを入力して利用色数を検知すると、画像処理手段はこの検知された利用色数に応じて実行する画像処理の分岐を行なう。
【0010】
また、各色ごとに輝度が対応しており、一つの輝度値に対して複数色が対応しているとはいうものの、輝度値が多くて色数が少ないというようなことはないし、たまたま輝度値が一致する色ばかりで構成されているということも現実には考えられない。従って、利用色数が多いか少ないかのおおざっぱな傾向であれば概ね輝度値で判定しても構わないといえる。むろん、このようにして輝度値を置き換えた場合には利用色数というよりも利用色数相当値というのが正確であるが、画像の種類を判定するという用途を前提として利用色数と呼ぶことにする。
【0011】
ここにおいて、請求項3にかかる発明は、上記請求項2に記載の画像処理装置において、画像データが輝度に対応した複数の成分値で表される場合において、上記色数検知手段は、同成分値の重みづけ積算により輝度を求める構成としてある。
【0012】
輝度を利用するメリットはあっても画像データのパラメータに輝度の成分がなければ色変換しなければならず、通常であれば、色変換には多大な処理が必要となる。しかるに、輝度を利用する時点で多少の誤差は許容されているのであるから、画像データが輝度に対応した複数の成分値で表される場合には同成分値の重みづけ積算により多大な処理を要することなく輝度が求められる。
【0013】
また、この他にも利用色数の検知を簡略化する手法はある。例えば、三次元の色空間において各軸方向にとびとびの格子状にし、あるグループごとに一色と考える。これにより、例えば各軸が256階調というような場合の膨大な色数で集計をとる必要がなくなる。
【0014】
また、画像データ全体での利用色数は必ずしもすべての画素について集計する必要はなく、例えば、請求項3にかかる発明は、請求項1または請求項2のいずれかに記載の画像処理装置において、上記色数検知手段は、画像データからサンプリングした画素について色数を検知する構成としてある。
【0015】
むろん、間引きによって誤差は生じるものの、上述したように必ずしも正確な利用色数が分かる必要はないので、画像データからサンプリングした画素について色数を検知するようにすれば対象となる画素数が減り、処理量も減る。
【0016】
自然画である場合に適当な画像処理としてコントラストの修正処理があり、請求項5にかかる発明は、請求項1〜請求項4のいずれかに記載の画像処理装置において、上記画像処理手段は、上記画像データの利用色数が多い場合に輝度分布を拡大させる画像処理を行なうとともに利用色数が少ない場合に輝度分布を拡大させない構成としてある。
【0017】
例えば、写真においては撮影時の条件によってコントラストの幅の狭い画像になってしまうことがある。このために画像処理を行うことがあるが、請求項5にかかる発明によれば、色数検知手段が検知した画像データの色数が多い場合には自然画であると判断され、この場合には画像処理手段が輝度分布を拡大させる画像処理を行なう。むろん、拡大する分布の範囲は適宜変更可能であり、十分に輝度分布が広くコントラストの幅のある画像データであればあえて拡大処理する必要もない。また、ビジネスグラフのような非自然画である場合にはコントラストの幅が問われるようなこともなく、輝度分布を拡大させない。
【0018】
さらに、請求項6にかかる発明は、請求項1〜請求項5のいずれかに記載の画像処理装置において、上記画像処理手段は、上記画像データの利用色数が多い場合に彩度を強調させる画像処理を行なうとともに利用色数が少ない場合に彩度を強調させない構成としてある。
【0019】
同様に、写真においては撮影時の光線の条件によって色がくもった感じになってしまうことがある。このために画像処理を行うことがあるが、請求項6にかかる発明によれば、色数検知手段が検知した画像データの色数が多い場合には自然画であると判断され、この場合には画像処理手段が彩度を強調させる画像処理を行なう。むろん、ビジネスグラフのような非自然画である場合にはあえて色相を変えて鮮やかにするような要求はなく、彩度強調を行わない。
【0020】
さらに、請求項7にかかる発明は、請求項1〜請求項6のいずれかに記載の画像処理装置において、上記画像処理手段は、上記画像データの利用色数が多い場合ににエッジ強調させる画像処理を行なうとともに利用色数が少ない場合にエッジ強調させないとしてある。
【0021】
この場合も、写真を例に取れば撮影時の条件によってエッジのなまったぼけたような画像になってしまうことがあり、このために画像処理を行うことがあるが、請求項7にかかる発明によれば、色数検知手段が検知した画像データの色数が多い場合には自然画であると判断され、この場合には画像処理手段がエッジ強調させる画像処理を行なう。むろん、エッジ強調の程度などは適宜変更可能である。エッジ強調処理の具体的な手法については各種のものを採用可能であり、例えば、上記画像データを構成する各画素について周辺の画素分布に基づいて低周波成分を求めるとともに同低周波成分を減ずることにより結果として各画素のエッジ度を高めるように修正してもよい。
【0022】
一方、画像処理した画像データに対してはディスプレイで表示する以外にも各種の利用の途があり、例えば、印刷処理などもありうる。このような場合には元の画像データの色空間とは異なる印刷インクの色空間に変換する必要があり、このような色変換を伴うものに対応して、請求項8にかかる発明は、請求項1〜請求項7のいずれかに記載の画像処理装置において、変換元の表色空間での格子点に変換先の表色空間での階調表色データを対応させたテーブルを備えつつ変換元の階調表色データを当該テーブルの格子点に対応した階調表色データに階調変換してから同テーブルを参照して対応する階調表色データを読み出して色変換するプレ階調変換手段と、上記テーブルの格子点間で補間演算にて対応する階調表色データに色変換可能であるとともにこの色変換の情報を保存する高速読込可能な記憶エリアを有して同記憶エリアに記憶されていない場合に補間演算で色変換させるキャッシュ利用の補間色変換手段とを有し、上記画像データの利用色数が多い場合に同プレ階調変換手段を使用して色変換するし、同画像データの利用色数が少ない場合に同補間色変換手段を利用して色変換する構成としてある。
【0023】
異なる表色空間の間で色変換を行なう場合、変換元の表色空間での格子点に変換先の表色空間での階調データを対応させたテーブルを用意しておき、同テーブルを参照して逐次所定の格子点の対応データを読み出せば変更可能となるが、変換元の階調データの全ての階調値に対応した格子点を備えるとテーブルが大きくなりすぎる。このため、プレ階調変換手段では変換元の階調データをテーブルの格子点に対応した階調データに階調変換することにより、テーブルを小さくしている。なお、補間演算でテーブルの格子点以外の階調データについても変更可能となるものの、色数が多い場合、誤差拡散などによって実行する階調変換は確実に演算量が少なくなるという特性がある。
【0024】
ただし、誤差拡散の処理は必ず前画素に対して行わなければならないという前提があり、非自然画の場合は色数が少ないので一度変換した結果を何度も利用可能である。従って、このような場合には補間演算を併用しつつ色変換結果を高速読込可能な記憶エリアに保存しておき、必要に応じてこの記憶エリアから読み出すという処理を繰り返すキャッシュ利用の補間色変換手段の方が早いといえる。
【0025】
上述したようにして、複数の対応関係を備えて画素に応じて対応関係を変える手法は、実体のある装置に限定される必要はなく、その方法としても機能することは容易に理解できる。このため、請求項9にかかる発明は、複数の画素からなる画像の画像データに対して所定の画像処理を行う画像処理方法であって、上記画像データを入力して利用色数を検知し、この検知された利用色数に応じて実行する画像処理を選択し、同選択した画像処理を実行する構成としてある。
【0026】
すなわち、必ずしも実体のある装置に限らず、その方法としても有効であることに相違はない。
【0027】
ところで、このような画像処理装置は単独で存在する場合もあるし、ある機器に組み込まれた状態で利用されることもあるなど、発明の思想としてはこれに限らず、各種の態様を含むものである。従って、ソフトウェアであったりハードウェアであったりするなど、適宜、変更可能である。
【0028】
発明の思想の具現化例として画像処理装置のソフトウェアとなる場合には、かかるソフトウェアを記録した記録媒体上においても当然に存在し、利用されるといわざるをえない。その一例として、請求項10にかかる発明は、複数の画素からなる画像の画像データコンピュータにて入力し、所定の画像処理を行う画像処理プログラムを記録した媒体であって、上記画像データを入力し利用色数を検知するステップと、この検知された利用色数に応じて画像処理を選択して実行するステップとを具備する構成としてある。
【0029】
むろん、その記録媒体は、磁気記録媒体であってもよいし光磁気記録媒体であってもよいし、今後開発されるいかなる記録媒体においても全く同様に考えることができる。また、一次複製品、二次複製品などの複製段階については全く問う余地無く同等である。
【0030】
さらに、一部がソフトウェアであって、一部がハードウェアで実現されている場合においても発明の思想において全く異なるものはなく、一部を記録媒体上に記憶しておいて必要に応じて適宜読み込まれるような形態のものとしてあってもよい。さらには、カラーファクシミリ機、カラーコピー機、カラースキャナやディジタルカメラ、ディジタルビデオなどに内蔵する画像処理装置においても適用可能であることはいうまでもない。
【0031】
【発明の効果】
以上説明したように本発明は、利用色数という観点から画像データの種類を自動的に判定して画像処理を分岐させるすることが可能な画像処理装置を提供することができる。
【0032】
また、請求項2にかかる発明によれば、利用色数を輝度に置き換えることにより、再現可能な色数が多大な場合でも容易に集計することができる。
さらに、請求項3にかかる発明によれば、輝度に対応した成分値を重みづけ積算することによりきわめて簡易に輝度を求めることができる。
【0033】
さらに、請求項4にかかる発明によれば、色数を検知する対象の画素を間引きして選択するため、処理量を低減させることができる。
【0034】
さらに、請求項5にかかる発明によれば、画像種類が自然画であると判定された場合には自動的にコントラストの拡大処理を行い、最適なコントラストの画像データとすることができる。
【0035】
さらに、請求項6にかかる発明によれば、画像種類が自然画であると判定された場合には自動的に彩度強調処理を行い、色鮮やかな画像データとすることができる。
【0036】
さらに、請求項7にかかる発明によれば、画像種類が自然画であると判定された場合には自動的にエッジ強調処理を行い、エッジになまりのない画像データとすることができる。
【0037】
さらに、請求項8にかかる発明によれば、利用色数が多い自然画の場合には誤差拡散などの手法を使用して最小の演算量で色変換することができ、また、利用色数が少ない場合にはキャッシュを利用して変換結果を繰り返し利用できるようにしたため、画像の種類ごとに応じた色変換手法で最小の処理量とすることができる。
【0038】
さらに、請求項9にかかる発明によれば、利用色数という観点から画像データの種類を自動的かつ容易に判定して画像処理を分岐させることが可能な画像処理方法を提供することができ、請求項10にかかる発明によれば、同様にして画像データの種類を自動的かつ容易に判定して画像処理を分岐させることが可能な画像処理プログラムを記録した媒体を提供することができる。
【0039】
【発明の実施の形態】
以下、図面にもとづいて本発明の実施形態を説明する。
【0040】
図1は、本発明の一実施形態にかかる画像処理装置の具体的ハードウェア構成例をブロック図により示している。
【0041】
同図において、各種の画像入力装置10としてスキャナ11やデジタルスチルカメラ12が備えられ、画像判定を含む画像処理の中心的な役割を果たす画像処理装置20としてコンピュータ本体21とハードディスク22が備えられ、画像処理された画像を表示する画像出力装置30としてプリンタ31やディスプレイ32を備えている。
【0042】
このコンピュータ本体21の内部で行なわれる処理を図2に示している。図に示すように、コンピュータ本体21内ではオペレーティングシステム21aが稼働しており、プリンタ31やディスプレイ32に対応したプリンタドライバ21bやビデオドライバ21cが組み込まれている。一方、アプリケーション21dはオペレーティングシステム21aにて処理の実行を制御され、必要に応じてプリンタドライバ21bやビデオドライバ21cと連携して所定の画像処理を実行する。なお、コンピュータ21はRAMなどを使用しながら、内部のROMやハードディスク22に保存されているそれぞれのプログラムを実行していく。また、このような画像処理などのプログラムは、CD−ROM、フロッピーディスク、MOなどの各種の記録媒体を介して供給される他、モデムなどによって公衆通信回線を介して外部のネットワークに接続し、ソフトウェアやデータをダウンロードして導入することも行われている。
【0043】
本実施形態においては、画像入力装置10としてのスキャナ11やデジタルスチルカメラ12が画像データとしてRGB(緑、青、赤)の階調データを出力するものとするとともに、画像出力装置30としてのプリンタ31は階調表色データとしてCMY(シアン、マゼンダ、イエロー)あるいはこれに黒を加えたCMYKの二値データを入力として必要とするし、ディスプレイ32はそのRGBの階調データを入力として必要する。従って、画像処理装置20としてのこのコンピュータ本体21の具体的役割は、RGBの階調データを入力して必要な強調処理を施したRGBの階調データを作成し、ディスプレイ32であればビデオドライバ21cを介して表示させるし、プリンタ31に対してはプリンタドライバ21bを介してCMYの二値データに変換して印刷させることである。
【0044】
本実施形態における画像処理では、コンピュータ本体21内に入力される画像データに対してアプリケーション21dの色数検知手段21d1が利用色数を検知すると画像判定手段21d2が画像の種類を判定し、画像処理手段21d3は画像の種類に応じてあらかじめ設定される適当な画像処理を自動的に行う。また、同画像処理された画像データはビデオドライバ21cを介してディスプレイ32に表示されるとともに、確認後はプリンタドライバ21bによって印刷データに変換されてプリンタ31にて印刷される。
【0045】
なお、本実施形態においては、画像の種類に応じて設定されている画像処理手段21d3として、図3に示すように、コントラスト拡大処理と、彩度強調処理と、エッジ強調処理とが用意されており、画像データを印刷データに変換するプリンタドライバ21bにおいては、図4に示すように、印刷データをラスタライズするラスタライザ21b1とプレ階調変換かキャッシュと補間演算との組み合わせによって色変換する色変換部21b2と色変換後の階調データを二値化する階調変換部21b3とが用意されている。
【0046】
本実施形態においては、画像の入出力装置の間にコンピュータシステムを組み込んで画像処理を行うようにしているが、必ずしもかかるコンピュータシステムを必要とする訳ではなく、画像データに対して利用色数を検知して画像の種類を判定するシステムであればよい。例えば、図5に示すように、コンピュータシステムを介することなく画像データを入力して印刷するプリンタ31bにおいては、スキャナ11bやモデム13b等を介して入力される画像データについて自動的に利用色数を検知して画像の種類を判定するように構成することも可能である。
【0047】
図6はアプリケーションにおける画像処理に該当するフローチャートを示しており、ステップS102とステップS104で輝度分布を集計して利用色数を検知している。
【0048】
まず、この輝度の分布検出処理について説明する。
【0049】
輝度をいかにして表すかについて説明する前に、分布対象となる画素について説明する。図6のステップS102で示すように対象となる画素を間引く間引き処理を実行する。図7に示すように、ビットマップの画像であれば、縦方向に所定ドットと横方向に所定ドットからなる二次元のドットマトリクスとして成り立っており、正確な輝度の分布を求めるのであれば全画素について輝度を調べる必要がある。しかしながら、この分布検出処理は間接的に輝度から利用色を求めることを目的としており、必ずしも正確である必要はない。従って、ある誤差の範囲内となる程度に間引きを行うことが可能である。統計的誤差によれば、サンプル数Nに対する誤差は概ね1/(N**(1/2))と表せる。ただし、**は累乗を表している。従って、1%程度の誤差で処理を行うためにはN=10000となる。
【0050】
ここにおいて、図7に示すビットマップ画面は(width)×(height)の画素数となり、サンプリング周期ratioは、ratio=min(width,height)/A+1 …(1)
とする。ここにおいて、min(width,height)はwidthとheightのいずれか小さい方であり、Aは定数とする。また、ここでいうサンプリング周期ratioは何画素ごとにサンプリングするかを表しており、図8の○印の画素はサンプリング周期ratio=2の場合を示している。すなわち、縦方向及び横方向に二画素ごとに一画素のサンプリングであり、一画素おきにサンプリングしている。A=200としたときの1ライン中のサンプリング画素数は図9に示すようになる。
【0051】
同図から明らかなように、サンプリングしないことになるサンプリング周期ratio=1の場合を除いて、200画素以上の幅があるときには最低でもサンプル数は100画素以上となることが分かる。従って、縦方向と横方向について200画素以上の場合には(100画素)×(100画素)=(10000画素)が確保され、誤差を1%以下にできる。
【0052】
ここにおいてmin(width,height)を基準としているのは次のような理由による。例えば、図10(a)に示すビットマップ画像のように、width>>heightであるとすると、長い方のwidthでサンプリング周期ratioを決めてしまった場合には、同図(b)に示すように、縦方向には上端と下端の2ラインしか画素を抽出されないといったことが起こりかねない。しかしながら、min(width,height)として、小さい方に基づいてサンプリング周期ratioを決めるようにすれば同図(c)に示すように少ない方の縦方向においても中間部を含むような間引きを行うことができるようになる。
【0053】
なお、この例では、縦方向と横方向の画素について正確なサンプリング周期で間引きを行うようにしている。これは、逐次入力される画素について間引きしながら処理する場合に好適である。しかし、全画素が入力されている場合には縦方向や横方向についてランダムに座標を指定して画素を選択するようにしても良い。このようにすれば、10000画素というような必要最低限の画素数が決まっている場合に10000画素となるまでランダムに抽出する処理を繰り返し、10000画素となった時点で抽出を止めればよくなる。
【0054】
このように選択した画素についての画素データがその成分要素として輝度を持っていればその輝度値を用いて分布を求めることが可能である。一方、輝度値が直接の成分値となっていない画像データの場合でも、間接的には輝度を表す成分値を備えている。従って、輝度値が直接の成分値となっていない表色空間から輝度値が直接の成分値となっている表色空間への変換を行えば輝度値を得ることができる。
【0055】
このような異なる表色空間の間での色変換は変換式によって一義的に定まるものではなく、それぞれの成分値を座標とする色空間について相互に対応関係を求めておき、この対応関係を記憶した色変換テーブルを参照して逐次変換する必要がある。テーブルとする関係上、成分値は階調値として表され、三次元の座標軸を備えている256階調の場合には、約1670万個(256×256×256)の要素の色変換テーブルを持たなければならない。効率的な記憶資源の利用を考えた結果、すべての座標値についての対応関係を用意しておくのではなく、通常は適当なとびとびの格子点について対応関係を用意しておき、補間演算を併用するようにしている。この補間演算はいくつかの乗算や加算を経て可能となるものであるため、演算処理量は膨大となってくる。
【0056】
すなわち、フルサイズの色変換テーブルを使用するのであれば処理量としては少なくなるもののテーブルサイズが非現実的となり、テーブルサイズを現実的なサイズにすれば演算処理量が非現実的となることが多い。
【0057】
このような状況に鑑み、本実施形態においては、テレビジョンなどの場合に利用されているように、RGBの三原色から輝度を求める次式の変換式を採用している。すなわち、P点での輝度yp についてはRGBの成分値(Rp,Gp,Bp )から、
yp=0.30Rp+0.59Gp+0.11Bp …(2)
とする。このようにすれば、三回の乗算と二回の加算だけで輝度値を求めることができるようになる。
【0058】
本実施形態においては、RGBの表色空間を対象としている結果、このような変換式を採用しているが、その背景には各成分値が色の明るさを示しているので、それぞれの成分値を単独で見た場合に輝度に線形に対応しているという性質がある。従って、よりおおざっぱに言えばそれぞれの加算割合を考慮することなく単に
yp=(Rp+Gp+Bp)/3 …(3)
というように簡略化することも不可能ではない。
【0059】
このようにして間引き処理で輝度を集計すると、その分布は図11の実線に示すようになる。従って、ステップS104にて画素数が「0」でない輝度値の数をカウントすれば利用色数を検知できる。なお、ステップS102においては輝度分布とともに彩度分布の集計も行っているがこれについては後述する。
【0060】
このようにして利用色数を検知したら、ステップS106ではこの利用色数と所定のしきい値とを比較し、利用色数の方が多ければこの画像データは自然画であると判定する。しきい値としては、例えば「50」色を設定しておけばよい。
自然画以外の画像データとしてビジネスグラフであるとかドロー系画像をスキャナ11で読み込むような例が挙げられるし、あるいはコンピュータグラフィック画像がスキャナ11から読み込まれたり、ネットワークからモデム13bを介して入力されるような場合がある。
【0061】
自然画であるならば、ステップS108では自然画としてのフラグをセットする。フラグをセットするのはこのアプリケーション21dの画像処理以外でプリンタドライバ21bに対しても判定結果を伝えるためである。本実施形態においては、とりあえず一つだけのしきい値を用意しておき、自然画であるか否かだけを判断しているが、利用色数の範囲でより細かな判定を行うようにしても良い。
例えば、コンピュータグラフィックスである場合でもグラデーションなどによってある程度の色数が多くなることがあるし、本来の色数はさほど多くないにもかかわらず、スキャナ11で読み込む際にエッジ部がなまって色数が多くなることもある。従って、このようなものを自然画と非自然画との間に分類し、後述するように自然画用の画像処理は行わなくてもエッジ強調処理だけは行なうといった設定を行っても良い。
【0062】
自然画については、ステップS110にてコントラストを拡大するとともに、ステップS112にて彩度を強調し、ステップS114ではエッジ強調を実行する。
【0063】
本実施形態においては、輝度分布が図11の実線に示されるように本来の再現可能な輝度分布の範囲内で一部に集中している場合にこれを再現可能な範囲内で十分に拡大する処理を意味している。
【0064】
再現可能な輝度の範囲を「0」〜「255」としたときに、輝度の変換では、変換前の輝度yと輝度の分布範囲の最大値ymaxと最小値yminから変換先の輝度Yを次式に基づいて求める。
【0065】
Y=ay+b …(4)
ただし
a=255/(ymax−ymin) …(5)
b=−a・yminあるいは255−a・ymax …(6)
また、上記変換式にてY<0ならばY=0とし、Y>255ならばY=255とする。ここにおける、aは傾きであり、bはオフセットといえる。この変換式によれば、あるせまい幅を持った輝度分布を再現可能な範囲まで広げることができる。
【0066】
かかる輝度分布の拡大を行う場合、図12に示すフローチャートを実行し、そのステップS202で輝度分布の両端を求める。自然画における輝度分布は概ね山形に表れる。むろん、その位置、形状についてはさまざまである。輝度分布の幅はこの両端をどこに決めるかによって決定されるが、単に裾野が延びて分布数が「0」となる点を両端とすることはできず、分布範囲において最も輝度の大きい側と小さい側からある分布割合だけ内側に寄った部分を分布の両端とする。本実施形態においては、この分布割合を0.5%に設定している。このように、ある分布割合だけ上端と下端をカットすることにより、ノイズなどに起因して生じている白点や黒点を無視することもできる。
【0067】
実際の処理では処理対象となる画素数(間引き処理において選択した画素の総数)に対する0.5%を演算し、再現可能な輝度分布における上端の輝度値及び下端の輝度値から順番に内側に向かいながらそれぞれの分布数を累積し、0.5%の値となった輝度値を求める。この上端側がymaxであり、下端側がyminとなる。
【0068】
本実施形態においては、輝度分布に対してこのような処理を経て上端と下端とを求めているが、統計的処理のもとで両端を求めることも可能である。例えば、輝度値の平均値に対して何%以下となったところを端部とするといった手法を採用することも可能である。
【0069】
ところで、輝度yの取りうる範囲は「0」〜「255」でしかあり得ないため、予め輝度yが取りうる全ての値に対応して変換後の輝度Yを求めておくのが効率的であり、ステップS204にてこの対応関係を演算してテーブルとして記憶しておく。
【0070】
この後、各画素についてステップS204にて演算したテーブルを参照して輝度の拡大を図る。ところで、ここまでは輝度を変換するための対応関係を求めてきており、例えば、RGB座標軸における成分値(Rp,Gp,Bp )についての変換関係ではなかった。しかしながら、(4)式の変換式は、このRGBの成分値(Rp,Gp,Bp )との対応関係においても当てはめることができる。すなわち、変換前の成分値(R,G,B)に対して変換後の成分値(R’,G’,B’)は、
R’=a・R+b …(7)
G’=a・G+b …(8)
B’=a・B+b …(9)
として求めることができる。これは(4)式と(3)式とがともに線形の対応関係を示していることから明らかである。また、輝度y,Yが階調「0」〜階調「255」であるのに対応してRGBの各成分値(R,G,B),(R’,G’,B’)も同じ範囲となっており、上述した輝度y,Yの変換テーブルをそのまま利用すればよいといえる。
【0071】
従って、ステップS206では全画素の画像データ(R,G,B)について(7)〜(9)式に対応する変換テーブルを参照し、画像データ(R’,G’,B’)に変換する。そして、ステップS208では変換画素を図13に示すように順次移動させ、ステップS210で最終画素と判断されるまで繰り返すことになる。
【0072】
図6に示すフローチャートに戻ると、コントラスト拡大の次は、ステップS112にて彩度強調を行う。この彩度強調の処理については図14に示している。
【0073】
この彩度強調処理においても、予め画像データにおける彩度分布を求め、同分布から彩度強調係数Sを求めるようにしている。この場合、輝度分布の場合と同様、すべての画素について彩度を集計する必要もなく、ステップS102において間引いた画素について彩度を求め、集計している。画像データがその成分要素として彩度を持っていればその彩度の値を用いて分布を求めることが可能であるし、彩度が直接の成分要素となっていない画像データの場合でも、間接的には彩度を表す成分値を備えている。従って、彩度が直接の成分要素となっていない表色空間から彩度値が直接の成分値となっている表色空間への変換を行えば彩度値を得ることができる。例えば、標準表色系としてのLuv空間においては、L軸が輝度(明度)を表し、U軸及びV軸で色相を表している。ここにおいて、U軸及びV軸においては両軸の交点からの距離が彩度を表すため、実質的に(U+V)**(1/2)が彩度となる。しかしながら、かかる変換に要する演算処理量は膨大となってくる。
【0074】
従って、本実施形態においては、画像データとして標準的なRGBの階調データを直に利用して彩度の代替値Xを次のようにして求めている。
【0075】
X=|G+B−2×R| …(10)
本来的には彩度は、R=G=Bの場合に「0」となり、RGBの単色あるいはいずれか二色の所定割合による混合時において最大値となる。この性質から直に彩度を適切に表すのは可能であるものの、簡易な(10)式によっても赤の単色および緑と青の混合色であるシアンであれば最大値の彩度となり、各成分が均一の場合に「0」となる。また、緑や青の単色についても最大値の半分程度には達している。
【0076】
なお、RGB表色空間のように各成分がそれぞれ独立して各色の成分を表すといったいわば概略対等な色相成分の成分値で示される状況においては、
X’=|R+B−2×G| …(11)
X”=|G+R−2×B| …(12)
という式にも代替可能であるが、結果としては(10)式に従うものが最も良好であった。
【0077】
ステップS102にて間引いた画素についてRGBの画像データから(10)式に基づいて彩度の分布をとると、彩度が最低値「0」〜最大値「511」の範囲で分布し、概略的には図15に示すような分布となる。
【0078】
集計された彩度分布に基づき、ステップS302にてこの画像についての彩度強調指数というものを決定する。集計された彩度分布が図15に示すようになったものとすると、本実施形態においては、有効な画素数の範囲で分布数として上位の「16%」が占める範囲を求める。そして、この範囲内での最低の彩度「A」がこの画像の彩度を表すものとして次式に基づいて彩度強調指数Sを決定する。
【0079】
すなわち、
A<92なら
S=−A×(10/92)+50 …(13)
92≦A<184なら
S=−A×(10/46)+60 …(14)
184≦A<230なら
S=−A×(10/23)+100 …(15)
230≦Aなら
S=0 …(16)
とする。図16は、この彩度「A」と彩度強調指数Sと関係を示している。図に示すように、彩度強調指数Sは最大値「50」〜最小値「0」の範囲で彩度「A」が小さいときに大きく、同彩度「A」が大きいときに小さくなるように徐々に変化していくことになる。
【0080】
この実施形態においては、集計された彩度分布の範囲で上位のある割合が占める彩度を利用しているが、これに限らず、例えば、平均値を出したり、メジアンを求めて彩度強調指数Sを演算する根拠としても良い。ただし、彩度分布での上位のある割合をとった場合には突発的な誤差の影響が弱まるので、全体として良好な結果を得られる。
【0081】
彩度強調指数Sが求められたら各画素の画像データについて彩度強調の処理を行う。この彩度強調指数Sに基づいて彩度を強調するにあたり、上述したように画像データが彩度のパラメータを備えているものであれば同パラメータを変換すればよいものの、今回はRGBの表色空間を採用している。従って、以下にはRGBの階調データをそのまま利用して彩度強調する方法について説明する。
【0082】
RGB表色空間のように各成分が概略対等な関係にある色相成分の成分値であるときには、R=G=Bであればグレイであって無彩度となる。従って、RGBの各成分における最小値となる成分については各画素の色相に影響を与えることなく単に彩度を低下させているにすぎないと考えれば、各成分における最小値をすべての成分値から減算し、その差分値を拡大することによって彩度を強調できるといえる。
【0083】
まず、上述した彩度強調指数Sから演算に有利な彩度強調パラメータSratio を、
Sratio=(S+100)/100 …(17)
として求める。この場合、彩度強調指数S=0のときに彩度強調パラメータSratio =1となって彩度強調されない。次に、RGB階調データの各成分(R,G,B)における青(B)の成分値が最小値であったとすると、この彩度強調パラメータSratio を使用して次のように変換する。
【0084】
R’=B+(R−B)×Sratio …(18)
G’=B+(G−B)×Sratio …(19)
B’=B …(20)
このようにすれば、少なくともRGB表色空間とLuv空間との間での色変換が不要となるが、この場合には彩度を強調すると輝度も向上して全体的に明るくなるという傾向がある。従って、各成分値から輝度の相当値を減算した差分値を対象として変換を行うことにする。
【0085】
輝度については、上述したようなRGBから直に求める変換式を利用する。
【0086】
一方、彩度強調は、
R’=R+△R …(21)
G’=G+△G …(22)
B’=B+△B …(23)
とする。この加減値△R,△G,△Bは輝度との差分値に基づいて次式のように求める。すなわち、
△R=(R−Y)×Sratio …(24)
△G=(G−Y)×Sratio …(25)
△B=(B−Y)×Sratio …(26)
となり、この結果、
R’=R+(R−Y)×Sratio …(27)
G’=G+(G−Y)×Sratio …(28)
B’=B+(B−Y)×Sratio …(29)
として変換可能となる。なお、輝度の保存は次式から明らかである。
【0087】

Figure 2003085546
また、入力がグレー(R=G=B)のときには、輝度Y=R=G=Bとなるので、加減値△R=△G=△B=0となり、無彩色に色が付くこともない。(27)式〜(29)式を利用すれば輝度が保存され、彩度を強調しても全体的に明るくなることはない。
【0088】
ステップS304にて画像データを変換したら、ステップS306では図13に示すように変換画素を移動させ、ステップS308にて最終画素と判断されるまで繰り返す。
【0089】
彩度強調を終えたら、図6に示すフローチャートのステップS114にてエッジ強調処理を実行する。このエッジ強調の処理については図17に示している。
【0090】
エッジ強調処理では、ステップS402にて入力画像における横方向の画素数(width)と縦方向の画素数(height)とを乗算して画素数を得、ステップS404にて同検知された画素数に応じたエッジ強調度を決定する。エッジ強調度はエッジ強調の手法に大きく依存するため、まず、本実施形態におけるエッジ強調の手法について説明する。本実施形態においては、図18に示すアンシャープマスク40を使用する。このアンシャープマスク40は、中央の「100」の値をマトリクス状の画像データにおける注目画素Pijの重み付けとし、その周縁画素に対して同マスクの升目における数値に対応した重み付けとして積算するのに利用され、アンシャープマスク40を利用するのであれば、(32)式に基づいて積算する。
【0091】
【数1】
Figure 2003085546
【0092】
(32)式において、「632」とは重み付け係数の合計値であり、Mijはアンシャープマスクの升目に記載されている重み係数であり、Pijは各画素の画像データである。なお、ijについては縦列と横列の座標値を示している。
【0093】
エッジ強調後の画像データをQijとすると、エッジ強調演算は(33)式に基づいて演算される。
【0094】
Qij=Pij+C×{Pij−P’ij} …(33)
(33)式の意味するところは次のようになる。P’ijは注目画素に対して周縁画素の重み付けを低くして加算したものであるから、いわゆる「なまった(アンシャープ)」画像データとしていることになる。このようにしてなまらせたものはいわゆるローパスフィルタをかけたものと同様の意味あいを持つ。従って、「Pij−P’ij」とは本来の全成分から低周波成分を引いたことになってハイパスフィルタをかけたものと同様の意味あいを持つ。そして、ハイパスフィルタを通過したこの高周波成分に対してエッジ強調係数Cを乗算して「Pij」に加えれば同エッジ強調係数に比例して高周波成分を増したことになり、エッジが強調される。
【0095】
この意味からも、エッジ強調度はエッジ強調係数Cによって変更可能となる。
従って、画素数が大きければエッジ強調係数Cを大きくするし、画素数が小さければエッジ強調係数Cを小さくする。画像の幅と高さがwidth×heightであるときに、Eratioを(34)で表すとする。
【0096】
Eratio=min(width,height)/640+1 …(34)
そして、得られたEratioについて、次のようにエッジ強調係数Cを決定した。
【0097】
Eratio<1 なら C=1
1≦Eratio<3 なら C=2
3≦Eratio なら C=3
すなわち、短い方の画素が640画素未満であればエッジ強調係数Cは「1」、640画素以上で1920画素未満であればエッジ強調係数Cは「2」、1920画素以上であればエッジ強調係数Cを「3」としている。本実施形態においては、このようにエッジ強調係数Cを設定しているが、ドット密度によっては画像の大きさが変化するのでこのエッジ強調係数を比例的に変更するようにしても良い。
【0098】
なお、エッジ強調度は、アンシャープマスクの大きさによっても変化するため、画素数が大きければ大きなサイズのアンシャープマスクを利用すればよいし、画素数が小さければ小さなサイズのアンシャープマスクを利用すればよい。むろん、エッジ強調係数Cとアンシャープマスク40の両方を変更するようにしてもよいし、いずれか一方だけでエッジの強調度を変更しても良いことはいうまでもない。また、アンシャープマスク40は図からも明らかなように、中央部にて最も重み付けが大きく、周縁に向かうにつれて徐々に重み付けの数値が小さくなっている。この変化具合は必ずしも固定的なものではなく、適宜変更可能である。
【0099】
ところで、図18に示す「7×7」のアンシャープマスク40において最外周の升目の重み付けは「0」あるいは「1」であり、「0」については重み付けの乗算が無意味であるし、「1」の重み付けは升目の全合計値の「632」と比較すれば非常にわずかな重みしか持たない。従って、本実施形態においては、「7×7」のアンシャープマスク40の代わりに、図19に示す「5×5」のアンシャープマスク41を使用している。同図に示すアンシャープマスク41は「7×7」のアンシャープマスク40の最外周を省略したものであり、内側の「5×5」のマスク部分で重み付けは一致している。これにより、具体的な処理量は約半分になる。
【0100】
さらに、本実施形態においては、次のようにして演算量を低減させている。RGBの階調データを対象とする場合、それぞれの成分値は各色成分の輝度(明度)に対応している。従って、(33)式の演算も本来はRGBの各階調データに対して個別に行わなければならない。しかるに、アンシャープマスク40の升目の数だけの乗算と加算とを繰り返すとなるとこのような各成分ごとの個別の演算では演算量が多いと言わざるを得ない。
【0101】
一方、かかるエッジ強調は色相を保持して輝度を変えることによって実施可能なものともいえる。従って、RGBの各成分値に対して演算するのではなく、輝度を求めて演算すれば処理量が低減するといえる。上述した輝度Yの変換式を利用すれば、(32)式と(33)式は(35)式と(36)式のように書き換えられる。
【0102】
【数2】
Figure 2003085546
【0103】
Y”ij=Yij+C×{Yij−Y’ij} …(36)
さらに、Yij−Y’ijを(37)式のように置き換えれば、
delta={Yij−Y’ij}×C …(37)
変換後のR’G’B’は(38)式のように演算可能となる。
【0104】
R’=R+delta
G’=G+delta
B’=B+delta …(38)
このようにすれば乗算と加算は1/3となるので、全体の処理時間としても50〜70%程度の減少が可能となる。また、変換結果は色ノイズの強調がなくなり、画質が向上した。
【0105】
エッジ強調の処理は、マトリクス状の画像データにおける各画素についてアンシャープマスク40を利用してエッジ強調後の画像データ(R’G’B’)を算出していく処理に相当する。ステップS406〜ステップS412では各画素についてエッジ強調処理を繰り返すループ処理を表しており、ループ処理内のステップS410で図13に示すようにして水平方向及び垂直方向へ順次注目画素を移動させ、ステップS412で最終画素と判断されるまで繰り返すようになっている。
【0106】
ただし、(32)式の演算は、注目画素の周囲の画素に対して、採用するアンシャープマスク40の升目数だけ乗算演算と加算演算が必要になり、処理量としては多大になる。一方、エッジ強調が必要になる状況を考えるといわゆる画像のエッジ部分であるから、隣接する画素同士の間で画像データが大きく異なる場所に限られる。このような状況から隣接する画素との間で画像データの差が大きな場合に演算すれば足りるといえる。
【0107】
これを具体化するため、ステップS406では隣接する画素同士の間で画像データの比較を行い、差が大きい場合にのみステップS408におけるアンシャープマスクの演算を行うようにしている。このようにすれば、殆どのエッジ部分でない画像データ部分でアンシャープマスクの演算を行う必要がなくなり、処理が激減する。
【0108】
また、図20に示すように、本来であれば注目画素に対応してその周囲には八つの画素があるので、八回の比較が必要となる。しかし、例えば図の中央の注目画素と「5」の升目の画素とを比較する場合、実は、その前に注目画素が同「5」の升目であったときに「1」の升目の画素との比較で一度行われていることが分かる。従って、少なくとも隣接する画素同士の比較が一度だけ行われるようにしておくだけでも十分とすれば、互いに反対方向となる組み合わせである「1」と「5」、「2」と「6」、「3」と「7」、「4」と「8」についてはどちらか一方だけでも十分であり、上記組み合わせの四つの方向について比較を行うこととしている。
【0109】
以上のようにして利用色数が多い自然画については、自動的に最適な範囲でコントラストが拡大されるとともに、彩度強調やエッジ強調も当該画像に最適な強調度で自動的に行われる。むろん、自然画でない場合にはこれらは不要なものとしてスキップされる。
【0110】
これまでは、アプリケーション21dにおける画像処理において利用色数から画像データの種類を判定して最適な画像処理を行ってきたが、プリント処理においても判定された画像の種類に応じて同様に最適な処理が選択される。
【0111】
図21にはプリント処理に対応するフローチャートを示している。ステップS502にてラスタデータを生成した後、ステップS504にて上述したフラグに基づいて画像データの種類を判別し、二種類用意されている色変換処理のステップS506あるいはステップS508のいずれかを実行する。その後、ステップS510にて二値化し、ステップS512にて印刷データを出力する。
【0112】
ステップS506で行われるのは補間演算処理とキャッシュ処理とを組み合わせた色変換処理であり、その手順を図22以下に示している。同図に示す補間演算では実質的に演算処理する八点補間演算とともに実質的な演算処理をすることなく色変換するキャッシングを合わせて行っている。
【0113】
八点補間演算については、図23に演算の原理を示している。変換元の表色空間でRGB階調データを成分値とする座標Pを取り囲む八点の格子点からなる立法体を想定したとき、立方体のk番目の頂点での変換値をDkとするとともに立方体の体積をVとすると、立方体の内点Pでの変換値Pxは当該P点で分割される図示のような八つの小直方体の体積Vkの比率による加重から次式で補間できる。
【0114】
【数3】
Figure 2003085546
【0115】
従って、当該座標を取り囲む八つの格子点を特定し、各格子点でのCMYの階調データのそれぞれについて演算を実行することになる。
【0116】
ところで、図22に示すフローチャートを参照すると、当該補間演算の処理ルーチンでは、必ずしもこの八点補間演算を実行するのではなく、図24に示すようなキャッシュテーブルを参照して八点補間演算を省略するためのキャッシングを行っている。このキャッシュテーブルは変換元のRGBの階調データを成分値として八点補間演算を実行したときに得られたCMYの階調データを保存しておくための一定容量のテーブルである。最初、このテーブルは空白であるもののステップS606にて八点補間演算を実行した直後に求められたCMYの階調データをステップS608にて追加更新するようにしており、図21に示すステップS506にて「キャッシュ+補間演算」の処理ルーチンが実行されたときには、最初のステップS602にて変換元のRGBの階調データを成分値として当該キャッシュテーブル内を検索し、キャッシュヒットした(検索で発見できた)場合には、ステップS612にて当該記憶されているCMYの階調データを参照するようにしている。
【0117】
色変換処理ではラスタライズされたドットマトリクスの各画素についてRGBの階調データをCMYの階調データに変換していくため、ステップS610にて最終の画素となるまで繰り返している。
【0118】
このような補間演算は演算量が多いものの、自然画でない場合は利用色数が少ないので、一回の演算結果は何度も利用可能である。従って、画像データの種類が自然画でないと判定された場合においては、この「キャッシュ+補間演算」の処理は極めて有効といえる。
【0119】
次に、もう一方の色変換処理であるステップS508のプレ階調変換について説明する。
【0120】
図25のフローチャートと図26の画素の誤差分配を示す図はプレ階調変換の概略を説明するためのものである。上述した八点補間の基本式は、八回の乗算と七回の加算が必要となるため、ハードウェア化する場合でもソフトウェアで実行する場合でも資源および時間の負担が大きい。このため、より簡易に色変換を行うべく、本出願人による特開平7−30772号公報では補間演算に代えて階調変換する技術を開示している。
【0121】
同公報に開示したプレ階調変換は、いわゆる誤差拡散などの手法を用いることにより、画素の階調データを格子座標に一致するように階調変換するものであり、対象となる画素について直近の格子座標を探し(S702)、格子座標との誤差(dg)を算出し(S704)、その誤差(dg)を近隣画素へ分配する(S706)だけの処理となっている。従って、乗算と加算を繰り返す場合に比べて演算の負担を極めて簡素化できる。補間演算することなく精度を保持できる理由については同公報に詳しく述べられているのでここでは詳述しない。なお、色変換後にも二値化のための階調変換を行うことになるため、先に行われる階調変換をプレ階調変換と呼ぶ。
【0122】
このプレ階調変換でもラスタライズされたドットマトリクスの各画素について階調変換していくため、ステップS708にて最終の画素となるまで繰り返す。
そして、続くステップS710で階調変換したRGBの階調データで色変換テーブルを参照するが、このときは必ず格子点となっているため補間演算をする必要が無く、読み出しの処理は極めて容易である。
【0123】
自然画のように利用する色数が極めて多い場合には上述した「キャッシュ+補間演算」の処理においてもヒットする確率が低くなってくるため、補間演算の回数が多くなる。しかしながら、このようなプレ階調変換では全画素について誤差拡散などの処理を実行しなければならないものの、一回の処理は単純であるため、全体的には処理量が少ない。従って、利用色数が多く、自然画であると判定された画像データについてはこのようなプレ階調変換による色変換処理を選択することによって全体の処理量を低減させることが可能となる。
【0124】
本実施形態においては、利用色数の少ない非自然画については「キャッシュ+補間演算」の色変換処理を採用し、利用色数が多い自然画についてはプレ階調変換による色変換処理を採用しているが、かかる組み合わせに限られず、他の組み合わせを採用することも可能である。すなわち、画像の種類に応じて最も適切な色変換処理を自由に設定して自動的にこれを利用するようにしても良い。
【0125】
このように、画像データに対して間引き処理によって選択した各画素について輝度の分布を集計することにより(ステップS102)、利用している色数をカウントすることが可能となり(ステップS104)、その結果、利用している色数が多ければ画像データの種類として自然画であると判断することができ、また、そのような判定結果に基づいて自然画に適用して好適なコントラスト拡大処理(ステップS110)や彩度強調処理(ステップS112)やエッジ強調処理(S114)を自動的に選択可能となるし、さらに、プリント処理においても自然画であればプレ階調変換による色変換を行うし(ステップS508)、自然画でない場合には「キャッシュ+補間演算」の色変換を行い(ステップS506)、自動的に処理量の少ない色変換処理を選択することが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施形態にかかる画像処理装置の具体的ハードウェア構成例のブロック図である。
【図2】コンピュータの内部で行なわれる処理を示すブロック図である。
【図3】画像処理手段のより詳細な構成を示す概略ブロック図である。
【図4】プリンタドライバのより詳細な構成を示す概略ブロック図である。
【図5】本発明の画像処理装置の他の適用例を示す概略ブロック図である。
【図6】本発明におけるアプリケーションの画像処理を示すフローチャートである。
【図7】変換元の画像を示す図である。
【図8】サンプリング周期を示す図である。
【図9】サンプリング画素数を示す図である。
【図10】変換元の画像とサンプリングされる画素の関係を示す図である。
【図11】集計された輝度分布と拡大される輝度分布を示す図である。
【図12】画像処理として用意されたコントラスト拡大処理を示すフローチャートである。
【図13】注目画素の移動方向を示す図である。
【図14】画像処理として用意された彩度強調処理を示すフローチャートである。
【図15】彩度分布の集計状態の概略図である。
【図16】彩度Aと彩度強調指数Sとの関係を示す図である。
【図17】画像処理として用意されたエッジ強調処理を示すフローチャートである。
【図18】アンシャープマスクを示す図である。
【図19】アンシャープマスクの改良版を示す図である。
【図20】画像データにおいて隣接画素との比較方向を示す図である。
【図21】プリンタドライバの印刷処理の手順を示すフローチャートである。
【図22】キャッシュ+補間演算による色変換処理のフローチャートである。
【図23】八点補間演算の概念を示す図である。
【図24】キャッシュテーブルの内容を示す図である。
【図25】プレ階調変換処理のフローチャートである。
【図26】各画素の誤差拡散の様子を示す図である。
【符号の説明】
10…画像入力装置
20…画像処理装置
21a…オペレーティングシステム
21b…プリンタドライバ
21b1…ラスタライザ
21b2…色変換部
21b3…階調変換部
21c…ビデオドライバ
21d…アプリケーション
21d1…色数検知手段
21d2…画像判定手段
21d3…画像処理手段
30…画像出力装置Patent application title: IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND MEDIUM CONTAINING IMAGE PROCESSING PROGRAM
1. An image processing apparatus for performing predetermined image processing on image data of an image comprising a plurality of pixels, comprising:
Color number detection means for inputting the image data and detecting the number of used colors ;
An image processing apparatus comprising: image processing means for performing branching of image processing to be executed according to the detected number of used colors.
2. The image processing apparatus according to claim 1, wherein the number-of-colors detecting means detects the number of colors used by regarding information corresponding to the luminance of each pixel as a color. apparatus.
3. The image processing apparatus according to claim 2 , wherein in the case where the image data is represented by a plurality of component values corresponding to the luminance, the color number detection means performs weighting integration of the same component values. An image processing apparatus characterized by obtaining luminance.
4. The image processing apparatus according to any one of claims 1 to 3 , wherein said color number detection means detects the number of colors for pixels sampled from image data. apparatus.
5. The image processing apparatus according to any one of claims 1 to 4 , wherein the image processing means performs image processing for enlarging the luminance distribution when the number of used colors of the image data is large. An image processing apparatus characterized in that the luminance distribution is not expanded when the number of used colors is small.
6. The image processing apparatus according to any one of claims 1 to 5 , wherein the image processing means performs image processing to enhance saturation when the number of used colors of the image data is large. An image processing apparatus characterized in that the saturation is not emphasized when the number of colors used is small.
7. The image processing apparatus according to any one of claims 1 to 6, said image processing means carries out an image processing for edge emphasis in the case utilizing the number of colors of the image data is large An image processing apparatus characterized in that edge emphasis is not performed when the number of colors used is small.
The image processing apparatus according to any one of claims 8 wherein the Claims 1 to 7, corresponding to tone colorimetric data in Table color space of the destination to the lattice point in the conversion source color specification space To convert the original tone color data of the conversion source into tone color data corresponding to the grid points of the table while reading the corresponding tone color data by referring to the table Pre-gradation conversion means for color conversion and color conversion to corresponding gradation table color data by interpolation calculation between grid points of the above-mentioned table, and a high-speed readable storage area for storing information of this color conversion Cache color conversion means for performing color conversion by interpolation calculation when the image data is not stored in the same storage area, and the same pre-gradation conversion means is used when the number of used colors of the image data is large. Use color conversion and the same image data An image processing apparatus characterized by performing color conversion using the interpolation color conversion means when the number of colors used is small.
9. An image processing method for performing predetermined image processing on image data of an image comprising a plurality of pixels , wherein the image data is input to detect the number of colors used, and the detected colors used An image processing method comprising: selecting image processing to be performed according to the number and executing the selected image processing.
10. A medium storing an image processing program for performing predetermined image processing by inputting image data of an image consisting of a plurality of pixels and performing predetermined image processing,
Inputting the image data and detecting the number of used colors ;
And a step of selecting and executing image processing in accordance with the detected number of used colors .
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 storing an image processing program, and in particular, an image processing apparatus that executes predetermined processing according to the type of image data, an image processing method, and an image processing program. It relates to the medium.
[0002]
[Prior Art]
2. Description of the Related Art Software that performs various types of effect processing on image data of a natural image such as a photograph and image data of a non-natural image of a draw system is conventionally known. In such software, image data is displayed on a display or the like, and a worker performs desired processing to form image data with a good appearance.
[0003]
Here, among various effect processes, there are some that convert natural images more beautifully, but some also do not need to be modified like a draw-type image.
[0004]
[Problems to be solved by the invention]
The image processing apparatus configured by the conventional software described above has a problem that the operator has to determine the type of the image on the display and select various effect processing, which can not be automated.
[0005]
The present invention has been made in view of the above problems, and an image processing apparatus, an image processing method, and a medium storing an image processing program capable of automatically determining the type of image data and performing appropriate processing. The purpose is to provide.
[0006]
[Means for Solving the Problems]
In order to achieve the above object, the invention according to claim 1 is an image processing apparatus for performing predetermined image processing on image data of an image composed of a plurality of pixels, wherein the image data is input and the number of used colors is The apparatus comprises a color number detection unit to detect and an image processing unit that branches image processing to be executed according to the detected usage color number.
[0007]
The number of colors used varies depending on the type of image. For example, in the case of natural images such as photographs, even if the object to be photographed is the same blue, considerable colors are used, such as multiple colors due to shading. On the other hand, when drawing data or a business graph, the operator originally specifies a color and is drawn, so the number of colors is naturally limited. Therefore, the image type can be determined from the number of used colors. On the other hand, as a method of detecting the number of colors used for image data, first, there is a method of determining actual colors in each pixel in a matrix form and totaling and detecting in a histogram form.
[0008]
However, accurate values are not necessarily required, and since so-called full color can have 16.7 million color numbers, it may be troublesome to detect the correct color number itself.
[0009]
Under such premise, in the invention according to claim 1 configured as described above, the image processing means detects the number of used colors when the color number detection means inputs the image data. Branch image processing to be executed according to the number of colors used.
[0010]
In addition, although the luminance corresponds to each color, and a plurality of colors correspond to one luminance value, it does not have many luminance values and a small number of colors, so it happens to be luminance values. It is also unrealistic to think that is composed only of matching colors. Therefore, it can be said that if the rough tendency is large or small whether the number of used colors is large or small, it may be determined by the luminance value. Of course, when the luminance value is replaced in this way, the equivalent to the number of used colors is more accurate than the number of used colors, but it is called the number of used colors on the premise of determining the type of image. Make it
[0011]
Here, according to the third aspect of the present invention, in the image processing apparatus according to the second aspect , in the case where the image data is represented by a plurality of component values corresponding to the luminance, the color number detection unit The luminance is obtained by weighted integration of values.
[0012]
Even if it is advantageous to use the luminance, if there is no luminance component in the parameters of the image data, the color conversion must be performed, and usually, a large amount of processing is required for the color conversion. However, since some errors are allowed at the time of using the luminance, when the image data is represented by a plurality of component values corresponding to the luminance, a large amount of processing is performed by weighting integration of the same component values. The brightness can be obtained without the need.
[0013]
There are other methods to simplify the detection of the number of used colors. For example, in a three-dimensional color space, it is in the form of a lattice of jumps in each axial direction, and one group is considered to be one color. As a result, for example, it is not necessary to count in a huge number of colors when each axis has 256 gradations.
[0014]
Further, the number of colors used in the entire image data does not necessarily have to be totaled for all the pixels. For example, in the invention according to claim 3, in the image processing apparatus according to any one of claims 1 or 2, The color number detection unit is configured to detect the number of colors of the pixels sampled from the image data.
[0015]
Of course, although an error occurs due to thinning, it is not necessary to know the correct number of used colors as described above, so detecting the number of colors for pixels sampled from image data reduces the number of target pixels, The amount of processing also decreases.
[0016]
In the case of a natural image, there is contrast correction processing as image processing suitable, and in the invention according to claim 5, in the image processing apparatus according to any one of claims 1 to 4 , the image processing means is The image processing is performed to expand the luminance distribution when the number of used colors of the image data is large, and the luminance distribution is not expanded when the number of used colors is small.
[0017]
For example, in a photograph, an image with a narrow width of contrast may be obtained depending on conditions at the time of shooting. For this purpose, image processing is sometimes performed, but according to the invention of claim 5, when the number of colors of the image data detected by the color number detecting means is large, it is judged to be a natural image, and in this case The image processing means performs image processing to enlarge the luminance distribution. Of course, the range of the distribution to be expanded can be changed as appropriate, and it is not necessary to carry out the enlargement processing as long as the image data has a sufficiently wide luminance distribution and a wide contrast range. Further, in the case of a non-natural image such as a business graph, the width of the contrast is not asked and the luminance distribution is not expanded.
[0018]
Furthermore, according to the invention of claim 6, in the image processing apparatus according to any one of claims 1 to 5, the image processing means emphasizes saturation when the number of used colors of the image data is large. In addition to the image processing, when the number of used colors is small, the saturation is not emphasized.
[0019]
Similarly, depending on the conditions of the light beam at the time of shooting, the color may become dull in photographs. For this purpose, image processing is sometimes performed, but according to the invention of claim 6, when the number of colors of the image data detected by the color number detection means is large, it is judged to be a natural image, and in this case The image processing means performs image processing to emphasize saturation. Of course, in the case of a non-natural picture such as a business graph, there is no requirement to intentionally change the hue to make it vivid, and the saturation emphasis is not performed.
[0020]
Furthermore, according to the invention of claim 7, in the image processing apparatus according to any one of claims 1 to 6 , the image processing means makes an image to be edge-emphasized when the number of used colors of the image data is large. It is said that edge enhancement is not performed when processing is performed and the number of used colors is small.
[0021]
Also in this case, taking a picture as an example, the image may become blurred with blurred edges depending on the conditions at the time of shooting, and image processing may be performed for this purpose. According to the above, when the number of colors of the image data detected by the number-of-colors detection unit is large, it is determined that the image is a natural image. Of course, the degree of edge emphasis can be changed as appropriate. Various specific methods can be adopted for the specific method of the edge enhancement processing. For example, low frequency components are obtained based on the pixel distribution of the periphery for each pixel constituting the image data, and the low frequency components are reduced. As a result, correction may be made to increase the edge degree of each pixel.
[0022]
On the other hand, the image data subjected to image processing may be used in various ways besides being displayed on the display, and may be, for example, print processing. Such in the case it is necessary to convert the color space of different printing inks and color space of the original image data, corresponding to those with such color conversion, the invention according to claim 8, wherein In the image processing apparatus according to any one of claims 1 to 7 , the conversion is performed while providing a table in which the gradation color data in the conversion color space is made to correspond to the grid point in the conversion color space. Pre-gradation to convert original gradation color data into gradation color data corresponding to the grid points of the table, read out the corresponding gradation color data with reference to the table, and perform color conversion A storage unit having a high-speed readable storage area capable of color conversion to corresponding gradation table color data by interpolation calculation between the grid points of the above-mentioned table, and conversion means, and storing the information of the color conversion Color conversion by interpolation operation when not stored in And a interpolation color converting means Cache Usage for, to color conversion by using the same pre-gradation conversion means when utilizing the number of colors of the image data is large, when the use number of colors of the image data is small The color conversion is performed using the same interpolation color conversion means .
[0023]
When performing color conversion between different color spaces, prepare a table in which the grid point in the color space of conversion source is associated with the gradation data in the color space of conversion destination, and refer to the table It becomes possible to change if the corresponding data of predetermined grid points is read out sequentially, but if the grid points corresponding to all the tone values of the conversion source tone data are provided, the table becomes too large. For this reason, the pre-gradation conversion means converts the gradation data of the conversion source into gradation data corresponding to the grid points of the table, thereby reducing the size of the table. Although gradation data other than the grid points in the table can be changed by interpolation calculation, when there are a large number of colors, gradation conversion to be executed by error diffusion has a characteristic that the amount of calculation is surely reduced.
[0024]
However, there is a premise that error diffusion processing must be performed on the previous pixel, and in the case of a non-natural image, the number of colors is small, so the result of one conversion can be used many times. Therefore, in such a case, a cache-use interpolation color conversion unit that repeats the processing of storing the color conversion result in a high-speed readable storage area while using the interpolation operation and reading out from this storage area as needed. Is faster.
[0025]
As described above, the method of providing the plurality of correspondences and changing the correspondence according to the pixels does not have to be limited to a tangible device, and it can be easily understood that it also functions as the method. Therefore, the invention according to claim 9 is an image processing method for performing predetermined image processing on image data of an image composed of a plurality of pixels , wherein the image data is input to detect the number of colors used. The image processing to be executed is selected according to the detected number of used colors , and the selected image processing is executed.
[0026]
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.
[0027]
By the way, such an image processing apparatus may exist alone or may be used in a state of being incorporated in a certain device, and the idea of the invention is not limited to this, and includes various aspects. . Therefore, it can be changed as appropriate, such as software or hardware.
[0028]
In the case of software of 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, the invention according to claim 10 is a medium on which an image processing program for performing predetermined image processing is input by an image data computer of an image consisting of a plurality of pixels , and the image data is input. The method comprises a step of detecting the number of used colors, and a step of selecting and executing image processing according to the detected number of used colors.
[0029]
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.
[0030]
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. Furthermore, it is needless to say that the present invention can be applied to an image processing apparatus incorporated in a color facsimile machine, a color copier, a color scanner, a digital camera, a digital video and the like.
[0031]
【Effect of the invention】
As described above, the present invention can provide an image processing apparatus capable of automatically determining the type of image data from the viewpoint of the number of used colors and branching image processing.
[0032]
Further , according to the invention of claim 2, by replacing the number of used colors with the luminance, it is possible to easily count even when the number of reproducible colors is large.
Furthermore, according to the third aspect of the present invention, the luminance can be extremely easily obtained by weighting and integrating component values corresponding to the luminance.
[0033]
Furthermore, according to the fourth aspect of the present invention, the processing amount can be reduced because the target pixel whose color number is to be detected is thinned out and selected.
[0034]
Furthermore, according to the invention of claim 5, when it is determined that the image type is a natural image, the contrast enlargement processing is automatically performed, and image data of an optimal contrast can be obtained.
[0035]
Furthermore, according to the invention of claim 6, when it is determined that the type of image is a natural image, saturation enhancement processing can be automatically performed to obtain vivid image data.
[0036]
Furthermore, according to the invention of claim 7, when it is determined that the type of image is a natural image, edge enhancement processing is automatically performed, and image data with no edge rounding can be obtained.
[0037]
Furthermore, according to the invention of claim 8, in the case of a natural image having a large number of used colors, color conversion can be performed with a minimum amount of calculation using a method such as error diffusion, and the number of used colors is If the number is small, the conversion result can be repeatedly used by using the cache, so that the minimum processing amount can be achieved by the color conversion method corresponding to each type of image.
[0038]
Furthermore, according to the invention of claim 9, it is possible to provide an image processing method capable of automatically and easily determining the type of image data from the viewpoint of the number of used colors and branching image processing. According to the tenth aspect of the present invention, it is possible to provide a medium on which an image processing program capable of branching image processing by automatically and easily determining the type of image data is similarly provided.
[0039]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described based on the drawings.
[0040]
FIG. 1 is a block diagram showing an example of a specific hardware configuration of an image processing apparatus according to an embodiment of the present invention.
[0041]
In the figure, a scanner 11 and a digital still camera 12 are provided as various image input devices 10, and a computer main body 21 and a hard disk 22 are provided as image processing devices 20 that play a central role in image processing including image determination. A printer 31 and a display 32 are provided as an image output device 30 for displaying an image subjected to image processing.
[0042]
A process performed inside the computer main body 21 is shown in FIG. As shown in the figure, an operating system 21a operates in the computer main body 21, and a printer driver 21b and a video driver 21c corresponding to the printer 31 and the display 32 are incorporated. On the other hand, the application 21d is controlled by the operating system 21a to execute processing, and executes predetermined image processing in cooperation with the printer driver 21b and the video driver 21c as necessary. The computer 21 executes the respective programs stored in the internal ROM and the hard disk 22 while using the RAM and the like. In addition to such programs for image processing being supplied via various recording media such as CD-ROMs, floppy disks, and MOs, they are connected to an external network via a public communication line by a modem or the like. Software and data are also downloaded and introduced.
[0043]
In the present embodiment, the scanner 11 as the image input device 10 and the digital still camera 12 output gradation data of RGB (green, blue, red) as image data, and a printer as the image output device 30. 31 requires CMY (cyan, magenta, yellow) or CMYK binary data with black added as gray scale color specification data as an input, and the display 32 needs the RGB gray scale data as an input . Therefore, the specific role of the computer main body 21 as the image processing apparatus 20 is to input RGB gradation data and create necessary RGB emphasis data to create RGB gradation data. 21c, and the printer 31 is converted to CMY binary data via the printer driver 21b and printed.
[0044]
In the image processing in the present embodiment, when the color number detection unit 21d1 of the application 21d detects the number of used colors for the image data input into the computer main body 21, the image determination unit 21d2 determines the type of the image, and the image processing is performed. The means 21d3 automatically performs appropriate image processing set in advance according to the type of image. The image data subjected to the image processing is displayed on the display 32 through the video driver 21c, and after confirmation, converted into print data by the printer driver 21b and printed by the printer 31.
[0045]
In the present embodiment, as the image processing means 21d3 set according to the type of image, as shown in FIG. 3, a contrast enlargement process, a saturation enhancement process, and an edge enhancement process are prepared. In the printer driver 21b for converting image data into print data, as shown in FIG. 4, a color conversion unit performs color conversion by a combination of a rasterizer 21b1 for rasterizing print data and pre-gradation conversion or cache and interpolation operation. 21b2 and a tone conversion unit 21b3 for binarizing tone data after color conversion are prepared.
[0046]
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 the number of colors used for image data is not limited. It may be a system that detects and determines the type of image. For example, as shown in FIG. 5, in a printer 31b that inputs and prints image data without passing through a computer system, the number of colors used is automatically set for image data that is input via the scanner 11b or the modem 13b. It is also possible to configure to detect and determine the type of image.
[0047]
FIG. 6 shows a flowchart corresponding to the image processing in the application, and in steps S102 and S104, the number of used colors is detected by aggregating the luminance distribution.
[0048]
First, this luminance distribution detection process will be described.
[0049]
Before describing how to represent the luminance, the pixels to be distributed will be described. As shown in step S102 of FIG. 6, thinning out processing is performed to thin out target pixels. As shown in FIG. 7, in the case of a bitmap image, it is formed as a two-dimensional dot matrix consisting of predetermined dots in the vertical direction and predetermined dots in the horizontal direction, and all pixels are required to obtain an accurate luminance distribution. You need to find out about the brightness. However, this distribution detection processing aims to indirectly obtain the use color from the luminance, and does not necessarily have to be accurate. Therefore, it is possible to perform thinning to such an extent that it falls within a certain error range. According to the statistical error, the error with respect to the number of samples N can be approximately expressed as 1 / (N ** (1/2)). However, ** represents a power. Therefore, in order to perform processing with an error of about 1%, N = 10000.
[0050]
Here, the bit map screen shown in FIG. 7 has the number of pixels of (width) × (height), and the sampling cycle ratio is ratio = min (width, height) / A + 1 (1)
I assume. Here, min (width, height) is the smaller one of width and height, and A is a constant. Further, the sampling period ratio mentioned here indicates how many pixels are to be sampled, and the circled pixels in FIG. 8 indicate the case where the sampling period ratio = 2. That is, sampling of one pixel is performed every two pixels in the vertical direction and horizontal direction, and sampling is performed every other pixel. The number of sampling pixels in one line when A = 200 is as shown in FIG.
[0051]
As apparent from the figure, it is understood that the number of samples is at least 100 at least when there is a width of 200 pixels or more, except in the case of sampling period ratio = 1 where sampling is not to be performed. Therefore, in the case of 200 pixels or more in the vertical direction and the horizontal direction, (100 pixels) × (100 pixels) = (10000 pixels) is secured, and the error can be made 1% or less.
[0052]
The reason why min (width, height) is used as a reference here is as follows. For example, assuming that width >> height as in the bitmap image shown in FIG. 10A, if the sampling period ratio has been determined with the longer width, as shown in FIG. However, it may happen that only two lines at the top and bottom are extracted in the vertical direction. However, if the sampling cycle ratio is determined based on the smaller one as min (width, height), as shown in FIG. 6C, thinning is performed to include the middle part even in the smaller vertical direction. Will be able to
[0053]
In this example, decimation is performed on pixels in the vertical direction and the horizontal direction at accurate sampling cycles. This is suitable for processing while thinning out sequentially input pixels. However, when all the pixels are input, the coordinates may be randomly designated in the vertical direction or the horizontal direction to select the pixels. In this case, when the necessary minimum number of pixels such as 10000 pixels is determined, the process of extracting randomly is repeated until it reaches 10000 pixels, and the extraction may be stopped when it becomes 10000 pixels.
[0054]
If pixel data of a pixel thus selected has luminance as its component element, it is possible to obtain the distribution using the luminance value. On the other hand, even in the case of image data whose luminance value is not a direct component value, the component value indirectly representing the luminance is provided. Therefore, the luminance value can be obtained by converting the color space in which the luminance value is not a direct component value into the color space in which the luminance value is a direct component value.
[0055]
Such color conversion between different color spaces is not uniquely determined by a conversion equation, but the correspondence relationship is determined for color spaces having respective component values as coordinates, and this correspondence relationship is stored. It is necessary to sequentially convert by referring to the color conversion table. The component values are expressed as gradation values in terms of tables, and in the case of 256 gradations having three-dimensional coordinate axes, a color conversion table of approximately 16.7 million (256 × 256 × 256) elements You must have it. As a result of efficient use of storage resources, instead of preparing correspondences for all coordinate values, correspondences are usually prepared for appropriate discrete grid points, and interpolation calculations are used in combination. I am trying to do it. Since this interpolation operation can be performed through several multiplications and additions, the amount of operation processing becomes enormous.
[0056]
That is, if a full-size color conversion table is used, the processing amount decreases but the table size becomes unrealistic, and if the table size is a realistic size, the arithmetic processing amount becomes unrealistic There are many.
[0057]
In view of such a situation, in the present embodiment, as used in the case of a television or the like, a conversion equation of the following equation for obtaining luminance from three primary colors of RGB is employed. That is, for the luminance yp at point P, from the component values (Rp, Gp, Bp) of RGB,
yp = 0.30 Rp + 0.59 Gp + 0.11 Bp (2)
I assume. In this way, it is possible to obtain the luminance value with only three multiplications and two additions.
[0058]
In this embodiment, as a result of targeting the RGB color space, such a conversion formula is adopted, but since each component value indicates the brightness of the color in the background, each component When viewed alone, it has the property that it linearly corresponds to the luminance. Therefore, more roughly speaking, yp = (Rp + Gp + Bp) / 3 (3)
It is not impossible to simplify.
[0059]
Thus, when the luminances are summed up by the thinning process, the distribution becomes as shown by the solid line in FIG. Therefore, the number of used colors can be detected by counting the number of luminance values whose number of pixels is not "0" in step S104. In addition, although totaling of saturation distribution is also performed with step S102 in addition to luminance distribution, this will be described later.
[0060]
When the number of colors used is detected in this manner, the number of colors used is compared with a predetermined threshold in step S106, and if the number of colors used is larger, it is determined that the image data is a natural image. As the threshold value, for example, "50" color may be set.
There is an example in which a business graph or a draw system image is read by the scanner 11 as image data other than a natural image, or a computer graphic image is read from the scanner 11 or input from the network via the modem 13b. There is a case like this.
[0061]
If it is a natural image, a flag as a natural image is set in step S108. The flag is set to convey the determination result to the printer driver 21b other than the image processing of the application 21d. In the present embodiment, only one threshold is prepared for the time being, and it is determined whether or not the image is a natural image. However, more detailed determination is performed in the range of the number of used colors. Also good.
For example, even in the case of computer graphics, the number of colors may increase to some extent due to gradation, etc. Even though the original number of colors is not very large, the edge portion may be blurred when read by the scanner 11 May be increased. Therefore, such a thing may be classified into a natural picture and a non-natural picture, and as described later, it may be set that only the edge emphasizing process is performed without performing the image process for the natural picture.
[0062]
For natural images, the contrast is expanded in step S110, the saturation is enhanced in step S112, and the edge enhancement is performed in step S114.
[0063]
In the present embodiment, when the luminance distribution is partially concentrated within the range of the intrinsic reproducible luminance distribution as shown by the solid line in FIG. 11, this is sufficiently expanded within the reproducible range. It means processing.
[0064]
Assuming that the reproducible luminance range is “0” to “255”, in luminance conversion, the conversion destination luminance Y is next from the luminance y before conversion and the maximum value ymax and the minimum value ymin of the luminance distribution range. Find based on the formula.
[0065]
Y = ay + b (4)
However, a = 255 / (ymax-ymin) (5)
b = −a · y min or 255−a · y max (6)
Further, if Y <0 in the above conversion equation, then Y = 0, and if Y> 255, then Y = 255. Here, a is the slope and b is the offset. According to this conversion equation, it is possible to extend the luminance distribution having a certain narrow width to a reproducible range.
[0066]
When the luminance distribution is to be expanded, the flowchart shown in FIG. 12 is executed, and in step S202, both ends of the luminance distribution are obtained. The luminance distribution in a natural image appears approximately in a mountain shape. Of course, the position and shape are various. The width of the luminance distribution is determined by where the two ends are determined, but it is not possible to simply use the point where the base extends and the distribution number becomes “0”, and the largest luminance in the distribution range is the smallest Let the part which is inward by a certain distribution ratio from the side be the both ends of the distribution. In the present embodiment, this distribution ratio is set to 0.5%. As described above, by cutting the upper end and the lower end by a certain distribution ratio, it is possible to ignore white spots and black spots caused due to noise and the like.
[0067]
In the actual processing, 0.5% of the number of pixels to be processed (the total number of pixels selected in the thinning process) is calculated, and the luminance value at the upper end and the luminance value at the lower end in the reproducible luminance distribution are sequentially inward. While each distribution number is accumulated, the luminance value which is a value of 0.5% is obtained. The upper end side is ymax, and the lower end side is ymin.
[0068]
In the present embodiment, although the upper end and the lower end are obtained through such processing for the luminance distribution, it is also possible to obtain the both ends under statistical processing. For example, it is also possible to adopt a method in which an end portion is a portion where what percentage or less is less than the average value of the luminance values.
[0069]
By the way, since the possible range of the luminance y can be only “0” to “255”, it is efficient to previously obtain the converted luminance Y corresponding to all possible values of the luminance y. In step S204, this correspondence is calculated and stored as a table.
[0070]
Thereafter, the luminance is expanded with reference to the table calculated at step S204 for each pixel. By the way, the correspondence relationship for converting the luminance has been obtained so far, and for example, the conversion relationship regarding the component values (Rp, Gp, Bp) in the RGB coordinate axes has not been obtained. However, the conversion equation of the equation (4) can also be applied to the correspondence with the component values (Rp, Gp, Bp) of RGB. That is, component values (R ′, G ′, B ′) after conversion with respect to component values (R, G, B) before conversion are
R '= a · R + b (7)
G '= a · G + b (8)
B '= a · B + b (9)
It can be determined as This is clear from the fact that both the equations (4) and (3) show a linear correspondence. In addition, the component values (R, G, B) and (R ', G', B ') of RGB are the same corresponding to the luminance y and Y being gradation "0" to gradation "255". It can be said that the conversion table of the luminance y and Y described above may be used as it is.
[0071]
Therefore, in step S206, image data (R, G, B) of all pixels are converted to image data (R ', G', B ') by referring to the conversion table corresponding to equations (7) to (9). . Then, in step S208, the conversion pixel is sequentially moved as shown in FIG. 13, and the process is repeated until it is determined in step S210 that the pixel is the final pixel.
[0072]
Referring back to the flowchart shown in FIG. 6, after the contrast enlargement, saturation enhancement is performed in step S112. The process of emphasizing the saturation is shown in FIG.
[0073]
Also in this saturation enhancement processing, the saturation distribution in the image data is obtained in advance, and the saturation enhancement coefficient S is obtained from the distribution. In this case, as in the case of the luminance distribution, it is not necessary to count the saturations for all the pixels, and the saturations are calculated for the pixels thinned out in step S102. If the image data has saturation as its component element, it is possible to obtain the distribution using the value of the saturation, and even in the case of image data whose saturation is not a direct component element, In practice, component values representing saturation are provided. Therefore, the saturation value can be obtained by converting the color space in which the saturation is not a direct component element to the color space in which the saturation value is a direct component value. For example, in Luv space as a standard color system, the L axis represents luminance (brightness), and the U axis and V axis represent hues. Here, in the U axis and the V axis, the distance from the intersection of both axes represents the saturation, so that (U + V) ** (1/2) is substantially the saturation. However, the amount of arithmetic processing required for such conversion becomes enormous.
[0074]
Therefore, in the present embodiment, the saturation substitute value X is obtained as follows by directly using standard RGB gradation data as image data.
[0075]
X = | G + B-2 × R | (10)
Essentially, the saturation is “0” when R = G = B, and becomes the maximum value at the time of mixing by a predetermined ratio of a single color of RGB or any two colors. Although it is possible to directly express saturation from this property, it is possible to obtain saturation of the maximum value in the case of cyan which is a single color of red and a mixture of green and blue according to the simple equation (10). It becomes "0" when the component is uniform. In addition, it has reached about half of the maximum value for green and blue single colors.
[0076]
Note that, in a situation in which each component independently represents a component of each color as in the RGB color space, in a situation indicated by component values of so-called roughly equivalent hue components,
X '= | R + B-2 × G | (11)
X ′ ′ = | G + R−2 × B | (12)
The following equation (10) can be substituted as a result, but the result is the best.
[0077]
When the distribution of saturation is calculated from the RGB image data for the pixels thinned out in step S102 based on the equation (10), the saturation is distributed in the range of the lowest value “0” to the maximum value “511”. The distribution is as shown in FIG.
[0078]
Based on the accumulated saturation distribution, a saturation enhancement index for this image is determined in step S302. Assuming that the summed saturation distribution is as shown in FIG. 15, in the present embodiment, the range occupied by the upper “16%” as the distribution number within the effective pixel number range is determined. Then, the saturation emphasis index S is determined based on the following equation, assuming that the lowest saturation "A" within this range represents the saturation of this image.
[0079]
That is,
If A <92, S = −A × (10/92) +50 (13)
If 92 ≦ A <184, then S = −A × (10/46) +60 (14)
If 184 ≦ A <230, then S = −A × (10/23) +100 (15)
If 230 ≦ A, then S = 0 (16)
I assume. FIG. 16 shows the relationship between the saturation “A” and the saturation emphasis index S. As shown in the figure, the saturation enhancement index S is large when the saturation "A" is small in the range from the maximum value "50" to the minimum value "0", and is small when the saturation "A" is large. Will gradually change.
[0080]
In this embodiment, although the saturation occupied by a certain proportion of the higher rank in the aggregated saturation distribution is used, the present invention is not limited to this, for example, an average value may be obtained or a median may be determined to obtain saturation. It may be a basis for calculating the index S. However, when the upper part of the saturation distribution is taken, the effect of the sudden error is reduced, so that good results can be obtained as a whole.
[0081]
When the saturation emphasis index S is obtained, the saturation emphasis processing is performed on the image data of each pixel. When emphasizing saturation based on the saturation emphasis index S, as long as the image data has a parameter of saturation as described above, the parameter may be converted, but this time the color specification of RGB is used. Space is adopted. Therefore, a method of emphasizing saturation using RGB gradation data as it is will be described below.
[0082]
As in the RGB color space, when R = G = B when R = G = B, when the components are component values of hue components having an approximately equal relationship, they become non-saturation. Therefore, regarding the component which becomes the minimum value in each component of RGB, if the saturation is simply reduced without affecting the hue of each pixel, the minimum value in each component is determined from all component values. It can be said that saturation can be enhanced by subtracting and enlarging the difference value.
[0083]
First, the saturation emphasis parameter Sratio which is advantageous to the operation from the saturation emphasis index S mentioned above,
Sratio = (S + 100) / 100 (17)
Ask as. In this case, when the saturation enhancement index S = 0, the saturation enhancement parameter Sratio = 1 and the saturation enhancement is not performed. Next, assuming that the component value of blue (B) in each component (R, G, B) of RGB gradation data is a minimum value, conversion is performed as follows using this saturation emphasis parameter Sratio.
[0084]
R ′ = B + (R−B) × Sratio (18)
G ′ = B + (GB) × Sratio (19)
B '= B (20)
In this case, at least color conversion between the RGB color space and the Luv space is not necessary, but in this case, there is a tendency that when the saturation is emphasized, the luminance is also improved and the whole becomes bright. . Therefore, the conversion is performed on the difference value obtained by subtracting the luminance equivalent value from each component value.
[0085]
For the luminance, a conversion equation to be obtained directly from RGB as described above is used.
[0086]
On the other hand, saturation emphasis is
R '= R + ΔR (21)
G ′ = G + ΔG (22)
B '= B + ΔB (23)
I assume. The addition and subtraction values ΔR, ΔG, and ΔB are obtained as in the following equation based on the difference value with the luminance. That is,
ΔR = (R−Y) × Sratio (24)
Δ G = (G−Y) × Sratio (25)
ΔB = (B−Y) × Sratio (26)
And this results in
R ′ = R + (RY) × Sratio (27)
G ′ = G + (G−Y) × Sratio (28)
B ′ = B + (B−Y) × Sratio (29)
It can be converted as The preservation of the luminance is apparent from the following equation.
[0087]
Figure 2003085546
Also, when the input is gray (R = G = B), the luminance Y = R = G = B, so the addition / subtraction value ΔR = ΔG = ΔB = 0 and no achromatic color is given. . The luminance is preserved by using the equations (27) to (29), and the overall luminance does not become bright even if the saturation is emphasized.
[0088]
After the image data is converted in step S304, the converted pixel is moved in step S306 as shown in FIG. 13, and the process is repeated until it is determined to be the final pixel in step S308.
[0089]
After the saturation emphasis is completed, edge emphasis processing is executed in step S114 of the flowchart shown in FIG. The process of this edge emphasis is shown in FIG.
[0090]
In the edge enhancement processing, the number of pixels in the input image in the horizontal direction (width) and the number of pixels in the vertical direction (height) in the input image are multiplied in step S402 to obtain the number of pixels. Determine the corresponding edge emphasis degree. Since the degree of edge emphasis largely depends on the method of edge emphasis, the method of edge emphasis in the present embodiment will be described first. In the present embodiment, an unsharp mask 40 shown in FIG. 18 is used. This unsharp mask 40 uses the value of "100" in the center as a weighting of the target pixel Pij in the matrix-like image data, and is used to integrate that peripheral pixel as a weighting corresponding to the numerical value in the grid of the same mask. If the unsharp mask 40 is used, the integration is performed based on the equation (32).
[0091]
[Equation 1]
Figure 2003085546
[0092]
In the equation (32), “632” is a total value of weighting coefficients, Mij is a weighting coefficient described in the cell of the unsharp mask, and Pij is image data of each pixel. As for ij, coordinate values of columns and rows are shown.
[0093]
Assuming that the image data after edge enhancement is Qij, the edge enhancement operation is calculated based on equation (33).
[0094]
Qij = Pij + C × {Pij−P′ij} (33)
The meaning of equation (33) is as follows. Since P ′ ij is obtained by reducing the weighting of the peripheral pixels with respect to the pixel of interest and adding them, so-called “unsharp” image data is obtained. In this way, the ones thus made have the same meaning as the ones to which a so-called low pass filter is applied. Therefore, "Pij-P'ij" has the same meaning as that obtained by subtracting the low frequency component from the original total component and applying the high pass filter. Then, the high frequency component passed through the high pass filter is multiplied by the edge enhancement coefficient C and added to “Pij”, which means that the high frequency component is increased in proportion to the edge enhancement coefficient, and the edge is enhanced.
[0095]
Also in this sense, the edge emphasis degree can be changed by the edge emphasis coefficient C.
Therefore, if the number of pixels is large, the edge emphasis coefficient C is increased, and if the number of pixels is small, the edge emphasis coefficient C is decreased. When the width and height of the image are width × height, Eratio is represented by (34).
[0096]
Eratio = min (width, height) / 640 + 1 ... (34)
Then, for the obtained Eratio, the edge emphasis coefficient C was determined as follows.
[0097]
If Eratio <1 C = 1
If 1 ≦ Eratio <3 C = 2
If 3 ≦ Eratio C = 3
That is, if the shorter pixel is less than 640 pixels, the edge enhancement coefficient C is "1". If the shorter edge pixel is greater than 640 and less than 1920 pixels, then the edge enhancement coefficient C is "2". C is "3". In the present embodiment, the edge emphasis coefficient C is set as described above, but the size of the image changes depending on the dot density, so this edge emphasis coefficient may be changed proportionally.
[0098]
The degree of edge enhancement also varies depending on the size of the unsharp mask, so a large unsharp mask may be used if the number of pixels is large, and a small unsharp mask may be used if the number of pixels is small. do it. Of course, it is needless to say that both of the edge enhancement coefficient C and the unsharp mask 40 may be changed, or the edge enhancement degree may be changed by only one of them. Further, as is clear from the figure, the unsharp mask 40 has the largest weight at the central portion, and the numerical value of the weight gradually decreases toward the periphery. The degree of change is not necessarily fixed and can be changed as appropriate.
[0099]
By the way, in the “7 × 7” unsharp mask 40 shown in FIG. 18, the weighting of the outermost squares is “0” or “1”, and “0” has no meaning in the multiplication by weighting. The weighting of “1” has very little weight compared to “632” of the total value of the entire grid. Accordingly, in the present embodiment, instead of the “7 × 7” unsharp mask 40, the “5 × 5” unsharp mask 41 shown in FIG. 19 is used. The unsharp mask 41 shown in the figure omits the outermost periphery of the "7 × 7" unsharp mask 40, and the weighting is the same in the inner "5 × 5" mask portion. As a result, the specific throughput is about half.
[0100]
Furthermore, in the present embodiment, the amount of computation is reduced as follows. In the case of using RGB gradation data, each component value corresponds to the luminance (brightness) of each color component. Therefore, the calculation of the equation (33) must also be performed separately for each gradation data of RGB. However, when multiplication and addition of the number of cells of the unsharp mask 40 are repeated, it is necessary to say that the amount of calculation is large in such individual calculation for each component.
[0101]
On the other hand, it can be said that such edge enhancement can be implemented by maintaining the hue and changing the luminance. Therefore, it can be said that the processing amount is reduced if the luminance is calculated and calculated instead of calculating with respect to each component value of RGB. If the conversion equation of the luminance Y described above is used, the equations (32) and (33) can be rewritten as the equations (35) and (36).
[0102]
[Equation 2]
Figure 2003085546
[0103]
Y "ij = Y ij + C x {Y ij-Y 'ij} (36)
Furthermore, if Y ij -Y 'ij is replaced as in equation (37),
delta = {Yij−Y′ij} × C (37)
The converted R'G'B 'can be calculated as in equation (38).
[0104]
R '= R + delta
G '= G + delta
B '= B + delta (38)
In this way, multiplication and addition become 1⁄3 and, therefore, the overall processing time can be reduced by about 50 to 70%. In addition, the conversion result has no emphasis on color noise, and the image quality has been improved.
[0105]
The process of edge enhancement corresponds to the process of calculating image data (R′G′B ′) after edge enhancement using the unsharp mask 40 for each pixel in matrix-like image data. Steps S406 to S412 represent loop processing in which edge enhancement processing is repeated for each pixel. At step S410 in the loop processing, the target pixel is sequentially moved in the horizontal direction and the vertical direction as shown in FIG. It is repeated until it is determined to be the final pixel.
[0106]
However, the calculation of the equation (32) requires multiplication operations and addition operations by the number of squares of the unsharp mask 40 to be adopted for pixels around the pixel of interest, and the processing amount is large. On the other hand, considering the situation where edge enhancement is required, it is a so-called edge portion of the image, and therefore, it is limited to a place where image data greatly differs between adjacent pixels. From this situation, it can be said that calculation is sufficient if the difference between the image data and the adjacent pixels is large.
[0107]
In order to make this concrete, in step S406, image data is compared between adjacent pixels, and only when the difference is large, the unsharp mask calculation in step S408 is performed. In this way, it is not necessary to calculate the unsharp mask in the image data part that is not most of the edge part, and the processing is drastically reduced.
[0108]
Further, as shown in FIG. 20, eight comparisons are required because there are basically eight pixels around the corresponding target pixel. However, for example, when comparing the pixel of interest at the center of the figure with the pixel of the "5" grid, in fact, if the pixel of interest is the grid of the "5" before that It can be understood that the comparison is made once. Therefore, if it is sufficient that at least the comparison between adjacent pixels is performed only once, it is sufficient to combine the mutually opposing directions “1” and “5”, “2” and “6”, “ With regard to 3 "and" 7 "and" 4 "and" 8 ", either one is sufficient, and comparison is to be made in the four directions of the above combination.
[0109]
As described above, with regard to a natural image having a large number of used colors, the contrast is automatically expanded in the optimum range, and saturation enhancement and edge enhancement are also automatically performed at the optimum enhancement level for the image. Of course, in the case of non-natural images, these are skipped as unnecessary.
[0110]
So far, the type of image data has been determined based on the number of used colors in image processing in the application 21d, and optimal image processing has been performed, but the same optimal processing may be performed according to the type of image also determined in print processing. Is selected.
[0111]
FIG. 21 shows a flowchart corresponding to print processing. After raster data is generated in step S502, the type of image data is determined based on the above-described flag in step S504, and either one of step S506 or step S508 of the color conversion processing prepared in two types is performed. . Thereafter, in step S510, binarization is performed, and in step S512, print data is output.
[0112]
What is performed in step S506 is color conversion processing combining interpolation processing and cache processing, and the procedure is shown in FIG. In the interpolation operation shown in the figure, caching is carried out together with color conversion without carrying out substantial operation processing together with eight-point interpolation operation to carry out operation processing substantially.
[0113]
The principle of the eight-point interpolation operation is shown in FIG. Assuming a cubic body consisting of eight grid points surrounding coordinates P having RGB gradation data as component values in the conversion source color space, the conversion value at the kth vertex of the cube is Dk and the cube is Assuming that the volume of V is V, the transformation value Px at the interior point P of the cube can be interpolated by the following equation from the weight by the ratio of the volumes Vk of eight small rectangular parallelepipeds as shown in the figure divided at the point P.
[0114]
[Equation 3]
Figure 2003085546
[0115]
Therefore, eight grid points surrounding the coordinates are specified, and the operation is performed on each of the CMY tone data at each grid point.
[0116]
By the way, referring to the flowchart shown in FIG. 22, the interpolation processing routine does not necessarily execute this eight-point interpolation operation, but omits the eight-point interpolation operation with reference to a cache table as shown in FIG. To do the caching. This cache table is a table of a fixed capacity for storing CMY tone data obtained when the eight-point interpolation operation is performed using the RGB tone data of the conversion source as a component value. At first, although this table is blank, CMY gradation data obtained immediately after executing the eight-point interpolation operation in step S606 is additionally updated in step S608, and step S506 shown in FIG. 21 is performed. When the processing routine of “cache + interpolation operation” is executed, in the first step S602, the cache table is searched with the gradation data of RGB to be converted as a component value, and a cache hit is found (search can be found In this case, the stored CMY tone data is referred to in step S612.
[0117]
In the color conversion process, since gradation data of RGB is converted to gradation data of CMY for each pixel of the rasterized dot matrix, the process is repeated until the final pixel is obtained in step S610.
[0118]
Although such an interpolation operation has a large amount of operation, since the number of colors used is small when it is not a natural image, one operation result can be used many times. Therefore, when it is determined that the type of image data is not a natural image, the processing of “cache + interpolation operation” can be said to be extremely effective.
[0119]
Next, pre-tone conversion of step S508, which is another color conversion process, will be described.
[0120]
The flowchart of FIG. 25 and the error distribution of the pixels of FIG. 26 are for explaining the outline of the pre-gradation conversion. Since the basic equation of the eight-point interpolation described above requires eight multiplications and seven additions, the burden on resources and time is large both in hardware implementation and software implementation. For this reason, in order to perform color conversion more easily, Japanese Patent Application Laid-Open No. 7-30772 by the present applicant discloses a technique for performing gradation conversion instead of interpolation calculation.
[0121]
The pre-gray scale conversion disclosed in the same publication converts the gray scale data of a pixel so as to match the lattice coordinates by using a method such as so-called error diffusion. The grid coordinates are searched (S702), an error (dg) from the grid coordinates is calculated (S704), and the error (dg) is distributed to neighboring pixels (S706). Therefore, compared with the case of repeating multiplication and addition, the load of operation can be extremely simplified. The reason why the accuracy can be held without performing the interpolation operation is described in detail in the same publication, and therefore will not be described in detail here. Note that since gradation conversion for binarization is performed after color conversion, gradation conversion performed first is called pre-gradation conversion.
[0122]
Even in this pre-gradation conversion, gradation conversion is performed on each pixel of the rasterized dot matrix, so the process is repeated until the final pixel is obtained in step S708.
Then, the color conversion table is referred to by the gradation data of RGB subjected to gradation conversion in the subsequent step S710, but in this case, since it is always a grid point, there is no need to perform interpolation calculation, and reading processing is extremely easy. is there.
[0123]
When the number of colors to be used is extremely large as in the case of a natural image, the probability of a hit also decreases in the above-mentioned "cache + interpolation operation" process, and the number of interpolation operations increases. However, although such pre-gradation conversion must execute processing such as error diffusion for all pixels, the processing amount is generally small because one processing is simple. Therefore, it is possible to reduce the overall processing amount by selecting such color conversion processing by pre-gradation conversion for image data determined to be a natural image with a large number of colors used.
[0124]
In this embodiment, color conversion processing of “cache + interpolation operation” is adopted for non-natural images with a small number of used colors, and color conversion processing with pre-gradation conversion is adopted for natural images with a large number of used colors. However, the present invention is not limited to such a combination, and other combinations may be adopted. That is, the most appropriate color conversion processing may be freely set according to the type of image and may be used automatically.
[0125]
Thus, by totaling the distribution of luminance for each pixel selected by the thinning process on the image data (step S102), it is possible to count the number of colors used (step S104). If the number of colors used is large, it can be determined that the type of image data is a natural image, and, on the basis of the result of such determination, it is preferable to apply to a natural image a contrast enlargement process (step S110). And saturation enhancement processing (step S112) and edge enhancement processing (S114) can be automatically selected, and color conversion by pre-gradation conversion is performed if it is a natural image also in print processing (step S508), if it is not a natural image, color conversion of “cache + interpolation operation” is performed (step S506), and the amount of processing is automatically reduced. It is possible to select a color conversion process.
Brief Description of the Drawings
FIG. 1 is a block diagram of a specific hardware configuration example of an image processing apparatus according to an embodiment of the present invention.
FIG. 2 is a block diagram showing processing performed inside a computer.
FIG. 3 is a schematic block diagram showing a more detailed configuration of the image processing means.
FIG. 4 is a schematic block diagram showing a more detailed configuration of a printer driver.
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 image processing of an application according to the present invention.
FIG. 7 is a diagram showing an image of a conversion source.
FIG. 8 is a diagram showing a sampling cycle.
FIG. 9 is a diagram showing the number of sampling pixels.
FIG. 10 is a diagram showing the relationship between a conversion source image and pixels to be sampled.
FIG. 11 is a diagram showing aggregated luminance distribution and expanded luminance distribution.
FIG. 12 is a flowchart showing contrast enlargement processing prepared as image processing;
FIG. 13 is a diagram showing the moving direction of the pixel of interest.
FIG. 14 is a flowchart illustrating saturation enhancement processing prepared as image processing;
FIG. 15 is a schematic view of the aggregation state of the saturation distribution.
FIG. 16 is a diagram showing the relationship between saturation A and saturation emphasis index S.
FIG. 17 is a flowchart showing edge enhancement processing prepared as image processing;
FIG. 18 is a view showing an unsharp mask.
FIG. 19 is a view showing a modified version of the unsharp mask.
FIG. 20 is a diagram showing a comparison direction with adjacent pixels in image data.
FIG. 21 is a flowchart illustrating a printing process of the printer driver.
FIG. 22 is a flowchart of color conversion processing by cache + interpolation operation;
FIG. 23 is a diagram showing the concept of eight-point interpolation operation.
FIG. 24 is a diagram showing the contents of a cache table.
FIG. 25 is a flowchart of pre-gradation conversion processing;
FIG. 26 is a diagram showing the state of error diffusion of each pixel.
[Description of the code]
DESCRIPTION OF SYMBOLS 10 Image input apparatus 20 Image processing apparatus 21a Operating system 21b Printer driver 21b1 Rasterizer 21b2 Color conversion part 21b3 Gradation conversion part 21c Video driver 21d Application 21d1 Color number detection means 21d2 Image determination means 21d3 ... image processing means 30 ... image output device

JP2002180778A 1996-11-18 2002-06-21 Image processing apparatus, image processing method, and medium on which image processing program is recorded Expired - Fee Related JP3953897B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002180778A JP3953897B2 (en) 1996-11-18 2002-06-21 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP30637196 1996-11-18
JP8-306371 1996-11-18
JP2002180778A JP3953897B2 (en) 1996-11-18 2002-06-21 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP30744097A Division JP3981779B2 (en) 1996-11-18 1997-11-10 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Publications (3)

Publication Number Publication Date
JP2003085546A JP2003085546A (en) 2003-03-20
JP2003085546A5 true JP2003085546A5 (en) 2005-01-20
JP3953897B2 JP3953897B2 (en) 2007-08-08

Family

ID=26564688

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002180778A Expired - Fee Related JP3953897B2 (en) 1996-11-18 2002-06-21 Image processing apparatus, image processing method, and medium on which image processing program is recorded

Country Status (1)

Country Link
JP (1) JP3953897B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7822270B2 (en) * 2005-08-31 2010-10-26 Microsoft Corporation Multimedia color management system
US8274714B2 (en) 2005-11-30 2012-09-25 Microsoft Corporation Quantifiable color calibration
JP5149889B2 (en) * 2009-12-25 2013-02-20 キヤノン株式会社 Imaging apparatus and control method thereof
JP6381311B2 (en) 2013-07-04 2018-08-29 キヤノン株式会社 Image forming apparatus, image forming method, and program

Similar Documents

Publication Publication Date Title
EP0843464B1 (en) Image processing system and image processing method
CN101253760B (en) Image processing apparatus and method thereof
Bala et al. Color-to-grayscale conversion to maintain discriminability
JPH10198802A (en) Image processor, image processing method, and medium recording image processing program
JP4243362B2 (en) Image processing apparatus, image processing method, and recording medium recording image processing program
JP3981779B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP5151708B2 (en) Image processing apparatus and image processing program
JP3953897B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP2003085546A5 (en)
JP4126509B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP2003050999A5 (en)
JP2016103678A (en) Image processing apparatus, image processing method, and program
JP2003050999A (en) Device and method for image processing and medium with recorded image processing program
JP2000295469A (en) Image forming device
JP3698205B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP3646798B2 (en) Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP3596614B2 (en) Image processing apparatus, image processing method, and medium recording image processing program
JP3731573B2 (en) Image processing apparatus, image evaluation apparatus, image processing method, image evaluation method, and recording medium recording image processing program
JP5029779B2 (en) Image processing method, medium storing image processing program, and image processing apparatus
JP2003050997A5 (en)
JP2006024097A (en) Apparatus and method for measuring sharpness, apparatus and method for processing image, sharpness measuring program, image processing program, and storage medium
JP4941575B2 (en) Image processing method, medium storing image processing program, and image processing apparatus
JP2003085552A5 (en)
JP2008065845A (en) Image processor, recording medium recording image processing program and image processing method
JP2009205699A (en) Image evaluation method, medium having image evaluation program recorded thereon, and image evaluation device