JP4359730B2 - Monotone conversion apparatus, monotone conversion method, and medium recording monotone conversion program - Google Patents

Monotone conversion apparatus, monotone conversion method, and medium recording monotone conversion program Download PDF

Info

Publication number
JP4359730B2
JP4359730B2 JP21495099A JP21495099A JP4359730B2 JP 4359730 B2 JP4359730 B2 JP 4359730B2 JP 21495099 A JP21495099 A JP 21495099A JP 21495099 A JP21495099 A JP 21495099A JP 4359730 B2 JP4359730 B2 JP 4359730B2
Authority
JP
Japan
Prior art keywords
luminance
conversion
monotone
color
image data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP21495099A
Other languages
Japanese (ja)
Other versions
JP2000105820A (en
Inventor
直樹 鍬田
至宏 中見
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP21495099A priority Critical patent/JP4359730B2/en
Publication of JP2000105820A publication Critical patent/JP2000105820A/en
Application granted granted Critical
Publication of JP4359730B2 publication Critical patent/JP4359730B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、カラーの画像をモノトーンの画像に変換するモノトーン変換装置、モノトーン変換方法およびモノトーン変換プログラムを記録した媒体に関する。
【0002】
【従来の技術】
近年、デジタルスチルカメラが急速に利用されはじめている。ディジタルスチルカメラで撮影した場合、画像をデータとして管理できるようになり、画像処理などが簡単に行なえる。例えば、カラー画像を白黒であるとかセピア調といったモノトーンの画像に変換できる。
従来、このようなモノトーンへの変換はドットマトリクス状の各画素ごとに輝度を維持したままモノトーン化したデータに置換するだけの処理を行っている。
【0003】
【発明が解決しようとする課題】
上述した従来のモノトーン変換装置においては、モノトーン変換した場合の画像の質についてはあまり問われておらず、その結果、元の輝度分布が悪くてもそのまま変換されてしまうという課題があった。
本発明は、上記課題にかんがみてなされたもので、モノトーン変換する場合であっても画像の質を向上させることが可能なモノトーン変換装置、モノトーン変換方法およびモノトーン変換プログラムを記録した媒体の提供を目的とする。
【0004】
【課題を解決するための手段】
上記目的を達成するため、画像をドットマトリクス状の各画素として表すとともに色分解した所定の要素色で各画素毎に階調表現した画像データを取得する画像取得手段と、この画像データに基づいて各画素の輝度相当値の集計を行なう輝度分布集計手段と、集計された輝度分布に基づいて当該輝度分布を変更する輝度変換の対応関係を導出する輝度対応関係設定手段と、この導出された輝度変換の対応関係に基づいて上記画像データにおける各画素の輝度を変換したモノトーンの画像データを生成する画像データ変換手段とを具備する構成としてもよい。
【0005】
上記構成においては、画像をドットマトリクス状の各画素として表すとともに色分解した所定の要素色で各画素毎に階調表現した画像データを画像取得手段が取得すると、輝度分布集計手段がこの画像データに基づいて各画素の輝度相当値を集計し、輝度対応関係設定手段は集計された輝度分布に基づいて当該輝度分布を変更する輝度変換の対応関係を導出するので、画像データ変換手段はこの導出された輝度変換の対応関係に基づいて上記画像データにおける各画素の輝度を変換したモノトーンの画像データを生成する。
本発明は、画像をドットマトリクス状の各画素として表すとともに色分解した所定の要素色で各画素毎に階調表現した画像データを取得する画像取得手段と、上記画像データに基づいて各画素の輝度相当値の集計を行なう輝度分布集計手段と、輝度相当値を変換することにより輝度分布を変更する輝度変換テーブルを、上記集計された輝度分布に基づいて導出するとともに、輝度相当値を所定の色調のモノトーンを表現する要素色に変換するための要素色毎の変換テーブルを設定し、当該輝度変換テーブルを当該要素色毎の変換テーブルそれぞれに統合することにより要素色毎の統合変換テーブルを生成するテーブル設定手段と、上記要素色毎の統合変換テーブルそれぞれに上記画像データにおける各画素の輝度相当値を入力させ、各統合変換テーブルによる変換結果として各画素の要素色毎の階調値を得ることにより上記所定の色調のモノトーンの画像データを取得する画像データ変換手段とを具備する構成としてある。
【0006】
すなわち、画像を構成する各画素ごとの輝度相当値(輝度あるいは厳密ではないが輝度に相当する値を意味する)についてその分布を求め、この輝度分布に改善される余地があれば輝度変換の対応関係を導出し、これに基づいて各画素の輝度を変換したモノトーンの画像を生成する。より具体的には、ある画素の輝度を適正な輝度としつつ各画素の色がモノトーンとなるように変換する。
画像データのモノトーンへの変換は、各種の分野において利用されている。例えば、ディジタル画像をコンピュータのフォトレタッチソフトなどに入力し、同ソフト上で所望のフィルタ処理を掛ける際に一つの選択肢としてモノトーン変換が用意されている。また、ディジタルスチルカメラ自身にセピア調の撮影というモノトーン変換が用意されていることもある。従って、画像取得手段については、カラー画像データが取得されうるものであればよく、CCDのような具体的な撮像素子であるとか、スキャナのような外部機器であるとか、あるいはデータ回線のように単に画像データを供給するだけのものであるなど、特に限定されるものではない。さらには、画像データが既にメモリ上に展開された状態で用意されている場合でも、同メモリから読み出す時点で画像データを取得することに該当する。
【0007】
ここでいうモノトーンとは必ずしも白黒に限るものではなく、いわゆ単一の着色された表現であってもモノトーンである。モノトーン変換の一例として、上記輝度対応関係設定手段は、輝度相当値での輝度分布の変更を行うための対応関係の設定と、輝度変更後に各要素色間の構成比を所定の割合とする対応関係設定をする構成としてもよい。
【0008】
上記構成においては、輝度相当値での輝度分布の変更を行なった後に各要素色間の構成比を所定の割合としている。すなわち、モノトーン画像データにおける各要素色間の構成比がある所定の割合となっているので、セピア調などの着色されたモノトーン画像データとなる。
ただし、ここでいう各要素色間の構成比が同一である場合、白黒画像データとなる。これは、複数の要素色で白黒を表すにあたっては各成分について一致した階調値を与えるという結果にすぎないからである。
また本発明は、モノトーンの色調を指示する着色指示を外部からの入力に応じて取得する手段を備え、上記テーブル設定手段は、輝度相当値と上記取得された着色指示が示す色のモノトーンを表現する要素色との変換関係を規定した要素色毎の変換テーブルに、上記輝度変換テーブルを統合する構成としてもよい。
【0009】
なお、対応関係を導出する際に、個別に各階調値に対して最適な階調値を求めていくのは煩雑である。従って、上記対応関係を一括して決定するトーンカーブに基づいて変換テーブルを生成し、オリジナルの輝度から修整された輝度へ変換するにあたってこの変換テーブルを利用して変換すればよい。むろん、このトーンカーブは輝度分布に基づく対応関係を表している。例えば、輝度分布を求めた結果が全体として暗い領域に分散しているようであれば、全体として明るい側に移動させることになるが、このときにγカーブのようなあるパラメータによって一義的に定まるカーブをトーンカーブとして利用することとし、このパラメータだけを決めるようにする。これによって階調値の幅に関わらず、トーンカーブによってそれぞれの階調値に対応する変換値が決定されることになる。
なお、トーンカーブとしては、一方向にのみ凹凸を有する場合に限らず、S字型とするなど適宜変更可能である。
【0010】
各要素色間の構成比を所定の割合とするに際しても、その実現手法は様々であり、全階調値にわたって一定の割合にする場合に限られない。その一例として、上記輝度対応関係設定手段は、輝度変更後に各要素色間の構成比を所定の割合とするにあたり、トーンカーブを利用してある輝度値で一定の構成比を実現しつつ全階調値にわたって滑らかに変化させる構成としてもよい。
また本発明は、上記テーブル設定手段は、各要素色間の構成比を上記所定の色調のモノトーンを表現するための割合とする上記要素色毎の変換テーブルとして、ある輝度相当値で一定の構成比を実現しつつ全階調値にわたって変換結果を滑らかに変化させるトーンカーブを利用する構成としている。
【0011】
全階調値にわたって一定比としようとすると、輝度値が「0」に近いときには一定比で実現可能であるものの、階調値が最高値に近いときには一定比を実現するのが困難である。従って、ある輝度値において代表的な構成比を実現しつつ端部側では差異が収束するようなトーンカーブを利用することにより、全階調値にわたって滑らかに変化させて、上記不具合を解消する。
また、モノトーンを生成する手法の一例として、上記輝度対応関係設定手段は、輝度相当値での輝度分布の変更と輝度変更後に各要素色間の構成比を所定の割合とする変換とを一括して行う対応関係を設定する構成としてもよい。
【0012】
最終的に輝度が適正値に修正されつつ各要素色の構成比が所定の割合となるようにするためには、一旦、輝度相対値でのモノトーン変換の対応関係を導出して概念的には白黒で輝度変換しておき、白黒の輝度値が変換された状態で各要素色間の構成比を変化させるというように、二段階のステップを踏むことも可能ではある。しかし、限られた階調値である以上、予め二段階の対応を経た結果を得ておくことにより、二段階の対応関係を一度に実現することも可能となる。
【0013】
このように複数段階の対応関係を設定する一例として、上記輝度対応関係設定手段は、上記個々の対応関係に対応する変換テーブルを生成し、この変換テーブルを統合して統合変換テーブルを生成する構成としてもよい。
予めそれぞれの対応関係を表す変換テーブルを生成しておき、変換元の輝度値を全階調値にわたって変化させながら複数段階に変換テーブルを参照する。そして、その結果を変換元の輝度値に対する変換後の輝度値とすることにより、統合した統合変換テーブルを容易に実現できる。
【0014】
変換テーブルを統合するのは着色する場合に限らない。たとえば、まず、集計された輝度分布から複数の要素に基づいて個々に上記輝度変換の対応関係を導出し、次いで、それぞれの対応関係を順次適応させることになる統合した対応関係を導出する場合には、統合した対応関係を表す変換テーブルを生成する。例えば、コントラストを改善する対応関係と、明るさを改善する対応関係とは排他的なものではなく、両方の対応関係を実現するために統合した対応関係を導出する。
【0015】
この場合、最初に個々の対応関係に対応する変換テーブルを生成し、次いでこの変換テーブルを統合して統合変換テーブルを生成する。すなわち、ある変換テーブルで参照される値を利用して次の変換テーブルを参照し、その参照した値を最初の値に対応させるという具合である。むろん、参照されるべき変換テーブルは二つに限られるものではなく、任意の数の変換テーブルを統合可能である。
ところで、カラーの画像データについて各画素の輝度を求める場合、厳密な意味の輝度を求めるのは困難な場合が多い。すなわち、画像データが採用する座標系が単体の輝度のパラメータを採用していない場合は座標系を変換しなければならないが、厳密には各座標系の間に線形の対応関係がないことが多い。この場合、演算で対応関係を求めようとすれば演算量が多くなるし、対応関係を予め導出しておいた変換テーブルを利用しようとすれば再現可能な色の数によっては極めて多大なテーブルになってしまう。
【0016】
しかしながら、利用するのは輝度分布の集計結果であって必ずしも厳密な輝度である必要はない。このため、上記輝度分布集計手段が厳密な輝度の変換を行うのではなく、比較的簡易な処理で済ますことができるように各要素色の階調値から線形変換によって輝度を導出し、分布を求めるようにしてもよい。なお、ここでいう線形変換は広義に解釈することができる。例えば、テーブルを参照しなければ導出できないものであるとか、非線形演算で高負荷な演算処理を行わなければならない場合などを除き、簡略化した演算で求めることができればよい。
【0017】
また、輝度分布を求めた上でこれを改善させる段階を踏むことに意義があるのであり、改善させる具体的なポイントは特に限定されるものではない。ただ、その一例として、上記テーブル設定手段は、上記輝度分布に基づいて導かれる最大輝度から最小輝度までの範囲をコントラストの幅としつつ、当該コントラストの幅を適正な幅となるようにオリジナルの輝度から修整された輝度へ変換する輝度変換テーブルを導出する構成としてある。
【0018】
上記構成においては、輝度分布に基づいて導かれる最大輝度から最小輝度までの範囲をコントラストの幅とみなしている。この最大輝度から最小輝度までの範囲が狭い場合、利用可能なコントラストの幅を有効に利用していない。このため、コントラストの幅を拡大するような対応関係を導出することにより、オリジナルの輝度から修整された輝度へ変換させるとコントラストの幅が広くなる。なお、理論的にはこの逆もあり得る。
【0019】
また、他の一例として、上記テーブル設定手段は、上記輝度分布に基づいて導かれる画像の明るさが適正範囲にない場合に同輝度分布が全体として適正な分布となるようにオリジナルの輝度から修整された輝度へ変換する輝度変換テーブルを導出する構成としてある。
上記構成においては、上記輝度分布から画像の明るさを判断する。すなわち、輝度の分布が明るい領域に集中していれば明るすぎると判断できるし、暗い領域に集中していれば暗すぎると判断できる。従って、できるだけ偏りのないようにすることで、画像の明るさは調整可能であり、そのために輝度分布が全体として適正な分布となるような対応関係を導出している。例えば、度数分布における山が暗い領域に偏っていればこの山を全階調の中央あたりに移動させたり、逆に同山が明るい領域に偏っていればこの山を同様に全階調の中央あたりに移動させたりする対応関係を導出する。
【0020】
このように、輝度分布が改善される余地があれば輝度変換の対応関係を導出して輝度を変換する手法は必ずしも実体のある装置に限られる必要はなく、その方法としても機能することは容易に理解できる。すなわち、必ずしも実体のある装置に限らず、その方法としても有効であることに相違はない。
また、このようなモノトーン変換装置は単独で存在する場合もあるし、ある機器に組み込まれた状態で利用されることもあるなど、発明の思想としてはこれに限らず、各種の態様を含むものである。従って、ソフトウェアであったりハードウェアであったりするなど、適宜、変更可能である。
【0021】
発明の思想の具現化例としてモノトーン変換装置のソフトウェアとなる場合には、かかるソフトウェアを記録した記録媒体上においても当然に存在し、利用されるといわざるをえない。
むろん、その記録媒体は、磁気記録媒体であってもよいし光磁気記録媒体であってもよいし、今後開発されるいかなる記録媒体においても全く同様に考えることができる。また、一次複製品、二次複製品などの複製段階については全く問う余地無く同等である。その他、供給方法として通信回線を利用して行なう場合でも本発明が利用されていることにはかわりない。
【0022】
さらに、一部がソフトウェアであって、一部がハードウェアで実現されている場合においても発明の思想において全く異なるものではなく、一部を記録媒体上に記憶しておいて必要に応じて適宜読み込まれるような形態のものとしてあってもよい。また、本発明は、当該プログラム自体において実現されていることはいうまでもない。
【0023】
【発明の効果】
以上説明したように本発明は、最適な輝度分布となるように各画素の輝度を調整するため、良好な画質のモノトーン画像を生成することが可能なモノトーン変換装置を提供することができる。
【0024】
また、発明によれば、最適な輝度分布としつつ、所定の構成比となるように各要素色を求めることができ、白黒を含めて所望の色のモノトーン変換を実現できる。
さらに、発明によれば、構成比の変化をトーンカーブで実現するため、比較的容易に各要素色の値を求めることができる。
さらに、発明によれば、複数の段階の変換を一括して実現するので、処理を高速化できる。
【0025】
さらに、発明によれば、変換テーブルを利用して簡易に統合した対応関係を実現することができる。
さらに、発明によれば、コントラストの幅が適正となったモノトーン画像を生成することができる。
さらに、発明によれば、明るさを適正範囲とした、すなわち明るすぎたり暗すぎたりすることのない適度な輝度としたモノトーン画像を生成することができる。
【0026】
さらに、発明によれば、同様の効果を奏するモノトーン変換方法およびモノトーン変換プログラムを記録した媒体を提供できる。
【0027】
【発明の実施の形態】
以下、図面にもとづいて本発明の実施形態を説明する。
図1は本発明の一実施形態にかかるモノトーン変換装置をクレーム対応概略構成図により示しており、図2は同モノトーン変換装置を実現するハードウェアの一例であるコンピュータシステム10をブロック図により示している。まず、このコンピュータシステム10について説明する。
【0028】
本コンピュータシステム10は、画像データを直接的に入力する画像入力デバイスとして、スキャナ11aとデジタルスチルカメラ11bとビデオカメラ11cとを備えており、これらはコンピュータ本体12に接続されている。それぞれの入力デバイスは画像をドットマトリクス状の画素で表現した画像データを生成してコンピュータ本体12に出力可能となっており、ここで同画像データはRGBの三原色においてそれぞれ256階調表示することにより、約1670万色を表現可能となっている。なお、画像データのフォーマットは各種のものが利用されており、圧縮されたJPEG形式のものであったり、非圧縮のBMP形式のものなどがある。
【0029】
コンピュータ本体12には、外部補助記憶装置としてのフロッピーディスクドライブ13aとハードディスク13bとCD−ROMドライブ13cとが接続されており、ハードディスク13bにはシステム関連の主要プログラムが記録されており、フロッピーディスクやCD−ROMなどから適宜必要なプログラムなどを読み込み、同ハードディスク13b上に記録可能となっている。
また、コンピュータ本体12を外部のネットワークなどに接続するための通信デバイスとしてモデム14aが接続されており、外部のネットワークに同公衆通信回線を介して接続し、ソフトウェアやデータをダウンロードして導入可能となっている。この例ではモデム14aにて電話回線を介して外部にアクセスするようにしているが、LANアダプタを介してネットワークに対してアクセスする構成とすることも可能である。
【0030】
ここで、外部補助記憶装置のうち、フロッピーディスクドライブ13aやCD−ROMドライブ13cについては、記録媒体自身が交換可能であり、この記録媒体に画像データが記録された状態で供給されることにより、画像入力デバイスの一手段ともなりうる。また、モデム14aやLANアダプタを介してネットワークにアクセスした場合、このネットワークから画像データが供給されることもあり、このような場合も画像入力デバイスの一手段となりうる。
【0031】
この他、コンピュータ本体12の操作用にキーボード15aやポインティングデバイスとしてのマウス15bも接続され、さらに、マルチメディア対応のためにスピーカ18aやマイク18bを備えている。
さらに、画像出力デバイスとして、ディスプレイ17aとカラープリンタ17bとを備えている。ディスプレイ17aについては水平方向に800画素と垂直方向に600画素の表示エリアを備えており、各画素毎に上述した1670万色の表示が可能となっている。むろん、この解像度は一例に過ぎず、640×480画素であったり、1024×768画素であるなど、適宜、変更可能である。
【0032】
また、印刷装置としてのカラープリンタ17bはインクジェットプリンタであり、CMYKの四色の色インクを用いて記録媒体たる印刷用紙上にドットを付して画像を印刷可能となっている。画像密度は360×360dpiや720×720dpiといった高密度印刷が可能となっているが、階調表限については色インクを付すか否かといった2階調表現となっている。色インクについては、かかる四色のものに限らず、色の薄いライトシアンやライトマゼンタを加えた六色によってドットの目立ちを低減させることも可能であるし、インクジェット方式に限らずカラートナーを利用した静電写真方式などを採用することも可能である。
【0033】
一方、このような画像入力デバイスを使用して画像を入力しつつ、画像出力デバイスに表示あるいは出力するため、コンピュータ本体12内では所定のプログラムが実行されることになる。そのうち、基本プログラムとして稼働しているのはオペレーティングシステム(OS)12aであり、このオペレーティングシステム12aにはディスプレイ17aでの表示を行わせるディスプレイドライバ(DSP DRV)12bとカラープリンタ17bに印刷出力を行わせるプリンタドライバ(PRT DRV)12cが組み込まれている。これらのドライバ12b,12cの類はディスプレイ17aやカラープリンタ17bの機種に依存しており、それぞれの機種に応じてオペレーティングシステム12aに対して追加変更可能である。また、機種に依存して標準処理以上の付加機能を実現することもできるようになっている。すなわち、オペレーティングシステム12aという標準システム上で共通化した処理体系を維持しつつ、許容される範囲内での各種の追加的処理を実現できる。
【0034】
むろん、このようなプログラムを実行する前提として、コンピュータ本体12内にはCPU12eとRAM12fとROM12gとI/O12hなどが備えられており、演算処理を実行するCPU12eがRAM12fを一時的なワークエリアや設定記憶領域として使用したりプログラム領域として使用しながら、ROM12gに書き込まれた基本プログラムを適宜実行し、I/O12hを介して接続されている外部機器及び内部機器などを制御している。
【0035】
この基本プログラムとしてのオペレーティングシステム12a上でアプリケーション12dが実行される。アプリケーション12dの処理内容は様々であり、操作デバイスとしてのキーボード15aやマウス15bの操作を監視し、操作された場合には各種の外部機器を適切に制御して対応する演算処理などを実行し、さらには、処理結果をディスプレイ17aに表示したり、カラープリンタ17bに出力したりすることになる。
【0036】
かかるコンピュータシステム10では、画像入力デバイスであるスキャナ11aなどで写真などを読み取って画像データを取得することができる他、デジタルスチルカメラ11bで撮影した画像データを取得したり、ビデオカメラ11cで撮影した動画としての画像データを取得することができる。また、予め撮影された各種の画像データがCD−ROMソフトとして提供されることも多々ある。
近年、このような画像データはカラーであることがほぼ当然となっているが、表現を楽しむという意味で敢えてモノトーン化してみることが少なくない。従来は、印刷装置が黒インクだけを利用した白黒印刷しかでしかなかったので、当然のようにモノトーン化する処理を行っていたが、カラープリンタ17bの再現性が良好となるにつれて白黒あるいはセピア調のような着色されたモノトーン画像の印刷を行うことも多々ある。
【0037】
このようなコンピュータシステム10では、デジタルスチルカメラ11bなどで撮影した画像データを、コンピュータ本体12にて取り込み、必要な画像処理を経て、カラープリンタ17bで印刷することができる。この場合、コンピュータ本体12にて所定のアプリケーション12dを起動し、印刷対象として直接にデジタルスチルカメラ11bで撮影した画像データを取り込んだり、既にハードディスク13bなど外部記憶装置に保管してある画像データを取り込むことができる。従って、かかる処理が図1に示す画像取得手段A1を構成することになる。
【0038】
一方、アプリケーション12bはこの画像データをそのままプリンタドライバ12cに出力して印刷させることも可能であるが、このアプリケーション12bによって画像処理を実行することも可能である。本発明においては、画像データの輝度相当値(本実施形態においては厳密な意味での輝度を扱うのではなく、輝度と同等といえる輝度相当値をもって輝度として扱っている)について統計処理し、画像の特徴を把握する。この際、画像を通常どおりにモノトーン化するだけでは良好な画質と言えないならば、把握した特徴に基づいて画像データの輝度を修正するための方針を決定する。従って、このような処理が輝度分布集計手段A2や輝度対応関係設定手段A3を構成する。
【0039】
むろんこのようにして修正する方針を決定した場合には、かかる基準に基づいて画像データを修整し、その後にプリンタドライバ12cに出力して印刷させることになる。従って、この修整処理が画像データ変換手段A4を構成することになる。
すなわち、図1に示す画像取得手段A1は要素色ごとに階調値のデータを持つ画像データを取得する処理を実現する。この画像データに基づいて画像取得手段A1は簡易的に輝度相当値yを算出して輝度分布集計手段A2に集計させる。輝度分布集計手段A2では輝度分布の傾向を知ることができるようにするために輝度相当値の度数分布DBを集計する。むろん、度数分布以外の集計を実現することも可能であるが、ここでは処理の簡易さからも度数分布DBを選択している。
【0040】
輝度対応関係設定手段A3は度数分布DBに基づいてモノトーンで表したときに最適な画像が得られるような輝度の対応関係を設定するが、内部的には多段階の処理を行っている。まず、輝度分布幅検出手段A31は度数分布DBにおける分布の最大輝度Ymaxと最小輝度Ymin、およびこれらに基づく輝度分布の幅Ydifを求める。そして、これらを利用して分布幅改善LUT作成手段A32が輝度分布の幅を改善させる対応関係を示す変換テーブルLUT1を生成する。一方、度数分布DBは明暗決定手段A33でも参照され、当該画像の明暗を表す代表値として分布の中央値Ymedを求め、さらに明暗改善LUT作成手段A34は画像の明るさを改善させる対応関係を示す変換テーブルLUT2を生成する。
【0041】
分布幅改善LUT作成手段A32と明暗改善LUT作成手段A34はそれぞれ個別の観点で輝度分布を改善させる対応関係を生成している。むろん、それぞれ個別に改善させることもできるが、変換テーブルを利用した改善は容易に統合できるので、LUT統合手段A35がこれらを統合した統合変換テーブルLUT3を生成する。
このLUT3はあくまでも輝度相当値yを改善させることができるが、モノトーン変換ではセピア調のように着色されたものが好まれるし、たとえ白黒であっても要素色の階調値で表さなければならないことに変わりはない。従って、各色成分用LUT作成手段A36は輝度相当値yから各要素色の階調値へとダイレクトに変換させることになる変換テーブルLUT4R, LUT4G, LUT4Bを生成する。
【0042】
画像データ変換手段A4は、元の画像データRGBに基づいて輝度相当値yを得るか、画像取得手段A1が生成した輝度相当値yに基づいてこのLUT4R,LUT4G, LUT4Bを参照し、参照結果を変換済みの画像データR’,G’,B’として出力する。むろん、このLUT4R, LUT4G, LUT4Bはコントラストと明るさという二つの輝度分布の改善とともに着色の要素も含んでおり、これらが一括で変換された結果を得ることができる。
【0043】
では、以下にコンピュータシステム10が主にソフトウェアを利用してこれらを実現する具体的な処理についてより詳細に説明する。なお、このようなソフトウェアは、ハードディスク13bに記憶されており、コンピュータ本体12にて読み込まれて稼働する。また、導入時にはCD−ROM13c−1であるとかフロッピーディスク13a−1などの媒体に記録されてインストールされる。従って、これらの媒体はモノトーン変換プログラムを記録した媒体を構成する。また、これらの時系列的な処理はモノトーン変換方法を構成することはいうまでもない。
【0044】
本実施形態においては、モノトーン変換装置をコンピュータシステム10として実現しているが、必ずしもかかるコンピュータシステムを必要とするわけではなく、画像データを扱うとともにモノトーン画像を生成するシステムであればよい。例えば、図3に示すようにデジタルスチルカメラ11b1がモノトーン画像を生成する機能を備えており、モノトーン化した画像をディスプレイ17a1で表示したり、プリンタ17b1で印刷させるような構成とする場合にも適用可能である。
【0045】
また、図4に示すように、コンピュータシステムを介することなくプリンタ17b2を接続し、スキャナ11a2やデジタルスチルカメラ11b2あるいはモデム14a2等を介して入力されるカラーの画像データをモノトーン化して印刷する構成とすることもできる。このようなプリンタ17b2は、近年、ビデオプリンタとして家庭用テレビやビデオに接続して一場面をハードコピー化するのに使用されることも多い。この場合にカラーのまま印刷するのではなく、セピア調などにモノトーン化する機能を採用しつつ本発明を適用することが可能である。
【0046】
図5は上記モノトーン変換装置における主となる画像処理ソフトの制御内容をブロック化して表している。
ステップ110では画像データを入力する。画像データはオペレーティングシステム12aを介して読み込み、所定のワークエリアに保存する。画像データ自体は一つのファイルであり、図6に示すように先頭部分に画像のサイズであるとか色数などのプロファイルデータを備えるとともに、その後には個々の画素についてRGB256階調で表現するべく3バイトのエリアが画素数分だけ確保されている。なお、画像データは画像入力デバイスから読み込むようにしてもよいし、既に画像データファイルとしてハードディスク13bなどに保存されているものを読み込むようにしてもよい。
【0047】
画像データをワークエリアに読み込んだら、ステップ120〜ステップ140にて図7に示すようにして対象画素を移動させつつ同対象画素の画像データについて加工を行って輝度についての集計処理を行う。集計処理の内容は様々であるが、本実施形態においては「コントラスト」と「明度」の特徴量を得るための集計処理を行う。そして、全画素について集計処理を終えたら、ステップ150で集計結果に基づいて特徴量を分析しつつ、輝度分布を適正化するための改善手法を設定する。以下、これらの集計を中心に説明する。この特徴量を分析して輝度対応関係を設定するフローチャートを図8に示している。
【0048】
コントラストは画像全体としての輝度の幅を示し、コントラストが適切でないと感じる場合、コントラストの幅を広げたいという要望が主である。ある画像の各画素における輝度相当値の分布をヒストグラムとして集計したものを図9(a)で実線にて示している。実線に示す分布を取る場合、明るい画素の輝度と暗い画素の輝度との差が少ないが、輝度の分布が一点鎖線に示すように広がれば明るい画素の輝度と暗い画素の輝度との差が大きくなり、コントラストの幅が広がることになる。ここで、図9(b)はコントラストを拡大するための輝度変換を示している。変換元の輝度yと変換後の輝度Yとの間において、
Y=ay+b
なる関係で変換させるとすると、変換元の最大輝度Ymaxと最小輝度Yminの画素の差はa>1の場合において変換後において大きくなり、図9(a)に示すように輝度の分布が広がることになる。従って、このようなヒストグラムを作成するために輝度の最大値から輝度の最小値までの間隔をコントラストの幅として集計処理することが必要である。ただし、この場合はあくまでも輝度の変換であり、画像データが輝度を要素として備えていれば直接に集計が可能であるが、上述したように画像データはRGB256階調で表現されてているので、直接には輝度の値を持っていない。輝度を求めるためにLuv表色空間に色変換する必要があるが、演算量などの問題から得策ではないため、テレビジョンなどの場合に利用されているRGBから輝度を直に求める次式の変換式を利用する。
y=0.30R+0.59G+0.11B
また、このように輝度を厳密に求める必要はないので、
y=(R+G+B)/3
としてもよいし、さらには、各成分の重みの相違からG成分だけを概略値とすることも可能であり、
y=G
としてもよい。むろん、このように輝度を概略的に求めたものが現実の輝度相当値であり、簡略化した演算を利用すれば演算処理負荷が減り、高速化を図れる。ステップ120〜ステップ140では、対象画素を移動させながら各画素の画像データである3バイトを読み込み、同式に基づいて輝度yを演算する。この場合、輝度yも256階調であらわすものとし、演算された輝度yに対する度数を1つずつ加えていくことになる。
すなわち、ステップ120では画像を走査して処理していくために対象画素を示すポインタを初期位置へセットし、ステップ140にて全画素が終了したと判断されるまでステップ135にてポインタを移動させながらループ処理を繰り返す。また、各画素ごとに実行するのはステップ125で行なう注目画素の輝度相当値の算出と、ステップ130にて行なう度数分布の更新である。全画素についてその輝度相当値(Y)を算出しつつ、同輝度相当値の画素数を表す変数DB(Y)を「1」ずつ加算していくので、全画素について終了するときには輝度相当値の度数分布(ヒストグラム)が得られる。
【0049】
なお、着色する必要のない白黒への変換はこの輝度を利用すればよく、求められた輝度の階調値にRGBの各成分値を一致させることで実現する。
このようにして輝度分布のヒストグラムを得るステップ120〜ステップ140が輝度分布集計処理であり、このヒストグラムに基づいて図8に示すフローチャートで特徴量を分析しつつ輝度対応関係を設定する。
まず、ステップ210では輝度分布の両端を求める。写真画像の輝度分布は図10(a)に示すように概ね山形に表れる。むろん、その位置、形状についてはさまざまである。輝度分布の幅はこの両端をどこに決めるかによって決定されるが、単に裾野が延びて分布数が「0」となる点を両端とすることはできない。裾野部分では分布数が「0」付近で変移する場合があるし、統計的に見れば限りなく「0」に近づきながら推移していくからである。
【0050】
このため、分布範囲において最も輝度の大きい側と小さい側からある分布割合だけ内側に寄った部分を分布の両端とする。本実施形態においては、同図に示すように、この分布割合を0.5%に設定している。むろん、この割合については、適宜、変更することが可能である。このように、ある分布割合だけ上端と下端をカットすることにより、ノイズなどに起因して生じている白点や黒点を無視することもできる。すなわち、このような処理をしなければ一点でも白点や黒点があればそれが輝度分布の両端となってしまうので、255階調の輝度値であれば、多くの場合において最下端は階調「0」であるし、最上端は階調「255」となってしまうが、上端部分から0.5%の画素数だけ内側に入った部分を端部とすることにより、このようなことが無くなる。そして、実際に得られたヒストグラムに基づいて画素数に対する0.5%を演算し、再現可能な輝度分布における上端の輝度値と下端の輝度値から順番に内側に向かいながらそれぞれの分布数を累積し、0.5%の値となった輝度値が最大輝度Ymaxと最小輝度Yminとなる。
【0051】
輝度分布の幅Ydifは最大輝度Ymaxと最小輝度Yminの差であり、
Ydif=Ymax−Ymin
となる。
一方、輝度分布の幅Ydifは画像データに基づいて分析された特徴量であり、ステップ215の処理ではこの特徴量に基づいて輝度対応関係を設定するために改善パラメータを導出する。輝度分布の幅Ydifに基づいてコントラストを拡大する画像処理としては、輝度の分布に応じて傾きaとオフセットbを決定すればよい。例えば、
a=255/(Ymax−Ymin)
b=−a・Yminあるいは255−a・Ymax
とおくとすると、せまい幅を持った輝度分布を再現可能な範囲まで広げることができる。ただし、再現可能な範囲を最大限に利用して輝度分布の拡大を図った場合、ハイライト部分が白く抜けてしまったり、ハイシャドウ部分が黒くつぶれてしまうことが起こる。これを防止するには再現可能な範囲の上端と下端に拡大しない範囲として輝度値で「5」ぐらいを残すようにすればよい。この結果、変換式のパラメータは次式のようになる。
a=245/(Ymax−Ymin)
b=5−a・Yminあるいは250−a・Ymax
そして、この場合にはY<Yminと、Y>Ymaxの範囲においては変換を行わないようにするとよい。
【0052】
また、このように変換するにあたって、毎回計算する必要はない。輝度の範囲が「0」〜「255」という値をとるとすれば、各輝度値について予め変換結果を予めておき、図10(b)に示すように変換テーブルを形成しておく。この変換テーブルは分布幅改善トーンカーブと実質的に同義であり、ステップ220にて当該変換テーブルを形成している。なお、ここで作成される変換テーブルをLUT1と呼ぶ。
【0053】
単純に白黒のモノトーン画像を得るのであれば、この変換テーブルの変換結果Yを使用し、変換前の画像データ(R0,G0,B0 )について変換後の画像データ(Y1,Y1,Y1 )とすればよい。
すなわち、ステップ150において、特徴量を分析する作業は上述した最大輝度Ymaxと最小輝度Yminを求める処理が該当し、輝度対応関係を設定する作業はこれらから輝度分布の幅Ydifを求めつつ変換式のパラメータa,bを求めて変換テーブルを作成する処理が該当する。そして、もし対応関係の設定処理がこれだけであるならば、ステップ160の画像データ変換処理ではこのような変換テーブルを指定して変換前の画像データ(R0,G0,B0 )から変換後の画像データ(R1(=Y1),G1(=Y1),B1(=Y1))を生成させることになる。
【0054】
また、ステップ210の輝度分布幅検出処理は図1に示す輝度分布幅検出手段A31に相当するし、ステップ215の分布幅改善パラメータ導出処理とステップ220の分布幅改善変換テーブル作成処理は同図に示す分布幅改善LUT作成手段A32に相当する。
次に、明度について説明する。ここでいう画像の特徴量としての明度は画像全体の明暗の指標を意味しており、上述したヒストグラムから求められる分布の中央値(メジアン)Ymedを使用する。従って、この場合における集計処理は先ほどと同様にコントラストのための集計処理と同時に行われる。
【0055】
一方、特徴量を分析する際には明度の理想値であるYmed_targetとの差(Ymed_target−Ymed)を算出すればよい。なお、理想値Ymed_targetの実際の値は「106」を使用するが、固定的なものではない。また、好みを反映して変更できるようにしても良い。むろん、このようにして明度の理想値であるYmed_targetとの差(Ymed_target−Ymed)を算出する処理がステップ225の明暗検出処理に該当する。
【0056】
この特徴量(Ymed_target−Ymed)を利用して明度についての輝度対応関係を設定する場合は次のようにする。中央値Ymedが理想値Ymed_targetと比較して大きいか小さいかで画像が明るいか否かを評価できる。例えば、中央値Ymedが「85」であるとすれば理想値Ymed_targetの「106」よりも小さいので、第一次的に「暗い」と評価されるし、第二次的に暗さの程度は「106−85」と数値的に表現される。
【0057】
図11(a)は輝度のヒストグラムを示しているが、実線で示すように輝度分布の山が全体的に暗い側に寄っている場合には波線で示すように全体的に明るい側に山を移動させると良いし、逆に、図11(b)にて実線で示すように輝度分布の山が全体的に明るい側に寄っている場合には波線で示すように全体的に暗い側に山を移動させると良い。このような場合には図9(b)に示すような直線的な輝度の変換を施すのではなく、図11(c)に示すようないわゆるγ曲線を利用した輝度の変換を行えばよい。
【0058】
このように輝度分布の山を移動させる必要があるということが画像の明るさが適正範囲にない場合に相当するのであり、同輝度分布の山を移動させて全体として適正な分布となるような対応関係を導出することになる。
γ曲線による補正ではγ<1において全体的に明るくなるし、γ>1において全体的に暗くなる。上の例では中央値Ymedが「21」上がれば理想値Ymed_targetと一致することになるが、γ曲線を利用して正確に「21」上げるというのは容易ではない。このため、図12に示すように評価値である(Ymed_target−Ymed)について「5」刻み毎に対応するγの値を設定しておけばよい。この例では評価値の変動量「5」に対応してγの値を「0.05」ずつ変動させているが、両者の対応関係を適宜変更可能であることはいうまでもない。
【0059】
また、コントラストの修正の場合と同様に自動的にγの値を設定することも可能である。例えば、
γ=Ymed/106
あるいは、
γ=(Ymed/106)**(1/2)
としてγの値を求めるようにしてもよい。むろん、γ曲線による輝度の変換についても図11(b)に示すような変換テーブルを形成しておく。ここでは、上記評価値に基づいて図12に示すテーブルからγを求める処理や、上述した算出式にてγを求める処理がステップ230の明暗改善パラメータ導出処理に該当し、さらにステップ235における明暗改善変換テーブル作成処理は同γを利用してあらかじめ輝度「0」〜「255」の範囲で変換値を求めた変換テーブルを作成する処理が該当する。なお、この明暗改善変換テーブル作成処理で最終的に作成される変換テーブルをLUT2と呼ぶことにする。
【0060】
すなわち、特徴量を分析する作業は中央値Ymedあるいは評価値(Ymed_target−Ymed)などを求める作業が該当するし、輝度対応関係の設定処理ではこれからγ補正値を求めつつ変換テーブルを作成する処理が該当する。そして、輝度対応関係がこれだけならばステップ160の画像データ変換処理ではこのような変換テーブルを指定して各画素の変換前の画像データ(R0,G0,B0 )から変換後の画像データ(R1,G1,B1 )を生成させることになる。
【0061】
なお、ステップ225の明暗検出処理は図1に示す明暗決定手段A33に相当するし、ステップ230の明暗改善パラメータ導出処理とステップ235の明暗改善変換テーブル作成処理は同図に示す明暗改善LUT作成手段A34に相当する。
ところで、本実施形態においては以上のようにして二つの変換テーブルを作成している。実際の画像データの変換時に二つの変換テーブルで順次変換するのは作業的に無駄が多い。このため、ステップ240では二つの変換テーブルを統合する処理を行う。このLUT統合処理についての詳細なフローチャートを図13に示している。上述した二つの変換テーブルLUT1,LUT2は、いずれも「0」〜「255」の階調範囲となっている。このため、全階調範囲にわたり、LUT1で変換した後、さらにLUT2で変換した値をもって統合した変換テーブルLUT3の変換値とすればよい。まず、ステップ310でポインタの変数iを「0」クリアしておき、ステップ330のインクリメント処理とステップ335のループエンド判断処理によってi=0〜255のループを実行する。
【0062】
ループ内では、まずステップ315にて階調値iに対するLUT1の変換値を変数i1に保存し、ステップ320ではこの変換値i1に対するLUT2の変換値を変数i2に保存する。この変換値i2が二つの変換テーブルを参照した結果であるので、ステップ325では新たな変換テーブルLUT3における階調値iに対する変換値として設定する。なお、変換テーブルLUT1,LUT2が統合される過程を図14に示している。このようにすれば、いくつもの輝度対応関係があるにしてもそれらをすべて実行したことに相当する変換テーブルを簡易に作成することができる。むろん、かかるLUT統合処理が図1に示すLUT統合手段A35に該当する。
【0063】
ところで、この場合は個々の変換テーブルLUT1,LUT2が中間値を表すにすぎないので、階調範囲を本来の階調範囲に一致させる必要はなく、より詳細な階調範囲にしておくこともできる。例えば、中間段階では768階調にしておき、統合した変換テーブルにおいて256階調にするようにしておけば、複数の変換テーブルを経る間に誤差が徐々に大きくなっていってしまうということを防止できる。
【0064】
なお、輝度対応関係を設定する際に、図11(c)に示すものではγ曲線を利用したし、図9(b)に示すものでは一定の傾きaとオフセットbを有する直線を利用した。これらは、いずれについても1つまたは2つのパラメータを使用して広い範囲で階調値の対応関係を決定することができる意味で、広義のトーンカーブに含まれるといえる。
また、モノトーン画像といっても必ずしも白黒である必要はなく、有色のモノトーン画像も好まれる。このため、LUTが統合されたら、ステップ245にて各色成分用LUTの作成処理を実行する。図15はその詳細なフローチャートである。
【0065】
一般的に、モノトーンの代表色(一番彩度が高いRGBの組み)を(Rs,Gs,Bs)として、これに対応する輝度値をysとするとともに変換後の輝度値をY1 としたときに、変換後のRGBの値(R1,G1,B1 )は、
R1=Y1*Rs/ys
G1=Y1*Gs/ys
B1=Y1*Bs/ys
とすることができる。図16(a)はこのようにして有色のモノトーンの成分比が一定となる関係をグラフで示している。このグラフは、横軸が変換元の輝度値yを示し、縦軸が変換後の各色の階調値(各色の輝度値といえる)を示している。上述したように、一番彩度が高くなるときの輝度値をysに対してはRGBの組みが(Rs,Gs,Bs)となっており、このときのRGBの各階調値の比が輝度値yに関わらず一定に保持される。
【0066】
上の演算式によれば、G成分についても演算することになるが、G成分の輝度への影響度を考慮すればG成分として輝度値ysをそのまま代入し、R成分とB成分については輝度値がysの場合におけるG成分との差Δ1,Δ2を利用して輝度値ysから演算するようにしても良い。すなわち、
R1=Y1*(1+Δ1*(Y1/ys))
G1=ys
B1=Y1*(1−Δ2*(Y1/ys))
むろん、既に変換テーブルLUT3が作成されているため、Y1 を全階調範囲にわたって変化させたときのRGBの値(R1,G1,B1 )を変換テーブルの値として用意しておけばよい。
【0067】
この例では、各要素色の構成比(R:G:B)を必ず一定にするようにしているが、例えば、この色が最も良く現れる輝度値(ys)において各要素色の構成分(R1,G1,B1)が上記構成比(R:G:B)と一致するようにしつつ(Δ1=R−G、Δ2=G−B)、それ以外の領域では暗くなったり明るくなったりするにつれて各構成分が徐々に一致するようにすることもできる。この対応関係を図16(b)に示している。
【0068】
このグラフでは、前述したγカーブを利用した変換態様を示している。すなわち、輝度値ysにおけるRGBの組みが(Rs,Gs,Bs)となるようなγ値を算出し、そのγ値を利用してY1 を全階調範囲にわたって変化させたときのRGBの値(R1,G1,B1 )を求めて変換テーブルの値とするのである。このグラフの場合では、Rs>Gs>Bsという関係があるから、少なくともRs>Y1であり、Y1>Bsとなっている。従って、R成分について言えばγ<1となる下に凸の曲線となり、B成分について言えばγ>1となる上に凸の曲線となる。G成分について言えば厳密にはγは1以上にも1未満にもなりうるが、グラフでは簡素化してγ=1のように表している。ただ、この場合も上述したようにG成分を基準としてR成分とB成分についてのみ変換用のトーンカーブを用意することも可能である。
【0069】
むろん、このようにすると輝度値が低いときと輝度値が高いときでは上記構成比(R:G:B)と一致しない。しかしながら、輝度値が最大値になるあたりでは上記構成比を維持することができないのであるし、輝度値が低いときと輝度値が高いときは実際には黒または白となるのであってこのグラフのように輝度値ysに収束する変化態様の方が自然でもある。
輝度対応関係設定処理においては、着色するか否かに関わらず、ステップ245にて着色用LUT統合処理を実施する。図15に示すように、この着色用LUT統合処理の最初のステップ410にて着色指示パラメータCLを取得する。着色指示パラメータCLは予め色を表す値を代入しておき、同ステップ410にて値を読み込むようにしてもよいし、あるいはディスプレイ17a1にて操作者に入力を促し、キーボード15aやマウス15bの操作に応じた値を設定するようにしてもよい。むろん、着色する色とパラメータは予め対応づけてあり、パラメータが指定された場合の各色成分は、二次元テーブル構造の
LUT_R(CL,0〜255)
LUT_G(CL,0〜255)
LUT_B(CL,0〜255)
という変換テーブルに値を設定しておく。なお、色を付けずに白黒のモノトーンとする場合もあるから、各色成分を各階調ごとに一致させた変換テーブルも用意しておき、例えば着色指示パラメータCLが「0」のときにこの変換テーブルを使用するようにする。むろん、この着色用LUT統合処理は図1に示す各色成分用LUT作成手段に相当する。
【0070】
次に、ステップ415でポインタの変数iを「0」クリアしておき、ステップ435のインクリメント処理とステップ440のループエンド判断処理によってi=0〜255のループを実行する。ループ内ではステップ420〜430にて変数iの階調値における各色成分を次式によって設定する。
LUT4R(i)=LUT_R(CL,LUT3(i))
LUT4G(i)=LUT_G(CL,LUT3(i))
LUT4B(i)=LUT_B(CL,LUT3(i))
この例では、各色ごとに全階調範囲にわたって変換結果を表す変換テーブルを用意しているが、着色指示パラメータごとに各色を修正するγ補正値を用意しておき、変換テーブルLUT3の値を使ってγ補正する演算を実行し、LUT4R,LUT4G,LUT4Bの値を求めるようにしてもよい。
【0071】
図17はLUT3の変換テーブルに対して着色用の変換テーブルLUT_R,LUT_G,LUT_Bを統合する過程を示している。
図17に示すLUT3の変換テーブルは、上述したようにコントラストの修正と明るさの修正とを一段階で実現する対応関係を表すものとして実現されている。すなわち、注目画素の現実の輝度相当値yに基づいて輝度分布を修正した輝度相当値Yが得られるようになっている。
【0072】
一方、LUT_R, LUT_G, LUT_Bは、着色指示パラメータCLで指示された所定のモノトーンを表現するための変換テーブルであり、単一の輝度相当値Y1を入力すればその輝度相当値での各要素色RGBの階調値が得られる。もとより、修正前の輝度相当値yでLUT3を参照し、参照された輝度相当値Y1でLUT_R, LUT_G, LUT_Bを参照すれば、修正前の輝度相当値yに対して最適な輝度分布の修正がなされつつ所望の色に着色させたRGBの階調値が得られる。これを一つの変換で実現させるように変換テーブルを統合したものが同図に示すLUT4R, LUT4G, LUT4Bである。
【0073】
以上のようにして特徴量の分析と輝度対応関係の設定を終えたら、ステップ160にて画像データ変換処理を実行する。図18はこの画像データ変換処理のより詳細なフローチャートを示している。
画像データの変換は、輝度分布を調べたときと同様に注目画素を図7に示すようにして移動させながら各画素の画像データを修正していく。注目画素の位置はポインタで示し、ステップ510ではこのポインタを初期位置に移動させる。ステップ515では上述したのと同様にして注目画素の輝度相当値yを算出し、ステップ520〜530にてこの輝度相当値yで変換テーブルLUT4を参照し、各色成分R’,G’,B’を求める。変換自体はこれで完了し、ステップ535にて修正画像データを出力する。その後、ステップ540にてポインタを次の画素に移動し、このときにステップ545にて全画素を終了したと判断すれば画像データ変換処理を終了するし、全画素を終了していないと判断すれば上述したステップ515以下の処理を繰り返す。
【0074】
なお、この実施形態では輝度分布の集計処理の際と画像データの変換の際とで二度輝度相当値の演算を行っているが、図1の波線に示すように画像取得手段が輝度相当値を出力し、輝度分布を集計しながらワークエリアに保存しておくようにすれば、画像データ変換処理でこのワークエリアから各画素の輝度相当値を読み込んで処理を実行でき、二度の変換を行わなくても済む。また、このように輝度相当値として保存するときは1画素について1要素となる。このため、RGB各成分のために合計3バイト使用する場合と比較して1/3の1バイトで済む。従って、元の画像データよりも1/3のファイル容量となる。
【0075】
次に、上記構成からなる本実施形態の動作を説明する。
ディジタルスチルカメラ11bで撮影した画像データをセピア調にして印刷したいものとすると、ユーザーはコンピュータシステム10で画像印刷ソフトなどのアプリケーション12dを立ち上げ、ケーブル接続であるとか着脱可能なメディアを利用してディジタルスチルカメラ11bから画像データを取り込む。そして、アプリケーション12dの操作メニューなどから画像処理として「セピア調」を選択し、「印刷」処理を選択する。この処理の概略は、図5に示すフローチャートに従って実行される。この場合は、画像データが既に取り込まれているのでステップ110の入力処理を実行したものとし、ステップ120〜ステップ140の処理を実行する。すなわち、各画素についての輝度相当値を求め、全画素にわたって輝度分布を集計する。なお、集計結果は厳格である必要はないので、全画素にわたって行うのではなく間引きした画素について集計するようにしても良い。
【0076】
ここで具体的な被写体と写真とを参照して説明する。被写体は図19(a)に示すボールであるとする。このボールは帯状の色分け模様がなされており、地球に例えると北極と南極の側で薄い色となり赤道部分で濃い色なっているとする。ディジタルスチルカメラ11bでカラー画像として撮影したところ、図19(b)に示すようになった。写真自体はコントラストの狭い画像となってしまったが、カラー画像であるので色の違いから帯状の色分け模様は認識できている。なお、図面ではあえて色の濃さに対応させていないが、色分けが分かるという意味で帯を示している。このようにコントラストが狭い画像をそのままモノトーン化してしまうと、図20(a)に示すようにかろうじて識別できていた帯状の模様が分からなくなってしまう。
【0077】
しかしながら、ステップ150として実行される特徴量分析輝度対応関係設定処理では、輝度分布からこの画像データについてのコントラストの幅Ydifであるとか分布の中央値Ymedを導出し、これを改善する変換テーブルLUT3を形成する。また、ここでは輝度分布を改善する対応関係を活かしながらセピア調のモノトーンに着色するための変換テーブルLUT4まで形成するため、この変換テーブルLUT4に基づいて画像データを修整すると、コントラストの幅が改善されつつ、明るさも良好な分布となる。むろん、この結果、画像全体がセピア調のモノトーン画像となり、図20(b)に示すようにモノトーン画像のまま帯の模様を認識できる。すなわち、白黒段階の画像修正と、一定の色に着色するという全く性質の異なる多段階の処理が一括の変換で行われ、かつ、その結果はモノトーン画像として非常に画質の良いものとなる。
【0078】
このように、カラーの画像データを入力してモノトーン化する場合に、画像データにおける輝度分布を集計し(ステップ120〜ステップ140)、集計結果を利用して輝度対応関係を設定し(ステップ150)、かかる輝度対応関係に基づいて画像データを修整した上でモノトーン画像に変換するようにしたため、単純に輝度だけに基づいてモノトーン化した場合に比べて画質を向上させることができるうえ、このような輝度分布の改善と着色の処理という多段階の変換を一括して行うことができる。
【図面の簡単な説明】
【図1】本発明の一実施形態にかかるモノトーン変換装置のクレーム対応概略構成図である。
【図2】同モノトーン変換装置を具体化するハードウェアのブロック図である。
【図3】本発明のモノトーン変換装置の他の適用例を示す概略ブロック図である。
【図4】本発明のモノトーン変換装置の他の適用例を示す概略ブロック図である。
【図5】本発明のモノトーン変換装置におけるメインのフローチャートである。
【図6】画像データファイルの構成を示す図である。
【図7】処理対象画素を移動させていく状態を示す図である。
【図8】特徴量分析輝度対応関係設定処理のフローチャートである。
【図9】輝度分布を拡大する必要がある場合の輝度分布(a)と変換関係(b)を示す図である。
【図10】輝度分布の端部処理(a)と輝度分布を拡大する際の変換テーブル(b)を示す図である。
【図11】γ補正で明るくする概念(a)と暗くする概念(b)と手法(c)を示す図である。
【図12】明るさの評価値とγの対応関係を示す図である。
【図13】LUT統合処理のフローチャートである。
【図14】LUTの統合過程を示す図である。
【図15】着色用LUT統合処理のフローチャートである。
【図16】モノトーンで着色するために各構成分の比が一定となるように構成分を決定する対応関係(a)と最適な階調値で各構成分の比が一定となるように構成分を決定する対応関係(b)を示すグラフである。
【図17】着色用LUTを統合する過程を示す図である。
【図18】画像データ変換処理のフローチャートである。
【図19】被写体のボール(a)とそのカラー画像(b)を示す図である。
【図20】通常のモノトーン化を行った場合の画像(a)と本発明のモノトーン化を行った場合の画像(b)の図である。
【符号の説明】
10…コンピュータシステム
11a…スキャナ
11a2…スキャナ
11b…デジタルスチルカメラ
11b1…デジタルスチルカメラ
11b2…デジタルスチルカメラ
11c…ビデオカメラ
12…コンピュータ本体
12a…オペレーティングシステム
12b…ディスプレイドライバ
12b…ドライバ
12c…プリンタドライバ
12d…アプリケーション
13a…フロッピーディスクドライブ
13b…ハードディスク
13c…CD−ROMドライブ
14a…モデム
14a2…モデム
15a…キーボード
15b…マウス
17a…ディスプレイ
17a1…ディスプレイ
17b…カラープリンタ
17b1…カラープリンタ
17b2…カラープリンタ
18a…カラーファクシミリ装置
18b…カラーコピー装置
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a monotone conversion apparatus that converts a color image into a monotone image, a monotone conversion method, and a medium on which a monotone conversion program is recorded.
[0002]
[Prior art]
In recent years, digital still cameras have begun to be used rapidly. When the image is taken with a digital still camera, the image can be managed as data, and image processing can be easily performed. For example, a color image can be converted into a monotone image such as black and white or sepia.
Conventionally, such conversion to monotone has been performed by simply replacing the data with a monotone while maintaining the luminance for each pixel in the dot matrix form.
[0003]
[Problems to be solved by the invention]
In the above-described conventional monotone conversion device, the quality of the image when the monotone conversion is performed is not so much questioned, and as a result, there is a problem that the original luminance distribution is converted as it is.
The present invention has been made in view of the above problems, and provides a monotone conversion device, a monotone conversion method, and a medium on which a monotone conversion program is recorded, which can improve the quality of an image even in the case of monotone conversion. Objective.
[0004]
[Means for Solving the Problems]
  To achieve the above purpose, PaintingAn image acquisition means for expressing an image as each pixel of a dot matrix and obtaining gradation data for each pixel with a predetermined element color obtained by color separation, and a luminance equivalent value of each pixel based on the image data Luminance distribution aggregation means for performing aggregation, luminance correspondence setting means for deriving a correspondence relationship of luminance conversion for changing the luminance distribution based on the aggregated luminance distribution, and based on the derived correspondence relationship of luminance conversion Image data conversion means for generating monotone image data obtained by converting the luminance of each pixel in the image data.Also good.
[0005]
  the aboveConstitutionIn this case, when the image acquisition means acquires the image data representing the image as each pixel in a dot matrix and expressing the gradation for each pixel with a predetermined element color obtained by color separation, the luminance distribution aggregation means is based on the image data. The luminance correspondence value setting means derives the correspondence relationship of the luminance conversion for changing the luminance distribution based on the aggregated luminance distribution, so that the image data conversion means is derived Monotone image data obtained by converting the luminance of each pixel in the image data based on the correspondence relationship of the luminance conversion is generated.
  The present invention provides an image acquisition means for acquiring image data that represents an image as each pixel in a dot matrix and represents a gradation for each pixel with a predetermined element color that has been color-separated, and each pixel based on the image data. A luminance distribution totaling unit for totaling the luminance equivalent values and a luminance conversion table for changing the luminance distribution by converting the luminance equivalent values are derived based on the aggregated luminance distributions, and the luminance equivalent values are set to a predetermined value. Set a conversion table for each element color to convert to element colors that express a monotone of color tone, and generate an integrated conversion table for each element color by integrating the luminance conversion table into each conversion table for each element color Each of the integrated conversion tables for each element color is input with a luminance equivalent value of each pixel in the image data. By conversion result by table to obtain the tone values of element colors of each pixel is a structure comprising an image data converting means for obtaining image data of the monotone of the predetermined color tone.
[0006]
In other words, the distribution of luminance equivalent values (meaning luminance or a value that is not exact but equivalent to luminance) for each pixel constituting the image is obtained, and if there is room for improvement in this luminance distribution, luminance conversion is supported. A relationship is derived, and a monotone image in which the luminance of each pixel is converted is generated based on the relationship. More specifically, conversion is performed so that the color of each pixel becomes monotone while setting the luminance of a certain pixel to an appropriate luminance.
Conversion of image data to monotone is used in various fields. For example, monotone conversion is prepared as one option when a digital image is input to a photo retouching software of a computer and a desired filtering process is performed on the software. Also, the digital still camera itself may be provided with monotone conversion called sepia tone photography. Accordingly, the image acquisition means may be any device that can acquire color image data, such as a specific image sensor such as a CCD, an external device such as a scanner, or a data line. There is no particular limitation such as merely supplying image data. Further, even when the image data is already prepared in a state where it is developed on the memory, this corresponds to acquiring the image data at the time of reading from the memory.
[0007]
  The monotone here is not necessarily limited to black and white, and even a so-called single colored expression is a monotone. As an example of monotone conversion,UpThe luminance correspondence setting means is a configuration for setting the correspondence for changing the luminance distribution with the luminance equivalent value and setting the correspondence with the composition ratio between the element colors after the luminance change as a predetermined ratio.Also good.
[0008]
  the aboveConstitutionIn FIG. 5, after changing the luminance distribution with the luminance equivalent value, the component ratio between the element colors is set to a predetermined ratio. In other words, since the composition ratio between the component colors in the monotone image data is a predetermined ratio, it is colored monotone image data such as sepia.
  However, when the component ratio between the element colors here is the same, it becomes monochrome image data. This is because in order to represent black and white with a plurality of element colors, it is only a result of giving the same gradation value for each component.
  The present invention further includes means for acquiring a coloring instruction for instructing a monotone color tone in response to an external input, and the table setting means expresses a luminance equivalent value and a monotone of a color indicated by the acquired coloring instruction. The luminance conversion table may be integrated with the conversion table for each element color that defines the conversion relationship with the element color to be processed.
[0009]
It should be noted that it is complicated to obtain the optimum gradation value for each gradation value individually when deriving the correspondence. Therefore, a conversion table may be generated based on the tone curve for collectively determining the correspondence relationship, and conversion may be performed using this conversion table when converting from the original luminance to the corrected luminance. Of course, this tone curve represents the correspondence based on the luminance distribution. For example, if the result of obtaining the luminance distribution seems to be dispersed in a dark region as a whole, it is moved to the bright side as a whole, but at this time, it is uniquely determined by a certain parameter such as a γ curve. The curve is used as the tone curve, and only this parameter is determined. As a result, the conversion value corresponding to each gradation value is determined by the tone curve regardless of the width of the gradation value.
Note that the tone curve is not limited to the case where the tone curve is provided only in one direction, and can be appropriately changed such as an S shape.
[0010]
  Even when the composition ratio between the element colors is set to a predetermined ratio, there are various methods for realizing it, and the present invention is not limited to a case where the ratio is constant over all gradation values. As an example,UpThe luminance correspondence relationship setting means uses a tone curve to achieve a constant composition ratio at a certain luminance value and smooth over all gradation values when setting the composition ratio between each element color to a predetermined ratio after the brightness change. As a configuration to changeAlso good.
  Further, according to the present invention, the table setting means has a constant configuration with a certain luminance equivalent value as a conversion table for each element color in which the composition ratio between the element colors is a ratio for expressing the monotone of the predetermined color tone. The tone curve is used to smoothly change the conversion result over all gradation values while realizing the ratio.
[0011]
  If a constant ratio is set over all gradation values, it can be realized at a constant ratio when the luminance value is close to “0”, but it is difficult to realize the constant ratio when the gradation value is close to the maximum value. Therefore, by using a tone curve that realizes a typical composition ratio at a certain luminance value and the difference converges on the end side, it is smoothly changed over all gradation values, and the above-mentioned problem is solved.
  As an example of a method for generating monotones,UpThe luminance correspondence relationship setting means is configured to set a correspondence relationship that collectively changes the luminance distribution with the luminance equivalent value and the conversion that changes the component ratio between the element colors to a predetermined ratio after the luminance change.Also good.
[0012]
In order to make the composition ratio of each element color a predetermined ratio while the brightness is finally corrected to an appropriate value, the correspondence relationship of the monotone conversion with the brightness relative value is once derived conceptually. It is also possible to take two steps, such as converting the luminance in black and white, and changing the composition ratio between the element colors in a state where the luminance value in black and white is converted. However, as long as the gradation value is limited, it is possible to realize a two-stage correspondence at a time by obtaining a result of two-stage correspondence in advance.
[0013]
  As an example of setting multiple levels of correspondence in this way,UpThe luminance correspondence setting means generates a conversion table corresponding to each of the individual correspondences, and integrates this conversion table to generate an integrated conversion table.Also good.
  A conversion table representing each correspondence relationship is generated in advance, and the conversion table is referred to in a plurality of stages while changing the luminance value of the conversion source over all gradation values. Then, by setting the result as a luminance value after conversion with respect to the luminance value of the conversion source, an integrated integrated conversion table can be easily realized.
[0014]
The integration of conversion tables is not limited to coloring. For example, first, when the corresponding correspondence of the luminance conversion is derived individually from the aggregated luminance distribution based on a plurality of elements, and then the integrated correspondence that sequentially adapts each correspondence is derived. Generates a conversion table representing the integrated correspondence. For example, the correspondence relationship for improving contrast and the correspondence relationship for improving brightness are not exclusive, and an integrated correspondence relationship is derived in order to realize both correspondence relationships.
[0015]
In this case, first, a conversion table corresponding to each correspondence relationship is generated, and then this conversion table is integrated to generate an integrated conversion table. That is, the next conversion table is referenced using a value referenced in a certain conversion table, and the referenced value is made to correspond to the first value. Of course, the number of conversion tables to be referred to is not limited to two, and an arbitrary number of conversion tables can be integrated.
By the way, when obtaining the luminance of each pixel with respect to color image data, it is often difficult to obtain a luminance having a strict meaning. That is, if the coordinate system used by the image data does not employ a single luminance parameter, the coordinate system must be converted, but strictly speaking, there is often no linear correspondence between the coordinate systems. . In this case, if the correspondence is obtained by calculation, the amount of computation increases, and if a conversion table in which the correspondence is derived in advance is used, depending on the number of colors that can be reproduced, the table becomes extremely large. turn into.
[0016]
However, what is used is a result of the aggregation of the luminance distribution, and it is not always necessary to have a strict luminance. For this reason, the luminance distribution aggregation means does not perform strict luminance conversion, but derives the luminance by linear conversion from the gradation values of each element color so that it can be done with relatively simple processing. You may make it ask. In addition, the linear transformation here can be interpreted broadly. For example, it is only necessary to be able to be obtained by a simplified calculation except when it cannot be derived without referring to a table or when a high-load calculation process must be performed by a non-linear calculation.
[0017]
  Further, it is meaningful to take a step of improving the luminance distribution after obtaining it, and the specific points to improve are not particularly limited. However, as an exampleThe table aboveThe setting unit converts the range from the maximum luminance to the minimum luminance derived based on the luminance distribution as the contrast width, and converts the contrast width from the original luminance to the corrected luminance so as to be an appropriate width.Brightness conversion tableIs derived.
[0018]
  the aboveConstitutionIn, the range from the maximum luminance to the minimum luminance derived based on the luminance distribution is regarded as the contrast width. When the range from the maximum luminance to the minimum luminance is narrow, the available contrast width is not effectively used. For this reason, by deriving a correspondence relationship that expands the width of contrast, the width of contrast becomes wider when converted from the original luminance to the modified luminance. Theoretically, the reverse is also possible.
[0019]
  As another exampleThe table aboveThe setting means converts from the original luminance to a modified luminance so that the luminance distribution becomes an appropriate distribution as a whole when the brightness of the image derived based on the luminance distribution is not in an appropriate range.Brightness conversion tableIs derived.
  the aboveConstitutionIn, the brightness of the image is determined from the luminance distribution. That is, if the luminance distribution is concentrated in a bright area, it can be determined that it is too bright, and if it is concentrated in a dark area, it can be determined that it is too dark. Therefore, the brightness of the image can be adjusted by making it as biasless as possible. For this reason, a correspondence relationship is derived so that the luminance distribution is an appropriate distribution as a whole. For example, if the mountain in the frequency distribution is biased to a dark area, the mountain is moved around the center of all gradations. Conversely, if the mountain is biased to a bright area, the mountain is similarly shifted to the center of all gradations. A correspondence relationship that is moved around is derived.
[0020]
As described above, if there is room for improving the luminance distribution, the method of deriving the correspondence relationship of the luminance conversion and converting the luminance is not necessarily limited to a substantial device, and it is easy to function as that method. Can understand. That is, it is not necessarily limited to a substantial apparatus, and there is no difference that the method is also effective.
In addition, the monotone conversion device may exist alone or may be used in a state where it is incorporated in a certain device. 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.
[0021]
When the software of the monotone conversion device is embodied as an embodiment of the idea of the invention, it naturally exists on a recording medium on which such software is recorded, and it must be used.
Of course, the recording medium may be a magnetic recording medium, a magneto-optical recording medium, or any recording medium that will be developed in the future. In addition, the duplication stages such as the primary duplication product and the secondary duplication product are equivalent without any question. In addition, even when the communication method is used as a supply method, the present invention is not changed.
[0022]
Further, even when a part is software and a part is realized by hardware, the idea of the invention is not completely different, and a part is stored on a recording medium and is appropriately changed as necessary. It may be in the form of being read. Needless to say, the present invention is realized by the program itself.
[0023]
【The invention's effect】
As described above, the present invention adjusts the luminance of each pixel so as to obtain an optimal luminance distribution, and thus can provide a monotone conversion device capable of generating a monotone image with good image quality.
[0024]
  Also,BookAccording to the invention, each element color can be obtained so as to have a predetermined composition ratio while obtaining an optimal luminance distribution, and a monotone conversion of a desired color including black and white can be realized.
  further,BookAccording to the invention, since the change in the composition ratio is realized by the tone curve, the value of each element color can be obtained relatively easily.
  further,BookAccording to the invention, since the conversion in a plurality of stages is realized at once, the processing can be speeded up.
[0025]
  further,BookAccording to the invention, it is possible to realize a correspondence that is simply integrated using a conversion table.
  further,BookAccording to the invention, it is possible to generate a monotone image with an appropriate contrast width.
  further,BookAccording to the present invention, it is possible to generate a monotone image having an appropriate range of brightness, that is, an appropriate brightness without being too bright or too dark.
[0026]
  further,BookAccording to the invention, a monotone conversion method having the same effectandA medium recording a monotone conversion program can be provided.
[0027]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows a monotone conversion apparatus according to an embodiment of the present invention by a schematic diagram corresponding to claims, and FIG. 2 shows a computer system 10 as an example of hardware for realizing the monotone conversion apparatus by a block diagram. Yes. First, the computer system 10 will be described.
[0028]
The computer system 10 includes a scanner 11a, a digital still camera 11b, and a video camera 11c as image input devices for directly inputting image data, and these are connected to the computer main body 12. Each input device can generate image data in which an image is expressed by a dot matrix pixel and output the image data to the computer main body 12. Here, the image data is displayed in 256 gradations for each of the three primary colors of RGB. About 16.7 million colors can be expressed. Various types of image data formats are used, including a compressed JPEG format and an uncompressed BMP format.
[0029]
A floppy disk drive 13a, a hard disk 13b, and a CD-ROM drive 13c as external auxiliary storage devices are connected to the computer main body 12, and main programs related to the system are recorded on the hard disk 13b. Necessary programs and the like can be read from a CD-ROM or the like and recorded on the hard disk 13b.
In addition, a modem 14a is connected as a communication device for connecting the computer main body 12 to an external network or the like, and it can be connected to an external network via the public communication line, and can be installed by downloading software and data. It has become. In this example, the modem 14a accesses the outside via a telephone line, but it is also possible to adopt a configuration where the network is accessed via a LAN adapter.
[0030]
Here, among the external auxiliary storage devices, the floppy disk drive 13a and the CD-ROM drive 13c can be replaced by the recording medium itself, and supplied with the image data recorded on the recording medium. It can also be a means of an image input device. Further, when a network is accessed via the modem 14a or the LAN adapter, image data may be supplied from this network. In such a case, it can be a means of an image input device.
[0031]
In addition, a keyboard 15a and a mouse 15b as a pointing device are connected for operating the computer main body 12, and a speaker 18a and a microphone 18b are provided for multimedia support.
Furthermore, a display 17a and a color printer 17b are provided as image output devices. The display 17a has a display area of 800 pixels in the horizontal direction and 600 pixels in the vertical direction, and the above-described display of 16.7 million colors can be performed for each pixel. Of course, this resolution is only an example, and can be changed as appropriate, such as 640 × 480 pixels or 1024 × 768 pixels.
[0032]
A color printer 17b as a printing apparatus is an ink jet printer, and can print an image by adding dots on a printing paper as a recording medium using four color inks of CMYK. The image density is capable of high-density printing such as 360 × 360 dpi or 720 × 720 dpi, but the gradation table has a two-gradation expression such as whether or not color ink is applied. The color ink is not limited to such four colors, and it is possible to reduce the conspicuousness of dots by adding light cyan and light magenta, which are light in color, and not only the ink jet method but also color toner is used. It is also possible to employ an electrostatic photographic method.
[0033]
On the other hand, in order to display or output to the image output device while inputting an image using such an image input device, a predetermined program is executed in the computer main body 12. Among them, an operating system (OS) 12a is operating as a basic program, and the operating system 12a performs a print output to a display driver (DSP DRV) 12b for displaying on the display 17a and a color printer 17b. A printer driver (PRT DRV) 12c is installed. These types of drivers 12b and 12c depend on the models of the display 17a and the color printer 17b, and can be added to and changed from the operating system 12a according to the respective models. In addition, depending on the model, additional functions beyond standard processing can be realized. That is, various additional processes within an allowable range can be realized while maintaining a common processing system on the standard system called the operating system 12a.
[0034]
Of course, the computer main body 12 is provided with a CPU 12e, a RAM 12f, a ROM 12g, an I / O 12h, etc. as a premise for executing such a program, and the CPU 12e for executing arithmetic processing sets the RAM 12f in a temporary work area or setting. A basic program written in the ROM 12g is appropriately executed while being used as a storage area or a program area, and external devices and internal devices connected via the I / O 12h are controlled.
[0035]
The application 12d is executed on the operating system 12a as the basic program. The processing contents of the application 12d are various. The operation of the keyboard 15a and the mouse 15b as operation devices is monitored, and when operated, various external devices are appropriately controlled to execute corresponding arithmetic processing, Furthermore, the processing result is displayed on the display 17a or output to the color printer 17b.
[0036]
The computer system 10 can acquire image data by reading a photograph or the like with a scanner 11a as an image input device, and can also acquire image data captured with a digital still camera 11b or a video camera 11c. Image data as a moving image can be acquired. In addition, various image data captured in advance are often provided as CD-ROM software.
In recent years, it has become almost natural that such image data is in color, but there are many cases where the image data is intentionally made monotone in order to enjoy the expression. Conventionally, since the printing apparatus was only monochrome printing using only black ink, processing for monotone processing was performed as a matter of course. In many cases, such a colored monotone image is printed.
[0037]
In such a computer system 10, image data captured by the digital still camera 11b or the like can be captured by the computer main body 12, and can be printed by the color printer 17b through necessary image processing. In this case, a predetermined application 12d is started on the computer main body 12, and image data captured by the digital still camera 11b is directly captured as a print target, or image data already stored in an external storage device such as the hard disk 13b is captured. be able to. Accordingly, such processing constitutes the image acquisition means A1 shown in FIG.
[0038]
On the other hand, the application 12b can output the image data as it is to the printer driver 12c for printing, but the application 12b can also execute image processing. In the present invention, the luminance equivalent value of the image data (in this embodiment, the luminance in a strict sense is not handled, but the luminance equivalent value that is equivalent to the luminance is treated as the luminance) is statistically processed, and the image Understand the characteristics of At this time, if the image cannot be said to have good image quality by simply monotonizing the image as usual, a policy for correcting the luminance of the image data is determined based on the grasped characteristics. Accordingly, such processing constitutes the luminance distribution tabulating unit A2 and the luminance correspondence setting unit A3.
[0039]
Of course, when the policy for correction is determined in this way, the image data is corrected based on such criteria, and then output to the printer driver 12c for printing. Therefore, this modification process constitutes the image data conversion means A4.
That is, the image acquisition unit A1 shown in FIG. 1 realizes a process of acquiring image data having gradation value data for each element color. Based on this image data, the image acquisition unit A1 simply calculates the luminance equivalent value y and causes the luminance distribution tabulation unit A2 to tabulate. The luminance distribution tabulating means A2 tabulates the frequency distribution DB of luminance equivalent values so that the tendency of the luminance distribution can be known. Of course, it is also possible to realize aggregation other than the frequency distribution, but here the frequency distribution DB is selected from the viewpoint of simplicity of processing.
[0040]
The luminance correspondence setting means A3 sets the luminance correspondence so that an optimum image can be obtained when expressed in monotone based on the frequency distribution DB, but internally performs multistage processing. First, the luminance distribution width detecting means A31 obtains the maximum luminance Ymax and the minimum luminance Ymin of the distribution in the frequency distribution DB and the luminance distribution width Ydif based on these. Then, using these, the distribution width improvement LUT creation unit A32 generates a conversion table LUT1 indicating a correspondence relationship for improving the width of the luminance distribution. On the other hand, the frequency distribution DB is also referred to by the brightness determination means A33, and the median value Ymed of the distribution is obtained as a representative value representing the brightness of the image, and the brightness improvement LUT creation means A34 shows a correspondence relationship for improving the brightness of the image. A conversion table LUT2 is generated.
[0041]
The distribution width improvement LUT creation means A32 and the light / darkness improvement LUT creation means A34 each generate a correspondence that improves the luminance distribution from an individual viewpoint. Of course, each improvement can be made individually, but since the improvement using the conversion table can be easily integrated, the LUT integration means A35 generates an integrated conversion table LUT3 in which these are integrated.
The LUT 3 can improve the luminance equivalent value y to the last, but in the monotone conversion, a color like a sepia tone is preferred, and even if it is black and white, it must be expressed by the gradation value of the element color. There is no change in not becoming. Therefore, each color component LUT creation means A36 generates conversion tables LUT4R, LUT4G, and LUT4B that are directly converted from the luminance equivalent value y to the gradation value of each element color.
[0042]
The image data conversion means A4 obtains the luminance equivalent value y based on the original image data RGB, or refers to the LUT4R, LUT4G, and LUT4B based on the luminance equivalent value y generated by the image acquisition means A1, and obtains the reference result. Output as converted image data R ′, G ′, B ′. Of course, the LUT4R, LUT4G, and LUT4B include coloring elements as well as improvement of two luminance distributions of contrast and brightness, and a result obtained by collectively converting these can be obtained.
[0043]
In the following, a specific process in which the computer system 10 implements these mainly using software will be described in more detail. Such software is stored in the hard disk 13b and is read and operated by the computer main body 12. At the time of introduction, it is recorded on a medium such as the CD-ROM 13c-1 or the floppy disk 13a-1 and installed. Therefore, these media constitute a medium on which a monotone conversion program is recorded. Needless to say, these time-series processes constitute a monotone conversion method.
[0044]
In the present embodiment, the monotone conversion apparatus is realized as the computer system 10, but such a computer system is not necessarily required, and any system that handles image data and generates a monotone image may be used. For example, as shown in FIG. 3, the digital still camera 11b1 has a function of generating a monotone image, and is also applied to a configuration in which a monotone image is displayed on the display 17a1 or printed by the printer 17b1. Is possible.
[0045]
Further, as shown in FIG. 4, a printer 17b2 is connected without using a computer system, and color image data input through the scanner 11a2, the digital still camera 11b2, the modem 14a2, or the like is printed in monotone and printed. You can also In recent years, such a printer 17b2 is often used as a video printer for making a hard copy of a scene by connecting to a home television or video. In this case, it is possible to apply the present invention while adopting a function of making a monotone in a sepia tone instead of printing in color.
[0046]
FIG. 5 shows the control contents of the main image processing software in the monotone conversion apparatus in blocks.
In step 110, image data is input. The image data is read via the operating system 12a and stored in a predetermined work area. The image data itself is a single file. As shown in FIG. 6, the head portion is provided with profile data such as the size of the image and the number of colors, and thereafter, 3 pixels are expressed to represent each pixel in RGB 256 gradations. Byte areas are reserved for the number of pixels. Note that the image data may be read from the image input device, or an image data file already stored in the hard disk 13b or the like may be read.
[0047]
When the image data is read into the work area, the target pixel is moved in steps 120 to 140 as shown in FIG. Although the contents of the tabulation process are various, in this embodiment, the tabulation process is performed to obtain the feature amounts of “contrast” and “lightness”. After completing the aggregation process for all pixels, in step 150, an improvement method for optimizing the luminance distribution is set while analyzing the feature amount based on the aggregation result. In the following, description will be made focusing on these tabulations. FIG. 8 shows a flowchart for setting the luminance correspondence by analyzing the feature amount.
[0048]
The contrast indicates the width of the brightness of the entire image, and when it is felt that the contrast is not appropriate, there is mainly a desire to increase the width of the contrast. FIG. 9A shows a solid line in which the distribution of luminance equivalent values in each pixel of an image is tabulated as a histogram. When the distribution shown by the solid line is taken, the difference between the brightness of the bright pixel and the brightness of the dark pixel is small, but if the brightness distribution is widened as shown by the dashed line, the difference between the brightness of the bright pixel and the brightness of the dark pixel is large. As a result, the range of contrast is widened. Here, FIG. 9B shows luminance conversion for enlarging the contrast. Between the luminance y after conversion and the luminance Y after conversion,
Y = ay + b
If the conversion is performed based on the relationship, the difference between the pixels of the maximum luminance Ymax and the minimum luminance Ymin of the conversion source becomes large after conversion when a> 1, and the luminance distribution is widened as shown in FIG. become. Therefore, in order to create such a histogram, it is necessary to tabulate the interval from the maximum luminance value to the minimum luminance value as the contrast width. However, in this case, it is only luminance conversion, and if the image data has luminance as an element, it can be directly counted, but as described above, the image data is expressed in RGB 256 gradations. It does not have a luminance value directly. In order to obtain the luminance, it is necessary to perform color conversion to the Luv color space. However, since this is not a solution because of problems such as the amount of computation, conversion of the following equation that directly obtains the luminance from RGB used in the case of a television or the like Use an expression.
y = 0.30R + 0.59G + 0.11B
In addition, since it is not necessary to determine the brightness exactly like this,
y = (R + G + B) / 3
Furthermore, it is also possible to set only the G component as an approximate value from the difference in the weight of each component,
y = G
It is good. Of course, the luminance roughly calculated in this way is an actual luminance equivalent value, and if a simplified calculation is used, the calculation processing load is reduced and the speed can be increased. In Step 120 to Step 140, 3 bytes as image data of each pixel is read while moving the target pixel, and the luminance y is calculated based on the same equation. In this case, the luminance y is also expressed by 256 gradations, and the frequency for the calculated luminance y is added one by one.
That is, in step 120, the pointer indicating the target pixel is set to the initial position in order to scan and process the image, and the pointer is moved in step 135 until it is determined in step 140 that all pixels have been completed. Repeat the loop process. Also, what is executed for each pixel is the calculation of the luminance equivalent value of the pixel of interest performed in step 125 and the update of the frequency distribution performed in step 130. While calculating the luminance equivalent value (Y) for all the pixels, the variable DB (Y) representing the number of pixels having the same luminance equivalent value is incremented by “1”. A frequency distribution (histogram) is obtained.
[0049]
Note that the conversion to black and white that does not need to be colored may use this luminance, and is realized by matching the RGB component values with the obtained gradation values of the luminance.
Steps 120 to 140 for obtaining the histogram of the luminance distribution in this way are the luminance distribution totaling process, and the luminance correspondence is set while analyzing the feature amount in the flowchart shown in FIG. 8 based on this histogram.
First, at step 210, both ends of the luminance distribution are obtained. The luminance distribution of the photographic image appears generally in a mountain shape as shown in FIG. Of course, there are various positions and shapes. The width of the luminance distribution is determined depending on where the both ends are determined, but a point where the base extends and the number of distributions becomes “0” cannot be the both ends. This is because the number of distributions may change around “0” in the base portion, and if it is statistically viewed, it changes while approaching “0” as much as possible.
[0050]
For this reason, in the distribution range, portions that are closer to the inside by a certain distribution ratio from the side with the highest luminance and the side with the lowest luminance are defined as both ends of the distribution. In the present embodiment, as shown in the figure, this distribution ratio is set to 0.5%. Of course, this ratio can be appropriately changed. In this way, 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 by noise or the like. In other words, if such a process is not performed, if there is even a single point of white or black, it will be at both ends of the luminance distribution. Although it is “0” and the uppermost end is gradation “255”, such a thing can be achieved by setting a portion that is inward by 0.5% of the number of pixels from the upper end portion as an end portion. Disappear. Then, 0.5% of the number of pixels is calculated based on the actually obtained histogram, and the number of distributions is accumulated inwardly starting from the luminance value at the upper end and the luminance value at the lower end in the reproducible luminance distribution. Then, the luminance value having a value of 0.5% becomes the maximum luminance Ymax and the minimum luminance Ymin.
[0051]
The width Ydif of the luminance distribution is the difference between the maximum luminance Ymax and the minimum luminance Ymin.
Ydif = Ymax−Ymin
It becomes.
On the other hand, the width Ydif of the luminance distribution is a feature amount analyzed based on the image data. In the process of step 215, an improvement parameter is derived in order to set a luminance correspondence relationship based on the feature amount. As the image processing for enlarging the contrast based on the width Ydif of the luminance distribution, the inclination a and the offset b may be determined according to the luminance distribution. For example,
a = 255 / (Ymax−Ymin)
b = −a · Ymin or 255−a · Ymax
If this is the case, the luminance distribution with a narrow width can be expanded to a reproducible range. However, when the luminance distribution is expanded by making the maximum use of the reproducible range, the highlight portion may be white and the high shadow portion may be black. In order to prevent this, it is only necessary to leave “5” as a luminance value as a range that does not expand to the upper end and the lower end of the reproducible range. As a result, the parameters of the conversion equation are as follows:
a = 245 / (Ymax−Ymin)
b = 5-a · Ymin or 250-a · Ymax
In this case, it is preferable not to perform conversion in the range of Y <Ymin and Y> Ymax.
[0052]
Moreover, it is not necessary to calculate every time in this conversion. If the luminance range takes values “0” to “255”, a conversion result is previously set for each luminance value, and a conversion table is formed as shown in FIG. This conversion table is substantially synonymous with the distribution width improvement tone curve, and the conversion table is formed in step 220. The conversion table created here is called LUT1.
[0053]
If a monochrome monotone image is simply obtained, the conversion result Y of this conversion table is used, and the image data (R0, G0, B0) before conversion is converted into image data (Y1, Y1, Y1) after conversion. That's fine.
That is, in step 150, the process of analyzing the feature amount corresponds to the process of obtaining the maximum brightness Ymax and the minimum brightness Ymin described above, and the work of setting the brightness correspondence relationship is obtained from the conversion formula while obtaining the width Ydif of the brightness distribution from these. This corresponds to processing for obtaining the parameters a and b and creating a conversion table. If this is the only correspondence setting process, the image data conversion process in step 160 designates such a conversion table and converts the image data after conversion from the image data before conversion (R0, G0, B0). (R1 (= Y1), G1 (= Y1), B1 (= Y1)) is generated.
[0054]
Further, the luminance distribution width detection process in step 210 corresponds to the luminance distribution width detection means A31 shown in FIG. 1, and the distribution width improvement parameter derivation process in step 215 and the distribution width improvement conversion table creation process in step 220 are shown in FIG. This corresponds to the distribution width improvement LUT creation means A32 shown.
Next, brightness will be described. The lightness as the feature amount of the image here means an index of lightness and darkness of the entire image, and the median value (median) Ymed of the distribution obtained from the above-described histogram is used. Accordingly, the aggregation process in this case is performed simultaneously with the aggregation process for contrast, as before.
[0055]
On the other hand, when analyzing a feature value, a difference (Ymed_target−Ymed) from Ymed_target, which is an ideal value of lightness, may be calculated. The actual value of the ideal value Ymed_target uses “106”, but is not fixed. Further, it may be changed to reflect the preference. Of course, the process for calculating the difference (Ymed_target−Ymed) from the ideal value of Ymed_target in this way corresponds to the brightness / darkness detection process in step 225.
[0056]
In the case where the luminance correspondence relationship for brightness is set using this feature quantity (Ymed_target-Ymed), the following is performed. Whether the image is bright or not can be evaluated based on whether the median value Ymed is larger or smaller than the ideal value Ymed_target. For example, if the median value Ymed is “85”, it is smaller than the ideal value Ymed_target “106”. Therefore, the median value Ymed is first evaluated as “dark”, and secondarily the degree of darkness is It is expressed numerically as “106-85”.
[0057]
FIG. 11 (a) shows a luminance histogram. When the peaks of the luminance distribution are close to the dark side as shown by the solid line, the peaks are shown on the bright side as shown by the wavy line. On the contrary, when the peak of the luminance distribution is on the whole bright side as shown by the solid line in FIG. 11B, the peak is on the whole dark side as shown by the wavy line. It is good to move. In such a case, instead of performing linear luminance conversion as shown in FIG. 9B, luminance conversion using a so-called γ curve as shown in FIG. 11C may be performed.
[0058]
It is necessary to move the peaks of the luminance distribution in this way, which corresponds to the case where the brightness of the image is not within the appropriate range, and the peaks of the same luminance distribution are moved to obtain an appropriate distribution as a whole. The correspondence will be derived.
In the correction using the γ curve, the entire image becomes bright when γ <1, and the entire image becomes dark when γ> 1. In the above example, if the median value Ymed increases by “21”, it will coincide with the ideal value Ymed_target. However, it is not easy to accurately increase “21” using the γ curve. For this reason, as shown in FIG. 12, the value of γ corresponding to every increment of “5” may be set for the evaluation value (Ymed_target−Ymed). In this example, the value of γ is varied by “0.05” corresponding to the variation amount “5” of the evaluation value, but it goes without saying that the correspondence between the two can be changed as appropriate.
[0059]
It is also possible to automatically set the value of γ as in the case of contrast correction. For example,
γ = Ymed / 106
Or
γ = (Ymed / 106) ** (1/2)
The value of γ may be obtained as Of course, the conversion table as shown in FIG. 11B is also formed for the luminance conversion by the γ curve. Here, the process for obtaining γ from the table shown in FIG. 12 based on the evaluation value and the process for obtaining γ using the above-described calculation formula correspond to the brightness improvement parameter derivation process in step 230, and further the brightness improvement in step 235. The conversion table creation processing corresponds to processing for creating a conversion table in which conversion values are obtained in advance in the range of luminance “0” to “255” using the γ. Note that the conversion table finally created by this light / dark improvement conversion table creation processing is called LUT2.
[0060]
That is, the work for analyzing the feature amount corresponds to the work for obtaining the median value Ymed or the evaluation value (Ymed_target-Ymed), and the process for creating the conversion table while obtaining the γ correction value from the brightness correspondence setting process. Applicable. If this is the only luminance correspondence, in the image data conversion process in step 160, such a conversion table is designated, and the image data (R1, G0, B0) after conversion from the image data (R0, G0, B0) of each pixel is converted. G1, B1) is generated.
[0061]
The brightness detection process in step 225 corresponds to the brightness determination means A33 shown in FIG. 1, and the brightness improvement parameter derivation process in step 230 and the brightness improvement conversion table creation process in step 235 are the brightness improvement LUT creation means shown in FIG. Corresponds to A34.
By the way, in the present embodiment, two conversion tables are created as described above. In actual image data conversion, it is wasteful to convert sequentially using two conversion tables. For this reason, in step 240, processing for integrating the two conversion tables is performed. A detailed flowchart for the LUT integration processing is shown in FIG. Each of the two conversion tables LUT1 and LUT2 described above has a gradation range of “0” to “255”. For this reason, the conversion value of the conversion table LUT3 may be obtained by integrating the values converted by the LUT2 after the conversion by the LUT1 over the entire gradation range. First, the pointer variable i is cleared to “0” in step 310, and a loop of i = 0 to 255 is executed by the increment process in step 330 and the loop end determination process in step 335.
[0062]
In the loop, first, in step 315, the converted value of LUT1 for the gradation value i is stored in the variable i1, and in step 320, the converted value of LUT2 for the converted value i1 is stored in the variable i2. Since this conversion value i2 is a result of referring to two conversion tables, in step 325, it is set as a conversion value for the gradation value i in the new conversion table LUT3. FIG. 14 shows a process of integrating the conversion tables LUT1 and LUT2. In this way, it is possible to easily create a conversion table corresponding to the execution of all the luminance correspondences, regardless of the number of luminance correspondence relationships. Of course, such LUT integration processing corresponds to the LUT integration means A35 shown in FIG.
[0063]
In this case, since the individual conversion tables LUT1, LUT2 only represent intermediate values, it is not necessary to match the gradation range to the original gradation range, and a more detailed gradation range can be set. . For example, if 768 gradations are set in the intermediate stage and 256 gradations are set in the integrated conversion table, it is possible to prevent the error from gradually increasing during a plurality of conversion tables. it can.
[0064]
In setting the luminance correspondence, the γ curve is used in the case shown in FIG. 11C, and the straight line having a constant slope a and offset b is used in the case shown in FIG. 9B. These can be said to be included in a broadly defined tone curve in the sense that the correspondence relationship of gradation values can be determined in a wide range using one or two parameters.
A monotone image is not necessarily black and white, and a colored monotone image is also preferred. For this reason, when the LUTs are integrated, the color component LUT creation process is executed in step 245. FIG. 15 is a detailed flowchart thereof.
[0065]
Generally, when a representative monotone color (a set of RGB with the highest saturation) is (Rs, Gs, Bs), the corresponding luminance value is ys, and the converted luminance value is Y1. The converted RGB values (R1, G1, B1) are
R1 = Y1 * Rs / ys
G1 = Y1 * Gs / ys
B1 = Y1 * Bs / ys
It can be. FIG. 16A is a graph showing the relationship in which the component ratio of the colored monotone is constant. In this graph, the horizontal axis represents the luminance value y of the conversion source, and the vertical axis represents the gradation value of each color after conversion (which can be said to be the luminance value of each color). As described above, with respect to the luminance value when the saturation is highest, the RGB combination is (Rs, Gs, Bs) with respect to ys, and the ratio of the RGB gradation values at this time is the luminance. It remains constant regardless of the value y.
[0066]
According to the above calculation formula, the G component is also calculated. However, considering the degree of influence of the G component on the luminance, the luminance value ys is substituted as it is as the G component, and the luminance for the R component and the B component is determined. It may be calculated from the luminance value ys using the differences Δ1, Δ2 from the G component when the value is ys. That is,
R1 = Y1 * (1 + Δ1 * (Y1 / ys))
G1 = ys
B1 = Y1 * (1−Δ2 * (Y1 / ys))
Of course, since the conversion table LUT3 has already been created, the RGB values (R1, G1, B1) when Y1 is changed over the entire gradation range may be prepared as the conversion table values.
[0067]
In this example, the component ratio (R: G: B) of each element color is always constant, but for example, the component (R1) of each element color in the luminance value (ys) where this color appears most frequently. , G1, B1) coincides with the above-described composition ratio (R: G: B) (Δ1 = RG, Δ2 = GB), and the other regions become darker or brighter. The components can be made to gradually match. This correspondence is shown in FIG.
[0068]
This graph shows a conversion mode using the above-described γ curve. That is, a γ value is calculated such that a set of RGB in the luminance value ys is (Rs, Gs, Bs), and the RGB value when Y1 is changed over the entire gradation range using the γ value ( R1, G1, B1) is obtained and used as the conversion table value. In the case of this graph, since there is a relationship of Rs> Gs> Bs, at least Rs> Y1, and Y1> Bs. Therefore, the R component is a downward convex curve with γ <1, and the B component is an upward convex curve with γ> 1. Strictly speaking, γ can be 1 or more and less than 1 for the G component, but in the graph, it is simplified and expressed as γ = 1. However, in this case, as described above, it is also possible to prepare tone curves for conversion only for the R component and the B component with the G component as a reference.
[0069]
Of course, when the luminance value is low and the luminance value is high, the above-described composition ratio (R: G: B) does not match. However, when the luminance value reaches the maximum value, the above composition ratio cannot be maintained, and when the luminance value is low and when the luminance value is high, it is actually black or white. Thus, the change mode that converges to the luminance value ys is natural.
In the luminance correspondence setting process, the coloring LUT integration process is performed in step 245 regardless of whether or not coloring is performed. As shown in FIG. 15, the coloring instruction parameter CL is acquired in the first step 410 of the coloring LUT integration processing. The coloring instruction parameter CL may be substituted with a value representing a color in advance, and the value may be read in step 410, or the operator is prompted to input on the display 17a1, and the keyboard 15a and mouse 15b are operated. You may make it set the value according to. Of course, the color to be colored and the parameter are associated with each other in advance, and each color component when the parameter is specified has a two-dimensional table structure.
LUT_R (CL, 0-255)
LUT_G (CL, 0-255)
LUT_B (CL, 0-255)
Set a value in the conversion table. Since there are cases where black and white monotone is used without color, a conversion table in which each color component is matched for each gradation is prepared. For example, when the coloring instruction parameter CL is “0”, this conversion table is prepared. To use. Of course, this coloring LUT integration process corresponds to each color component LUT creating means shown in FIG.
[0070]
Next, in step 415, the variable i of the pointer is cleared to “0”, and the loop of i = 0 to 255 is executed by the increment process of step 435 and the loop end determination process of step 440. Within the loop, in steps 420 to 430, each color component in the gradation value of the variable i is set by the following equation.
LUT4R (i) = LUT_R (CL, LUT3 (i))
LUT4G (i) = LUT_G (CL, LUT3 (i))
LUT4B (i) = LUT_B (CL, LUT3 (i))
In this example, a conversion table representing the conversion result over the entire gradation range is prepared for each color. However, a γ correction value for correcting each color is prepared for each coloring instruction parameter, and the value of the conversion table LUT3 is used. Then, the calculation for γ correction may be executed to obtain the values of LUT4R, LUT4G, and LUT4B.
[0071]
FIG. 17 shows a process of integrating the conversion tables LUT_R, LUT_G, and LUT_B for coloring with the conversion table of LUT3.
The conversion table of LUT3 shown in FIG. 17 is realized as a correspondence relationship that realizes contrast correction and brightness correction in one step as described above. That is, a luminance equivalent value Y obtained by correcting the luminance distribution based on the actual luminance equivalent value y of the target pixel is obtained.
[0072]
On the other hand, LUT_R, LUT_G, and LUT_B are conversion tables for expressing a predetermined monotone instructed by the coloring instruction parameter CL. If a single luminance equivalent value Y1 is input, each element color at the luminance equivalent value is input. RGB gradation values are obtained. Of course, by referring to the LUT 3 with the luminance equivalent value y before correction and referring to the LUT_R, LUT_G, and LUT_B with the referenced luminance equivalent value Y1, the optimum luminance distribution can be corrected with respect to the luminance equivalent value y before correction. In this way, RGB gradation values colored to a desired color are obtained. LUT4R, LUT4G, and LUT4B shown in the figure are obtained by integrating conversion tables so that this can be realized by one conversion.
[0073]
When the analysis of the feature amount and the setting of the luminance correspondence are completed as described above, the image data conversion process is executed in step 160. FIG. 18 shows a more detailed flowchart of the image data conversion process.
In the conversion of the image data, the image data of each pixel is corrected while moving the target pixel as shown in FIG. The position of the target pixel is indicated by a pointer. In step 510, the pointer is moved to the initial position. In step 515, the luminance equivalent value y of the target pixel is calculated in the same manner as described above, and in steps 520 to 530, the conversion table LUT4 is referred to with the luminance equivalent value y, and each color component R ′, G ′, B ′ is calculated. Ask for. The conversion itself is now complete, and the corrected image data is output in step 535. Thereafter, in step 540, the pointer is moved to the next pixel. At this time, if it is determined in step 545 that all pixels have been completed, the image data conversion process is terminated, and it is determined that all pixels have not been completed. For example, the processing from step 515 onward is repeated.
[0074]
In this embodiment, the luminance equivalent value is calculated twice at the time of the luminance distribution aggregation processing and at the time of image data conversion. However, as shown by the wavy line in FIG. Is output and the brightness distribution is aggregated and stored in the work area, the image data conversion process can read the brightness equivalent value of each pixel from this work area and execute the process. You do n’t have to. Further, when saving as a luminance equivalent value in this way, there is one element per pixel. For this reason, 1 byte of 1/3 is sufficient as compared with the case of using a total of 3 bytes for each RGB component. Therefore, the file capacity is 1/3 that of the original image data.
[0075]
Next, the operation of the present embodiment configured as described above will be described.
Assuming that the image data captured by the digital still camera 11b is to be printed in sepia, the user launches an application 12d such as image printing software on the computer system 10 and uses a cable connection or removable media. Image data is taken in from the digital still camera 11b. Then, “Sepia” is selected as the image processing from the operation menu of the application 12d, and “Print” processing is selected. The outline of this process is executed according to the flowchart shown in FIG. In this case, since the image data has already been captured, it is assumed that the input processing in step 110 has been executed, and the processing in steps 120 to 140 is executed. That is, the luminance equivalent value for each pixel is obtained, and the luminance distribution is totaled over all pixels. It should be noted that the summation result need not be strict, and may be summed up for the thinned out pixels rather than over all the pixels.
[0076]
Here, description will be made with reference to specific subjects and photographs. Assume that the subject is a ball shown in FIG. This ball has a belt-like color-coded pattern. If you compare it to the earth, it is assumed that the ball is lighter on the north and south poles and darker on the equator. When the digital still camera 11b photographed as a color image, it became as shown in FIG.19 (b). Although the photograph itself is an image with a narrow contrast, since it is a color image, the band-like color-coded pattern can be recognized from the difference in color. In the drawing, the band is shown in the sense that the color classification is understood, although it does not correspond to the color density. If an image with such a low contrast is converted into a monotone as it is, a band-like pattern that can barely be identified as shown in FIG.
[0077]
However, in the feature amount analysis brightness correspondence setting process executed as step 150, the conversion table LUT3 for deriving the contrast width Ydif or the median value Ymed of the image data from the brightness distribution and improving this is obtained. Form. In addition, since the conversion table LUT4 for coloring a sepia tone monotone is formed while taking advantage of the correspondence relationship for improving the luminance distribution, if the image data is modified based on the conversion table LUT4, the contrast width is improved. However, the brightness is also well distributed. Of course, as a result, the entire image becomes a sepia-tone monotone image, and the band pattern can be recognized as it is as a monotone image as shown in FIG. That is, multi-stage processing with completely different properties such as monochrome image correction and coloring in a certain color is performed by batch conversion, and the result is very good image quality as a monotone image.
[0078]
In this way, when color image data is input and monotonized, the luminance distribution in the image data is tabulated (steps 120 to 140), and the luminance correspondence is set using the tabulation result (step 150). Since the image data is modified based on the luminance correspondence and converted to a monotone image, the image quality can be improved as compared to the case where the monotone image is simply converted based on the luminance alone. It is possible to perform a multi-stage conversion of improving the luminance distribution and coloring process all at once.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram corresponding to a claim of a monotone conversion device according to an embodiment of the present invention;
FIG. 2 is a block diagram of hardware embodying the monotone conversion device.
FIG. 3 is a schematic block diagram showing another application example of the monotone conversion device of the present invention.
FIG. 4 is a schematic block diagram showing another application example of the monotone conversion device of the present invention.
FIG. 5 is a main flowchart in the monotone conversion apparatus of the present invention.
FIG. 6 is a diagram illustrating a configuration of an image data file.
FIG. 7 is a diagram illustrating a state in which a processing target pixel is moved.
FIG. 8 is a flowchart of feature amount analysis brightness correspondence setting processing;
FIG. 9 is a diagram showing a luminance distribution (a) and a conversion relationship (b) when the luminance distribution needs to be enlarged.
FIG. 10 is a diagram showing a luminance distribution end processing (a) and a conversion table (b) when the luminance distribution is enlarged;
FIG. 11 is a diagram illustrating a concept (a) for brightening, a concept (b) for darkening, and a method (c) by γ correction.
FIG. 12 is a diagram illustrating a correspondence relationship between an evaluation value of brightness and γ.
FIG. 13 is a flowchart of LUT integration processing.
FIG. 14 is a diagram showing an LUT integration process;
FIG. 15 is a flowchart of a coloring LUT integration process.
FIG. 16 is a diagram showing a correspondence relationship (a) for determining a component so that the ratio of each component is constant for coloring in monotone, and a configuration in which the ratio of each component is constant at an optimum gradation value. It is a graph which shows the correspondence (b) which determines a minute.
FIG. 17 is a diagram illustrating a process of integrating coloring LUTs.
FIG. 18 is a flowchart of image data conversion processing.
FIG. 19 is a diagram showing a ball (a) of a subject and a color image (b) thereof.
FIG. 20 is a diagram of an image (a) when normal monotoning is performed and an image (b) when monotoning of the present invention is performed.
[Explanation of symbols]
10. Computer system
11a ... Scanner
11a2 ... Scanner
11b ... Digital still camera
11b1 ... Digital still camera
11b2 ... Digital still camera
11c ... Video camera
12 ... Computer body
12a ... Operating system
12b ... Display driver
12b ... Driver
12c: Printer driver
12d Application
13a ... floppy disk drive
13b ... Hard disk
13c ... CD-ROM drive
14a ... modem
14a2 Modem
15a ... Keyboard
15b ... Mouse
17a ... Display
17a1 ... Display
17b ... Color printer
17b1 Color printer
17b2 ... Color printer
18a ... Color facsimile machine
18b ... color copying machine

Claims (7)

画像をドットマトリクス状の各画素として表すとともに色分解した所定の要素色で各画素毎に階調表現した画像データを取得する画像取得手段と、
上記画像データに基づいて各画素の輝度相当値の集計を行なう輝度分布集計手段と、
輝度相当値を変換することにより輝度分布を変更する輝度変換テーブルを、上記集計された輝度分布に基づいて導出するとともに、輝度相当値を所定の色調のモノトーンを表現する要素色に変換するための要素色毎の変換テーブルを設定し、当該輝度変換テーブルを当該要素色毎の変換テーブルそれぞれに統合することにより要素色毎の統合変換テーブルを生成するテーブル設定手段と、
上記要素色毎の統合変換テーブルそれぞれに上記画像データにおける各画素の輝度相当値を入力させ、各統合変換テーブルによる変換結果として各画素の要素色毎の階調値を得ることにより上記所定の色調のモノトーンの画像データを取得する画像データ変換手段とを具備することを特徴とするモノトーン変換装置。
Image acquisition means for expressing the image as each pixel in a dot matrix and acquiring image data expressed in gradation for each pixel with a predetermined element color obtained by color separation;
A luminance distribution summary means for aggregation of luminance equivalent value of each pixel based on the image data,
A luminance conversion table for changing the luminance distribution by converting the luminance equivalent value is derived on the basis of the aggregated luminance distribution, and the luminance equivalent value is converted into an element color expressing a monotone having a predetermined tone. A table setting unit that sets a conversion table for each element color and generates an integrated conversion table for each element color by integrating the luminance conversion table with each conversion table for each element color;
By inputting the luminance equivalent value of each pixel in the image data to each integrated conversion table for each element color, and obtaining the gradation value for each element color of each pixel as a conversion result by each integrated conversion table, the predetermined color tone A monotone conversion apparatus comprising: image data conversion means for acquiring monotone image data of the above.
上記請求項1に記載のモノトーン変換装置において、In the monotone conversion device according to claim 1,
モノトーンの色調を指示する着色指示を外部からの入力に応じて取得する手段を備え、  Means for obtaining a coloring instruction for instructing a monotone color tone in response to an external input;
上記テーブル設定手段は、輝度相当値と上記取得された着色指示が示す色のモノトーンを表現する要素色との変換関係を規定した要素色毎の変換テーブルに、上記輝度変換テーブルを統合することを特徴とするモノトーン変換装置。  The table setting means integrates the luminance conversion table into a conversion table for each element color that defines the conversion relationship between the luminance equivalent value and the element color representing the monotone of the color indicated by the acquired coloring instruction. Characteristic monotone conversion device.
上記請求項1または請求項2に記載のモノトーン変換装置において、上記テーブル設定手段は、各要素色間の構成比を上記所定の色調のモノトーンを表現するための割合とする上記要素色毎の変換テーブルとして、ある輝度相当値で一定の構成比を実現しつつ全階調値にわたって変換結果を滑らかに変化させるトーンカーブを利用することを特徴とするモノトーン変換装置。In monotone conversion apparatus according to claim 1 or claim 2, the table setting means converts the composition ratio of each element colors of the elements each color to percentage for representing monotone of the predetermined tone A monotone conversion apparatus using a tone curve that smoothly changes a conversion result over all gradation values while realizing a constant composition ratio with a certain luminance equivalent value as a table . 上記請求項1〜請求項3のいずれかに記載のモノトーン変換装置において、上記テーブル設定手段は、上記輝度分布に基づいて導かれる最大輝度から最小輝度までの範囲をコントラストの幅としつつ、当該コントラストの幅を適正な幅となるようにオリジナルの輝度から修整された輝度へ変換する輝度変換テーブルを導出することを特徴とするモノトーン変換装置。4. The monotone conversion device according to claim 1, wherein the table setting unit sets the contrast range while setting a range from the maximum luminance to the minimum luminance derived based on the luminance distribution as a contrast width. A monotone conversion device for deriving a luminance conversion table for converting from original luminance to modified luminance so that the width of the image becomes an appropriate width. 上記請求項1〜請求項4のいずれかに記載のモノトーン変換装置において、上記テーブル設定手段は、上記輝度分布に基づいて導かれる画像の明るさが適正範囲にない場合に同輝度分布が全体として適正な分布となるようにオリジナルの輝度から修整された輝度へ変換する輝度変換テーブルを導出することを特徴とするモノトーン変換装置。5. The monotone conversion device according to claim 1, wherein the table setting means has the same luminance distribution as a whole when the brightness of an image derived based on the luminance distribution is not within an appropriate range. A monotone conversion device for deriving a luminance conversion table for converting from original luminance to modified luminance so as to obtain an appropriate distribution. 画像をドットマトリクス状の各画素として表すとともに色分解した所定の要素色で各画素毎に階調表現した画像データを取得し、モノトーン画像データを生成して出力するモノトーン変換方法であって、
上記画像データに基づいて各画素の輝度相当値の集計を行なう工程と、
輝度相当値を変換することにより輝度分布を変更する輝度変換テーブルを、上記集計された輝度分布に基づいて導出するとともに、輝度相当値を所定の色調のモノトーンを表現する要素色に変換するための要素色毎の変換テーブルを設定し、当該輝度変換テーブルを当該要素色毎の変換テーブルそれぞれに統合することにより要素色毎の統合変換テーブルを生成する工程と、
上記要素色毎の統合変換テーブルそれぞれに上記画像データにおける各画素の輝度相当値を入力させ、各統合変換テーブルによる変換結果として各画素の要素色毎の階調値を得ることにより上記所定の色調のモノトーンの画像データを取得する工程とを具備することを特徴とするモノトーン変換方法。
A monotone conversion method for representing an image as a pixel in a dot matrix and obtaining image data expressed in gradation for each pixel with a predetermined element color obtained by color separation, and generating and outputting monotone image data,
A step of tabulating the luminance equivalent value of each pixel based on the image data;
A luminance conversion table for changing the luminance distribution by converting the luminance equivalent value is derived on the basis of the aggregated luminance distribution, and the luminance equivalent value is converted into an element color expressing a monotone having a predetermined tone. Setting a conversion table for each element color, and generating an integrated conversion table for each element color by integrating the luminance conversion table into each conversion table for each element color; and
By inputting the luminance equivalent value of each pixel in the image data to each integrated conversion table for each element color, and obtaining the gradation value for each element color of each pixel as a conversion result by each integrated conversion table, the predetermined color tone monotone conversion method characterized by comprising the step of obtaining a monotone image data.
像をドットマトリクス状の各画素として表すとともに色分解した所定の要素色で各画素毎に階調表現した画像データを取得し、モノトーン画像データを生成する処理をコンピュータに実行させるモノトーン変換プログラムを記録した媒体であって、
上記画像データに基づいて各画素の輝度相当値の集計を行なう機能と、
輝度相当値を変換することにより輝度分布を変更する輝度変換テーブルを、上記集計された輝度分布に基づいて導出するとともに、輝度相当値を所定の色調のモノトーンを表現する要素色に変換するための要素色毎の変換テーブルを設定し、当該輝度変換テーブルを当該要素色毎の変換テーブルそれぞれに統合することにより要素色毎の統合変換テーブルを生成する機能と、
上記要素色毎の統合変換テーブルそれぞれに上記画像データにおける各画素の輝度相当値を入力させ、各統合変換テーブルによる変換結果として各画素の要素色毎の階調値を得ることにより上記所定の色調のモノトーンの画像データを取得する機能とを上記コンピュータに実行させることを特徴とするモノトーン変換プログラムを記録した媒体。
The images acquired image data gradation representation for each pixel in a predetermined element color that color separation with expressed as each pixel of the dot matrix, a monotone conversion program for executing processing for generating a monotone image data to the computer A recording medium,
A function of counting the luminance equivalent values of each pixel based on the image data;
A luminance conversion table for changing the luminance distribution by converting the luminance equivalent value is derived on the basis of the aggregated luminance distribution, and the luminance equivalent value is converted into an element color expressing a monotone having a predetermined tone. A function for generating an integrated conversion table for each element color by setting a conversion table for each element color and integrating the luminance conversion table into each conversion table for each element color;
By inputting the luminance equivalent value of each pixel in the image data to each integrated conversion table for each element color, and obtaining the gradation value for each element color of each pixel as a conversion result by each integrated conversion table, the predetermined color tone A medium having a monotone conversion program recorded thereon, which causes the computer to execute a function of acquiring the monotone image data.
JP21495099A 1998-07-31 1999-07-29 Monotone conversion apparatus, monotone conversion method, and medium recording monotone conversion program Expired - Fee Related JP4359730B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21495099A JP4359730B2 (en) 1998-07-31 1999-07-29 Monotone conversion apparatus, monotone conversion method, and medium recording monotone conversion program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP10-217539 1998-07-31
JP21753998 1998-07-31
JP21495099A JP4359730B2 (en) 1998-07-31 1999-07-29 Monotone conversion apparatus, monotone conversion method, and medium recording monotone conversion program

Publications (2)

Publication Number Publication Date
JP2000105820A JP2000105820A (en) 2000-04-11
JP4359730B2 true JP4359730B2 (en) 2009-11-04

Family

ID=26520604

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21495099A Expired - Fee Related JP4359730B2 (en) 1998-07-31 1999-07-29 Monotone conversion apparatus, monotone conversion method, and medium recording monotone conversion program

Country Status (1)

Country Link
JP (1) JP4359730B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007067815A (en) * 2005-08-31 2007-03-15 Olympus Imaging Corp Image processing device and image processing method
JP2007206107A (en) * 2006-01-31 2007-08-16 Olympus Corp Microscope imaging apparatus, microscope imaging method, and information storage medium
JP2007266955A (en) 2006-03-28 2007-10-11 Sony Corp Imaging apparatus, video signal processing circuit, video signal processing method and computer program
JP5121786B2 (en) 2009-07-10 2013-01-16 キヤノン株式会社 Image processing method, image processing apparatus, and program
JP5501425B2 (en) * 2012-10-23 2014-05-21 キヤノン株式会社 Image processing method, image processing apparatus, and program

Also Published As

Publication number Publication date
JP2000105820A (en) 2000-04-11

Similar Documents

Publication Publication Date Title
US6608926B1 (en) Image processing method, image processing apparatus and recording medium
US7945109B2 (en) Image processing based on object information
US7940434B2 (en) Image processing apparatus, image forming apparatus, method of image processing, and a computer-readable storage medium storing an image processing program
US6535301B1 (en) Image processing apparatus, image processing method, image processing program recording medium, color adjustment method, color adjustment device, and color adjustment control program recording medium
KR100788053B1 (en) Color conversion method and profile generation method
JP3376194B2 (en) Image processing apparatus and method
JP4067532B2 (en) Color conversion apparatus, image forming apparatus, color conversion method, computer program, and recording medium
US7903872B2 (en) Image-processing apparatus and method, computer program, and storage medium
JP3989738B2 (en) Image forming method, image forming apparatus, program, and recording medium
JP2011018354A (en) Medium recording image modifying program, image modifying apparatus and method
US20080062484A1 (en) Image processing device and image processing method
US7027088B1 (en) Color to monotone conversion apparatus, color to monotone conversion method and a medium recording thereon a color to monotone conversion program
JP4637686B2 (en) Color conversion apparatus, image forming apparatus, color conversion method, and computer program
JP2004312387A (en) Image processing method, image processing device, image forming device, image pickup device, and computer program
US20050068587A1 (en) Monotone conversion process for color images
JP2003219191A (en) Image processor and image forming apparatus comprising it
JP4359730B2 (en) Monotone conversion apparatus, monotone conversion method, and medium recording monotone conversion program
WO2009093294A1 (en) Image signal processing device and image signal processing program
JP4112413B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and computer-readable recording medium on which image processing program is recorded
JP4533277B2 (en) Image processing apparatus, image processing method, and table creation method
JP2004112494A (en) Image processor, image processing method and recording medium
JP2002094826A (en) Image processing unit, image forming unit and method for processing image
JP2007194683A (en) Color adjustment method, color adjustment apparatus, and color adjustment program
JP2002314827A (en) Image processing method, image processing device, image forming device equipped therewith, image processing program, and recording medium
JP4101741B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing program, and recording medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060719

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090424

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090508

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090625

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090715

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090728

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120821

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130821

Year of fee payment: 4

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees