JP3950501B2 - Image processing method and apparatus, and storage medium - Google Patents

Image processing method and apparatus, and storage medium Download PDF

Info

Publication number
JP3950501B2
JP3950501B2 JP29000696A JP29000696A JP3950501B2 JP 3950501 B2 JP3950501 B2 JP 3950501B2 JP 29000696 A JP29000696 A JP 29000696A JP 29000696 A JP29000696 A JP 29000696A JP 3950501 B2 JP3950501 B2 JP 3950501B2
Authority
JP
Japan
Prior art keywords
image
brightness
pixel
brush pattern
conversion
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
JP29000696A
Other languages
Japanese (ja)
Other versions
JPH10134178A (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.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP29000696A priority Critical patent/JP3950501B2/en
Publication of JPH10134178A publication Critical patent/JPH10134178A/en
Application granted granted Critical
Publication of JP3950501B2 publication Critical patent/JP3950501B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、メモリ上に展開された、2次元カラー画像または白黒多値画像に対して、加工処理を行なう画像処理方法および装置および該方法を実現するためのコンピュータプログラムを記憶した記憶媒体に関するものである。
【0002】
【従来の技術】
従来、2次元カラー画像または白黒多値画像に対して、ユーザの好みに合わせた加工処理を行なう場合には、いくつかの処理を重ね合わせたり、パラメータを指定したりするなどしていた。
【0003】
【発明が解決しようとする課題】
しかしながら、上記従来の技術では、見映えの良い加工結果を得るためには、多くの指示を必要とするので、画像処理の知識がそれほど多くない一般ユーザが、好みに合わせた思い通りの加工画像を得ることは、非常に困難であった。つまり、一般ユーザが、見映えの良い加工画像を得たいと思った場合には、ある程度、画像処理の知識を学んだり、試行錯誤を繰り返したりしなければならなかった。
【0004】
本発明は上記問題点を解決するためになされたもので、特に、ユーザの簡単な指示により、入力された2次元カラー画像または白黒多値画像から、その明るさなどの性質には依存せずに、より見映えの良い、効果的な白黒画像を得ることができる画像処理方法および装置および記憶媒体を提供することを目的とする。
【0005】
【課題を解決するための手段】
上記目的を達成するために、本発明に係る画像処理装置は、白黒多値画像を記憶する画像記憶手段と、前記画像記憶手段に記憶された白黒多値画像のヒストグラムを作成するヒストグラム作成手段と、前記画像記憶手段に記憶された白黒多値画像の明るさのピークを検出するピーク検出手段と、前記ヒストグラム作成手段により作成されたヒストグラムと、前記ピーク検出手段により検出された明るさのピークとに基づいて、前記白黒多値画像の明るさを平均化する変換を行う平均化変換手段と、前記平均化変換手段によって変換された画像の明るさに強弱を付ける変換を行う強弱変換手段と、前記強弱変換手段によって変換された白黒多値画像を二値データに変換する二値化変換手段と、前記二値化変換手段により変換された画像の画素と、該画素の近傍の画素とに、ペンによる描画を模したブラシパターンを配置するブラシパターン配置手段と、前記ブラシパターン配置手段によるブラシパターンの配置の際に、ある画素に対して、与えられたブラシパターンの各要素を配置するか否かを判定する配置判定手段とを有し、前記配置判定手段は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差に基づいて、前記ブラシパターン配置手段によるブラシパターンの配置を行うことを設けた。
【0006】
また好ましくは、2次元カラー画像を白黒多値画像に変換するグレー変換手段を含み、前記画像記憶手段は、前記グレー変換手段により変換された白黒多値画像を記憶する。
【0009】
また好ましくは、前記配置判定手段は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差が予め定められた値よりも大きい場合、前記ブラシパターン配置手段によるブラシパターンの配置を行わない。
【0013】
また好ましくは、前記配置判定手段は、前記白黒多値画像の各画素の明るさの値に基づいて、前記ブラシパターン配置手段によるブラシパターンの配置を行う。
【0014】
また、上記目的を達成するために、本発明に係る画像処理方法は、画像記憶手段に記憶された白黒多値画像のヒストグラムを作成するヒストグラム作成工程と、前記画像記憶手段に記憶された白黒多値画像の明るさのピークを検出するピーク検出工程と、前記ヒストグラム作成工程で作成されたヒストグラムと、前記ピーク検出工程で検出された明るさのピークとに基づいて、前記白黒多値画像の明るさを平均化する変換を行う平均化変換工程と、前記平均化変換工程によって変換された画像の明るさに強弱を付ける変換を行う強弱変換工程と、前記強弱変換工程によって変換された白黒多値画像を二値データに変換する二値化変換工程と、前記二値化変換工程により変換された画像の画素と、該画素の近傍の画素とに、ペンによる描画を模したブラシパターンを配置するブラシパターン配置工程と、前記ブラシパターン配置工程によるブラシパターンの配置の際に、ある画素に対して、与えられたブラシパターンの各要素を配置するか否かを判定する配置判定工程とを有し、前記配置判定工程は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差に基づいて、前記ブラシパターン配置工程によるブラシパターンの配置を行うことを設けた。
【0015】
また好ましくは、2次元カラー画像を白黒多値画像に変換するグレー変換工程を含み、前記画像記憶手段は、前記グレー変換工程で変換された白黒多値画像を記憶する。
【0018】
また好ましくは、前記配置判定工程は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差が予め定められた値よりも大きい場合、前記ブラシパターン配置工程によるブラシパターンの配置を行わない。
【0022】
また好ましくは、前記配置判定工程において、前記白黒多値画像の各画素の明るさの値に基づいて、前記ブラシパターン配置工程でのブラシパターンの配置を行う。
【0023】
また、上記目的を達成するために、本発明に係る画像処理方法を実現するためのコンピュータプログラムを格納し、コンピュータにより呼び出し可能な記憶媒体は、画像記憶手段に記憶された白黒多値画像のヒストグラムを作成するヒストグラム作成工程と、前記画像記憶手段に記憶された白黒多値画像の明るさのピークを検出するピーク検出工程と、前記ヒストグラム作成工程で作成されたヒストグラムと、前記ピーク検出工程で検出された明るさのピークとに基づいて、前記白黒多値画像の明るさを平均化する変換を行う平均化変換工程と、前記平均化変換工程によって変換された画像の明るさに強弱を付ける変換を行う強弱変換工程と、前記強弱変換工程によって変換された白黒多値画像を二値データに変換する二値化変換工程と、前記二値化変換工程により変換された画像の画素と、該画素の近傍の画素とに、ペンによる描画を模したブラシパターンを配置するブラシパターン配置工程と、前記ブラシパターン配置工程によるブラシパターンの配置の際に、ある画素に対して、与えられたブラシパターンの各要素を配置するか否かを判定する配置判定工程とを有し、前記配置判定工程は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差に基づいて、前記ブラシパターン配置工程によるブラシパターンの配置を行うことを有する。
【0024】
【発明の実施の形態】
(実施形態1)
以下、図面を参照して本発明の実施形態1を説明する。
【0025】
図1は、本発明の実施形態1に係るデータ処理装置の概略構成を示すブロック図である。
【0026】
本実施形態1に係るデータ処理装置は、CPU(中央処理装置)1、ROM(リードオンリメモリ)2、RAM(ランダムアクセスメモリ)3、キーボード4、マウス5、表示器6、および外部記憶装置7により構成され、これら各構成要素はバスライン8により互いに接続されている。なお、システム構成によっては、後述するシステムプログラムや画像加工処理プログラムなどは、ROM2のかわりにハードディスクなどのような外部記憶装置に格納されていてもよい。
【0027】
CPU1は、例えばマイクロプロセッサ形態であり、本装置各部の動作を制御する。ROM2は、システムプログラム2a、並びに本発明による画像加工処理プログラム2b1を含み、その他の各種処理を指示したりするための画像アプリケーションプログラム2bを格納する。
【0028】
RAM3は、加工する元になる元画像を格納するための元画像領域3a1、加工する前の元画像を後まで残しておく場合に、加工した結果の画像を格納するための加工用画像領域3a2、本発明による加工処理で必要となるヒストグラムテーブル3b、明るさの平均化変換テーブル3c、明るさ変換テーブル3d、およびその他の管理・ワーク領域3f等により構成されている。
【0029】
元画像領域3a1は、加工を行なう元になる画像の領域である。外部記憶装置7から画像を読み込むと、まずここに格納される。何らかの加工処理などを行なったが加工結果が気にいらなかった場合などに元に戻す場合などにこの元画像を用いる。また何らかの加工を行なう場合には、この元画像を元に、これに対して加工を行ない、加工結果の画像は加工用画像領域3a2に格納する。本実施形態1ではこの流れで説明しているが、いったん加工を行なった画像に対して再び同じ、あるいは別の加工を行なう仕様やモードの場合には、元画像領域3a1の元画像ではなく、加工処理がすでに行なわれた加工用画像領域3a2の加工用画像に対して加工を行なう。その場合、最初の画像を記憶しておく必要がなく、また復元用の画像領域も必要がないなどの条件が揃えば、元画像領域3a1と加工用画像領域3a2が同じ領域を使用するようにして使用メモリの削減を図ることも可能である。
【0030】
画像が全体的に明るい(白っぽい)場合や、逆に暗い(黒っぽい)場合には、何らかの加工処理を行なうと、ぼやけてしまったり、さらに明るい、あるいは暗い方に片寄って加工されてしまったりするなど、元の画像の印象が薄れたり壊れてしまったりする場合もある。そのような場合には、本実施形態1で行なっているように、画像全体の明るさを平均的になるように変換する処理が有効となる。その場合に、ヒストグラムテーブル3bを利用することになる。
【0031】
ヒストグラムテーブル3bとは、明るさを白から黒までの間の何段階かに分割し、ある画像について、1画素1画素がそれぞれどの段階に収まるかを検出してそれぞれの段階の画素数の和を求めたものである。このヒストグラムテーブル3bによるヒストグラムの形状により、その画像が全体的に明るい、あるいは暗いなどの性質を定量的に見ることが可能となる。このヒストグラムテーブル3bを元に、加工する画像の明るさの性質を判定し、画像全体の明るさを平均化するために作成・参照するテーブルが明るさ平均化変換テーブル3cである。
【0032】
本実施形態1では、加工後の画像の見映えをさらに良くするために、明るさの平均化に加えて、さらに明るさのメリハリを付けるために、もう一度異なる明るさの変換処理を行なう。そのために用いるのが明るさ変換テーブル3dである。本実施形態1で説明する明るさ変換テーブル3dは、少しでも明るい部分はさらに明るく、逆に少しでも暗い部分はさらに暗く変換することにより、明るさに強弱を付ける処理を行なう。
【0033】
その他の各種情報やデータを管理したり、ワークとして使用したりするための領域がその他の管理・ワーク領域3fである。
【0034】
キーボード4は、ユーザが文字・数字・記号等のデータの入力、及びCPU1に対する各種指示を行なうためのものである。マウス5は、表示器6上に表示されている各種情報を指示することにより、CPU1に対して各種指示を行なう。マウスの代わりにトラックボール、ペン、またはタッチパネル等の方式を用いても良い。表示器6は、LCD等により構成され、CPU1の制御により各種データの表示を行なう。外部記憶装置7は、例えばフロッピーディスク等のメディアからなり、該外部記憶装置7からCPU1の制御により読み出された各種データは、バスライン8を介してRAM3上で展開される。
【0035】
以上の構成の下で、本実施形態1の動作を図8〜11のフローチャートと図2〜7の各種データ・テーブル構成および処理概要の例を参照して説明する。図8に示すフローチャートは、本実施形態1による画像加工処理の全体の流れを示している。図9に示すフローチャートは、入力画像をグレーの画像に変換し、明るさのヒストグラムを作成する手法の一例を示している。図10に示すフローチャートは、グレーに変換した画像の明るさを平均化するための処理の流れを示している。図11に示すフローチャートは、作成された明るさ平均化変換テーブルと3cと、明るさ変換テーブル3dを用いて画像を変換する処理の流れを示している。
【0036】
図2は、本実施形態1で説明する画像の構造の例を示す。
【0037】
この図2において、画像の1画素は、赤を示す「R」、緑を示す「G」、青を示す「B」それぞれ1バイト(=8ビット)の、計3バイトから構成され、RとGとBのセットで、カラー画像の1画素を表す。ここで、R、G、Bはそれぞれ0〜255の値を持つことができ、255に近いほど赤、緑、青の原色に近く、0に近いほど白に近い色になる。また、R=G=B=0の場合に黒になり、R=G=B=255の場合には白になる。
【0038】
そして、このような構成を持つ画像は、256の3乗である1670万色を表現できる。
【0039】
ところで、本実施形態1では、画像をまずグレーに変換するが、カラーの入力画像から白黒画像を得るために、ここでは「グレー画素値=0.3*(Rの値)+0.6*(Gの値)+0.1*(Bの値)」の式で求める。すべての画素に対して、得られた「グレー画素」を変換後のR、G、Bの値とすることにより、グレーに変換された画像を得ることができる。図26の画像4が、元画像である画像3をグレー変換した例である。グレー値が0の画素は黒、255の画素は白であり、0に近いほど黒っぽい色に、255に近いほど白っぽい色になる。本実施形態1の説明では、黒っぽい色を「暗い」、白っぽい色を「明るい」という表現も用いている。説明を簡単にするために、図3以降の説明では、グレー値を0〜23の24段階で説明する部分もある。
【0040】
次に、図3、図4に、画像ごとに異なるヒストグラムの例を示す。全体的に黒っぽい(暗い)画像になるのは、図3のように黒に近い所に画素が多い場合であり、また、全体的に白っぽい(明るい)画像になるのは、図4のように白に近い所に画素が多い場合である。
【0041】
また、図5は、得られたヒストグラムから、画像の明るさを平均化するための明るさ平均化テーブルの例を示している。
【0042】
次に、図6に、さらに明るさのメリハリを付けるために使用する明るさ変換テーブルの例を示す。ここでは、ガンマ変換による変換を行っている。この図6を見ればわかるように、少しでも暗いところは、より暗く変換され、また、少しでも明るいところは、より明るく変換される。したがって、変換対象となる画像は、明るさと暗さの差が大きい、メリハリのある画像に変換される。
【0043】
また、図7は、明るさ変換テーブルの他の例を示す図であり、ここでは、結果となる画像の明るさが段階的になる。ここでは、全体的な明るさにはそれほど差がでないが、ある範囲の間の明るさのところが一定の明るさに変換される。
【0044】
以下、図8〜11のフローチャートと、先程説明した図2〜7を用いて、処理の流れを説明する。ただし、画像アプリケーションなどを起動し、各種初期処理を行なうフローや、画像を呼び出したりするなどの処理のフローは、図8のフローチャートでは省略する。
【0045】
まず、画像アプリケーションが起動されると、ROM2から画像アプリケーションプログラム2bや本実施形態1のように画像を加工するための画像加工処理プログラム2b1が読み出される。ただし、画像加工処理プログラム2b1は、画像アプリケーションから画像加工処理が起動された時に読み出されるようにすれば、無駄な領域を使わないために効果的である。
【0046】
画像の加工に必要となる各種情報や領域は、RAM3上に確保される。画像を外部記憶装置7などから呼び出すために必要となる元画像データ領域3a1や、画像の加工処理で必要となる加工用画像データ領域3a2は、起動時に確保しても良いが、それぞれが必要となった時点で確保するようにすれば、やはり無駄な領域を使わないため、他にメモリ領域を使用する他の処理を行なう際などに効果的である。
【0047】
ヒストグラムテーブル3bは、明るさの段階数だけの要素数を必要とする。本実施形態1では、0〜255の256段階であるため、256の要素数を持つ配列をあらかじめ確保しておくか、または、必要となった時に確保する。ヒストグラムテーブル3bの各要素には、それぞれの明るさにはいくつの画素があるかの画素数が格納される。明るさ平均化変換テーブル3c、明るさ変換テーブル3dもヒストグラムテーブル3bと同様に、明るさの段階数だけの要素数を必要とする。これらの変換テーブルは、注目している画素の明るさを入力とし、その明るさの場合はどの明るさに変換されるかを出力としている。
【0048】
これらの領域も、あらかじめ確保しておくか、または、必要となった時に確保しても良い。ただし、明るさ平均化テーブル3cは入力となる画像によってテーブルの値が異なるので、入力画像(元画像)が変わって画像加工処理が呼ばれたりする度に計算して構築しなければならないが、明るさ変換テーブル3dは入力となる画像には依存しないものであるため、あらかじめ作成しておき、プログラム内に値を固定したテーブルとして格納しておけば、画像アプリケーションが起動されたり、または画像加工処理が起動されたりする度にテーブル構築のための計算をせずに済むため、効率的である。その他の管理・ワーク領域3fも、アプリケーション起動時にあらかじめ確保するか、または、必要となった時に確保しても良い。
【0049】
画像アプリケーションで加工したい画像を呼び出し、本実施形態1における画像加工処理を画像アプリケーションで指示すると、図8のフローチャートのステップS1以降の処理に入る。この時、元画像データ領域3a1には、呼び出された画像データが格納されている。ステップS1では、呼び出されている画像を元にして、これから加工処理を行なうための加工用画像を作成する。ただし、画像アプリケーションを起動し、画像を呼び出した時点で、表示器に表示したりするために呼び出した画像を加工用画像領域3a2に予め複写するなどにより、すでに加工する元となるデータが加工用画像領域3a2に作成されている場合は、このステップは行なわなくても良い。また、例えば加工結果の画像は元の画像を拡大・縮小などのように変倍したものとするような場合には、ここで加工用画像を作成する場合にあらかじめ変倍しても良い。
【0050】
加工用画像領域3a2にこれから加工処理を行なう画像が作成されると、ステップS2で、これから加工処理を行なうために必要となる情報やテーブルなどの初期化などを行なう初期処理を行なう。本実施形態1では、ヒストグラムテーブル3bのクリアなどを行なう。
【0051】
ステップS2までで加工処理の準備が整うと、ステップS4で、加工する元となるデータをグレーに変換し(ステップS4−1)、ヒストグラムを作成する処理を行なう(ステップS4−2)。ただし、入力となる画像が白黒多値画像の場合は、グレーに変換する処理は省略することができる。
【0052】
このステップS4の処理を、図9のフローチャートを用いて、更に詳しく説明する。このステップS4では、加工用画像領域3a2の画像のすべての画素について処理を行なう。まず、ステップS4−01、ステップS4−02、ステップS4−03、ステップS4−04、ステップS4−05、およびステップS4−06は、すべての画素について処理を行なうための行および桁のループを示すものであるため、詳しい説明は省略する。また、ステップS4−11、ステップS4−21は、すべての画素に対して行なう、グレー変換とヒストグラム作成のための処理である。
【0053】
ステップS4−11では、注目している画素をグレーに変換する(ただし前述のように、入力となる画像が白黒多値画像の場合は、このグレー変換処理は省略することができる)。グレーの値は、本実施形態1では、「グレー画素値=0.3*(Rの値)+0.6*(Gの値)+0.1*(Bの値)」の式で求める。このグレー画素値は0から255までのいずれかの値を持つことになる。0が黒、255が白であり、0に近いほど暗く、255に近いほど明るい。その値をR、G、Bに代入したものが、元の画素をグレーに変換した後の色として見ることができる。その画像において、元の画像で明るく見えている画素は明るいグレーで、暗く見えている画素は暗いグレーで表現されることになる。すべての画素に対してこのグレー画素値を計算し、R、G、Bのそれぞれに代入すると、元の画像と同じ構造の、グレーに変換された画像を得ることができる。ただし、元の画像が白黒多値画像の場合は、その構造にしたがうものとする。
【0054】
すべての画素についてグレー変換を行なって元の画像に対するグレー画像を得た後で、その画像のヒストグラムを求めても良いが、本実施形態1では、処理時間を短縮するために、ステップS4−21でグレーに変換するのと同じループ内でヒストグラムテーブル3bの作成を行なう。ヒストグラムとは、本実施形態1で使用している画像の明るさのものを求める場合には、明るさを数段階(本実施形態1の場合は0〜255の256段階)に分割し、各段階にいくつの画素が含まれるかを算出するものである。したがって、あらかじめ確保し、ステップS2ですべての要素を0に初期化したヒストグラムテーブル3bの、注目している画素の明るさ(ステップS4−11で求めたグレー画素値)番目の値に+1する。このようにして、すべての画素について明るさを求め、その明るさの画素数を計上することにより、ヒストグラムテーブル3bが作成できる。
【0055】
次に、先程説明した図3および図4のヒストグラムの例を示しながら説明を行う。ここでは、説明を簡単にするために、明るさを0から23までの24段階として説明している。また、画像の大きさは、例えば横10画素、縦8画素というように、総画素数を80としている。図3のヒストグラムの例では、0の明るさを持つ画素数は1、1の明るさを持つ画素数は4、22の明るさを持つ画素数は0である。このヒストグラムでは、3の明るさを持つ画素数が最も多く、また、全体的に0の明るさに近い方が画素数が多いという分布を持っていることから、全体的に暗い画像であることが分かる。同様に、図4のヒストグラムの例では、0の明るさを持つ画素数は0、22の明るさを持つ画素数は1、23の明るさを持つ画素数は1であり、また画素数が最も多いのは18の明るさを持ち、全体的に24の明るさに近い方が画素数が多いという分布を持っていることから、全体的に明るい画像であることが分かる。
【0056】
ステップS4の処理が終わると、加工用画像領域3a2には、元画像領域3a1の元画像をグレーに変換した画像が出来、またヒストグラムテーブル3bには、その画像の明るさのヒストグラムが出来上がる。加工用画像領域3a2の画像は、ステップS4の説明で述べたように、元画像の性質によって、全体的に暗い、または明るいなど、明るさに関して片寄った画像である場合がある。本実施形態1では、グレーに変換された画像の明るさを平均化することにより、画像の劣化を最小限にとどめ、見映えの良い加工結果を得るために、ステップS5以降で明るさの変換を行なう。
【0057】
ステップS5では、ステップS4で求めたヒストグラムを元にして、明るさを平均化する際のパラメータとなる、明るさ平均化変換後に中心となる明るさを求める。その流れを、図10のフローチャートで示す。
【0058】
ステップS5−1では、明るさの中心とする画素数の割合をセットする。ここで、変換後の画像の明るさとして、明るい部分と暗い部分を同じ程度にしたい場合には1/2を、少し暗くしたい場合には1/2よりも大きく、少し明るくしたい場合には1/2よりも小さく割合をセットすれば良い(例えば、総画素数の2/5に達したところの明るさを変換後の明るさの中心とする場合は2/5)。1/2よりも大きくすると、変換後の明るさの中心よりも暗い部分に総画素数の1/2よりも多い数の画素が、逆に1/2よりも小さくすると、変換後の明るさの中心よりも明るい部分に総画素数の1/2よりも多い数の画素が割り当てられるからである。また、この画像アプリケーションでその割合を固定する場合には、ここでセットせず、あらかじめプログラムにその値を定数で記述しておけば良い。
【0059】
ステップS5−2では、画素数の合計を格納するカウンタに0をセットして初期化する。またステップS5−3では、画素数を合計していく明るさを示す明るさポインタを0に初期化する。ステップS5−4以降で、求める明るさが求まるまで、各明るさの画素数をカウンタに加えていく。求める明るさは、総画素数にステップS5−1でセットした割合を掛けることによって得られた画素数に、カウンタ値が達した時に求めることができる(ステップS5−5、ステップS5−6、ステップS5−7)。
【0060】
図3のヒストグラムを例にして説明する。まず、変換後の画像の明るさとして、明るい部分と暗い部分を同じ程度にすると仮定し、ステップS5−1で割合を1/2とすると、80/2=40画素目の画素が含まれる明るさを求めることになる。ステップS5−2、ステップS5−3でカウンタと明るさポインタを0に初期化する。ステップS5−4で、最初に、0の明るさを持つ画素の数をカウンタに加える。図3の場合は1であるので、カウンタの値は1となる。ステップS5−5では、カウンタの値が求めるべき画素数(この場合は40画素)を超えたかどうかを判定しているが、まだ超えないので、ステップS5−6に進み、明るさポインタに1加え、次に注目する明るさへポインタを移動する。再びステップS5−4で、カウンタに明るさポインタの指す明るさ1を持つ画素数を加える。明るさ1を持つ画素数は4であるので4をカウンタに加えると、カウンタの値は5となる。
【0061】
このようにしてステップS5−4、ステップS5−5、ステップS5−6を繰り返すと、明るさポインタが5の時にカウンタが40画素を超えることから、元の画像の明るさ5を、明るさ平均化変換後の明るさの11(明るさの中心)とすれば良いことが分かる。その値を元に、ステップS6で、明るさの平均化変換テーブル3cを作成する。
【0062】
明るさの平均化変換テーブル3cは、本実施形態1では、単純に線形関数で変換後の明るさを求めている。すなわち、上の例で、元のグレー画像の明るさ0から5までを、変換後の画像の明るさ0から11までに変換するのであるから、元のグレー画像の0から5までの明るさにそれぞれ11/5を掛けた値が変換後の値となる。元のグレー画像の明るさ6から23までも、同様に変換後の12から23までの値に線形に変換する。その結果得られた明るさ平均化変換テーブルの例が図5である。また他の求め方として、ヒストグラムで画素数が0以外である明るさのうちの最小値(図3では明るさ0)を変換後の明るさの最小値である0に、画素数が0以外である明るさのうち最大値(図3では20)を変換後の明るさの最大値である23に合わせるようにしたり、明るさの平均をとって変換後の明るさのピーク値としたりするなどの方法がある。
【0063】
さらに、本実施形態1では、少しでも暗いところはより暗く、少しでも明るいところはより明るく変換するために、明るさ変換テーブル3dをステップS7で作成する。この明るさ変換テーブル3dとして、本実施形態1では、ガンマ変換を用いたものを使用している。ガンマ変換とは、y=xa,0≦x≦1という式を満たす もので、a<1の場合は図6のグラフの右上部分のような軌跡を、a>1の場合は図6のグラフの左下のような軌跡を描く。本実施形態1では、明るさ0から真ん中の明るさまでをa>1のガンマ変換による軌跡で、真ん中の明るさから最大の明るさまでをa<1のガンマ変換による軌跡で変換した値を変換後の明るさとしているが、もちろんグラフの形状はこの他にも任意に定義することが可能である。この明るさ変換テーブル3dは入力となる画像には依存しないので、あらかじめ明るさ変換テーブル3dをプログラムの外で作成し、プログラムに定数として記述しておく方が、明るさ変換テーブル3dを作成するための計算時間の削減につながり、効率的である。
【0064】
ここまでの処理で得られた、加工用画像領域3a2上のグレー画像、ヒストグラムテーブル3b、明るさ平均化変換テーブル3c、明るさ変換テーブル3dを用いて、画像の明るさを調整し、より見映えの良い画像を得る処理が、ステップS8の明るさ変換処理である。ステップS8の明るさ変換処理を、図11のフローチャートで説明する。この処理も、図9のフローチャートのステップS4の処理で説明したのと同じように、加工用画像領域3a2の画像のすべての画素について処理を行なうため、ステップS8−01、ステップS8−02、ステップS8−03、ステップS8−04、ステップS8−05、ステップS8−07で示している行・桁のループの部分の詳しい説明は省略する。
【0065】
ステップS8−11、S8−12は、明るさに対する変換を行なう処理である。ステップS8−11、ステップS8−12はそれぞれ、ステップS6、ステップS7で作成された明るさ平均化変換テーブル3cと明るさ変換テーブル3dによって、元のグレー画像の明るさを変換する処理である。いったんすべての画素について、まずステップS8−11の明るさ平均化変換テーブル3cによって明るさを平均化し、その画像のすべての画素について、ステップS8−12の明るさ変換テーブル3dによって明るさを変換しても良いが、本実施形態1では、処理時間を短縮するために、ステップS8−11で明るさを平均化するのと同じループ内でステップS8−12の明るさ変換処理も行なっている。
【0066】
図26の画像5と画像6は、処理結果を分かりやすくするためにステップS8−11とステップS8−12の処理を分けて行ない、それぞれの処理によって得られた結果の画像である。画像5は、元画像をグレーに変換した画像4に対してステップS8−11の明るさ平均化変換処理を行なった結果の画像である。元のグレー画像は、全体的に黒っぽい画像であり、ヒストグラムをとると図3に近い形状をしているが、明るさの平均化を行なうと、少し明るい部分がさらに明るく変換され、全体的な明るさが明るくなっているのが分かる。画像6は、明るさが平均化された画像5に対して、さらに少しでも明るい部分はより明るく、逆に少しでも暗い部分はより暗く変換するという、ステップS8−12の明るさ変換処理を行なった結果の画像である。画像5と比較して、明るい部分はさらに明るく、暗い部分はさらに暗くなっていることが分かる。
【0067】
以上の一連の処理は、ユーザから受け付けるただ一つの指示によって、連鎖的に実現できるものである。ただし、例えば明るさの平均化変換テーブル3cの作成時(ステップS6)や明るさ変換テーブル3dの作成時(ステップS7)のように、パラメータを変えることにより違った結果を得ることができる箇所では、ユーザの指示を受けつけるようなユーザインタフェースにすることも可能である。
【0068】
このように、編集しようとしている画像が白黒多値データでない場合にはその画像を白黒多値データに変換するグレー変換処理(ステップS4−1)と、画像のヒストグラムを作成するヒストグラム作成処理(ステップS4−2)と、ヒストグラム作成処理(ステップS4−2)によって作成されたヒストグラムテーブル3bと、グレー画像において明るさのピークと考えられる明るさを検出するグレー画像の明るさピーク検出処理(ステップS5)と、ヒストグラムテーブル3bとグレー画像の明るさピーク検出処理(ステップS5)から、グレー画像の明るさを平均化する変換テーブルを作成する明るさ平均化変換テーブル作成処理(ステップS6)と、明るさ平均化変換テーブル作成処理(ステップS6)によって得られる明るさ平均化変換テーブル3cと、明るい部分をより明るく、暗い部分をより暗く変換するための明るさ変換テーブルを作成するための明るさ変換テーブル作成処理(ステップS7)と、明るさ変換テーブル作成処理(ステップS7)によって得られる明るさ変換テーブル3dとを有する画像処理方法によって、画像6、画像7の変換例に示したように、見映えの良い白黒画像を得ることができる。
【0069】
(実施形態2)
上記実施形態1で説明した画像加工処理を利用し、結果として得られた白黒画像に他の加工処理を加えることにより、上記実施形態1で得られた画像の性質をさらに生かし、ペンで絵を描画したかのような、よりアピール力のある画像を得ることができる。
【0070】
本実施形態2におけるペン画処理について、図12と図13を用いて詳しく説明する。
【0071】
図12は、上記実施形態1で説明したデータ処理装置の概略構成を示すブロック図である、図1とほぼ同じものであるので、異なる部分についてのみ説明する。RAM3には、加工する元になるもと画像を格納するための元画像領域3a1、加工した結果の画像を格納するための加工用画像領域3a2の他に、ワーク用画像領域として3a3をも確保している。加工処理によっては、ワークとしてさらにもう1枚またはそれ以上の画像を格納するためのワーク用画像領域3a3を必要とする場合もあるが、本実施形態2によるペン画処理でも、後述するように、いったんある加工を行なった画素の、加工前の元画像の情報を再び参照しなければならない処理を含むような場合がそれにあたる。本実施形態2による処理では、ワーク用画像として加工用画像1枚分のワーク用画像を使用する。
【0072】
本実施形態2におけるペン画処理においては、ペンによって描かれたとする線を置く画素を、誤差拡散法により二値化して求めている。誤差拡散法は、種々の二値化処理の中でも階調性が良い、解像度が高い、モアレが出にくいなどの長所があるために、本実施形態2ではこの方法を用いているが、もちろん他の二値化処理によって求めても良い。この誤差拡散法ではワーク領域を必要とするが、それは図12のシステム構成図の3eに確保するものとする。
【0073】
また、本実施形態2では、ブラシパターン用の領域3gを確保している。ブラシパターンとは、ある画素に対して、その画素を含み、その近傍の複数の画素に対して、ある定められたパターンの画素にある値を置いていくことにより、結果として入力画像とは趣の異なる画像を得るために設定されるパターンである。その説明を図22に示す。
【0074】
加工処理の種類によっては、このブラシパターン3gを用いて何らかの計算を行なってから出力画像に対してパターンを置いていくような方法も考えられるが、本実施形態2の場合は、ブラシパターンに重なる位置に、あらかじめ設定された色の画素を置く処理を行なう。
【0075】
図13は、本実施形態2の処理の流れを示すフローチャートである。ステップS8−2の二値化処理とステップS8−4のブラシ配置処理は、本実施形態2、および、それ以降に示すその他の実施形態におけるペン画処理の基本となる処理である。
【0076】
図21は、上記実施形態2において変換した白黒画像に対して、二値化処理によって生じた画素に対してペン画のブラシを配置していく処理の流れを示すフローチャートである。
【0077】
画像アプリケーションで加工したい画像を呼び出し、本実施形態2における画像加工処理を画像アプリケーションで指示すると、図13のフローチャートのステップS1以降の処理に入る。この時、元画像データ領域3a1には、呼び出された画像データが格納されている。ステップS1では、呼び出されている画像を元にして、これから加工処理を行なうための加工用画像を作成する。ただし、画像アプリケーションを起動し、画像を呼び出した時点で、表示器に表示したりするために呼び出した画像を加工用画像領域3a2に複写するなどして、すでに加工する元となるデータが既に加工用画像領域3a2に作成されている場合には、このステップは行なわなくても良い。また、例えば加工結果の画像は元の画像を拡大・縮小などのように変倍したものとするような場合には、ここで加工用画像を作成する場合にあらかじめ変倍しても良い。
【0078】
加工用画像領域3a2にこれから加工処理を行なう画像が作成されると、ステップS2で、これから加工処理を行なうために必要となる情報やテーブルなどの初期化などを行なう初期処理を行なう。本実施形態2では、ヒストグラムテーブル3bのクリアの他に、ペン画を模すためのパターンブラシデータの設定、その色の設定、ペン画の下地となる色の設定、といった初期処理を行なっている。ただし、パターンブラシデータやその色、ペン画の下地となる色の設定などがあらかじめプログラムで固定的に定められている場合は、ここでの設定は不要である。
【0079】
ステップS2の初期処理が終了すると、ステップS3で、ワークとして使用するワーク用画像領域3a3を作成する。本実施形態2の画像加工処理の場合は、このワーク用画像領域3a3に、加工結果の画像が生成される。以降に処理の詳細を説明するが、加工用画像領域3a2を元に、ブラシを配置する画素を求め、ワーク用画像領域3a3上の対応する画素にブラシパターン3gを配置していくことになるため、ステップS3では、加工用画像領域3a2と同じサイズ(横画素数、縦画素数)の、同じデータ構造を持つ画像データ領域を作成する。また、このワーク用画像領域3a3にブラシパターン3gを上書きしていくため、あらかじめワーク用画像領域3a3を初期処理S2で設定した下地の色で塗りつぶしておく。内部的には、例えば下地の色を白とした場合、白という色を表すデータ(R=255、G=255、B=255)をワーク用画像領域全体に書き込むことになる。
【0080】
ステップS4からステップS7では、上記実施形態1で行なった明るさの変換処理を行なう。処理内容は上記実施形態1と同じであるので、説明は省略する。
【0081】
ステップS7で明るさ変換テーブル3dの作成処理までの処理が終了した時点では、加工用画像領域3a2には元画像をグレーに変換した画像が格納されている。ステップS8の流れは、図21のフローチャートを用いて説明する。ステップS8−01、ステップS8−02、ステップS8−03、ステップS8−04、ステップS8−05、ステップS8−08に関しては、すべての画素についてのループであり、上記実施形態1と同じであるので説明を省略する。またステップS8−11、ステップS8−12も上記実施形態1で説明したのと同じ内容であるので、説明を省略する。ステップS8−06は、本実施形態2を含むその他の実施形態で行なっている、ブラシ判定および配置処理を示しているが、実施形態ごとにその内容は異なる。
【0082】
ステップS8−21では、注目している画素がブラシパターン3gを配置する画素であるか否かを判定するために、誤差拡散法により値を求めている。誤差拡散法は一般的に用いられている方法であるので、説明は省略する。誤差拡散法では、計算により求められた値がしきい値を超えたならばそこに黒(白・黒二値の場合)の値を置くことにより、画像全体を白または黒の二値の画像に変換することができるので、黒を置くべき画素であれば、ブラシパターン3gを配置するという方法を本実施形態2ではとっている。その判定を行なうのがステップS8−22である。
【0083】
ここで述べたように、しきい値よりも値が大きければ、ステップS8−06のブラシパターン判定及び配置処理で、ワーク用画像領域3a3にブラシパターン3gを配置する。本実施形態2では、ステップS8−06のブラシ判定及び配置処理では、注目画素に対して与えられたブラシパターン3gをそのままの形で配置するという基本的な処理であるステップS8−4のブラシパターン配置処理を行なっている。ステップS8−4のブラシパターン配置処理は、図22で説明しているように、画像の加工結果を出力する画像(ここではワーク用画像領域3a3)上に、元となる画像(ここでは加工用画像領域3a2)において注目している画素にブラシパターンの中心を合わせて上書きする(ステップS2の初期処理で設定したブラシパターンの色が黒である場合、黒を示す0の値をその画素に書き込む)。この処理が終了すると、誤差拡散法の計算の一部であるステップS8−07を行なう。この際、図22の(3)と(4)を見ればわかるように、画像からはみ出す部分は無視し、誤差拡散で発生したすべての画素に対してブラシを置く。
【0084】
すべての画素について以上の処理を行なうと、ワーク用画像領域3a3には、ペンで描いたような効果を持った画像が作成される。ここで、本画像加工処理を呼び出した元のプロセスに対して、ワーク用画像領域3a3以外の領域に加工結果を返す仕様の場合には、その領域にワーク用画像領域3a3の内容を複写する(ステップS9)。
【0085】
このようにして、以上のような処理を画像の全画素に対して行なうことにより、画像にペンで描いたような効果を持たせることができる。
【0086】
(実施形態3)
実施形態2で述べたブラシパターンは、複数種類準備し、画素の明るさの度合いによってどのパターンを使用するかを分類することも可能である。その処理の流れを示したものが、図14のフローチャートである。本実施形態3では、あらかじめ図25に示すようなブラシパターン1を準備しておく。処理の流れにおいて実施形態2と異なる部分はステップS8−3のブラシパターン選択処理を追加したことのみであるので、それに関する部分だけを説明する。実際にこの処理が実行されるのは、図21のフローチャートで示されるステップS8の中のステップS8−06の部分である。
【0087】
実施形態2と同じように、注目している画素がブラシを配置するべき画素である場合に、ステップS8−3のブラシパターン選択処理を行なう。ステップS8−3のブラシパターン選択処理では、注目している画素の元のグレー画像(ここでは囲う用画像3a2)の明るさを調べ、図25に示しているように、黒〜白を0〜255段階に分けた場合に、その明るさによって各画素に配置するブラシパターン3gを変えることにより、結果として得られる画像がより見映えが良くなる。
【0088】
そして、その明るさが0〜50(暗い)であればブラシAを、51〜200であればブラシBを、201〜255(明るい)であればブラシCを採用し、実施形態2におけるステップS8−4のブラシパターン配置処理と同じように、出力用画像(ここではワーク用画像領域3a3)に描き込む。このような処理を画像の全画素に対して行なうことにより、暗い部分は太いペンで、あるいは力強く描いたように、明るい部分はペンのピッチを短く描いたように見せることができ、よりペン画を模倣したような結果を得ることができる。
【0089】
また、ブラシのパターンの角度を変えるなど変化を持たせることにより、異なる画風を生み出すことができる。ブラシパターン3gとして図26の(2)のようなブラシパターンを準備し、ある所定の計算方法によっていずれかのパターンを採用すると、いろいろな方向からペンで描いたような結果を得ることもできる。その計算方法としては、元の画像の画素の明るさや、ブラシを配置してきたカウント数、乱数などさまざまな方法が考えられる。
【0090】
これらのブラシを、例えば(画素の明るさ)mod(3)=0ならば、(2)のブラシパターン1を、1ならばブラシパターン2を、2ならばブラシパターン3を使用したり、どのパターンを使用するかを乱数を発生させることにより決定したり、二値化で発生した画素に順にブラシパターン1、2、3の順に使用したりできる。
【0091】
(実施形態4)
実施形態2、及び3で説明した処理の場合、ブラシを置くどの画素に対しても、(ブラシパターンの横幅/2)、(ブラシパターンの縦幅/2)の近傍の画素には、ブラシパターン3gによる値(色)が置かれてしまう。したがって、元の画像の中に、明暗の差が激しい画素が隣り合ったり近くにあったりした場合、その境界部分にも画素が置かれてしまうために、その輪郭とも言える明暗の差がぼやけてしまう可能性がある。例えば、人物と背景部分の輪郭線が分かりにくくなってしまうようなことが考えられる。
【0092】
本実施形態4では、そのような問題を解決するための方法について説明する。図15のフローチャートで示しているステップS8−5のブラシ配置位置判定処理(1)がそれに当たる。ただし実際の処理はステップS8−4でブラシパターン3gを出力画像に描き込む時に行なっているが、処理を分かりやすくするためにステップS8−4、ステップS8−5として分けて記述している。この処理は、実際には図21のフローチャートのステップS8−06の中で行なわれている。
【0093】
本実施形態4の処理の説明は、図23で行なう。
【0094】
図21のフローチャートのステップS8−21、ステップS8−22によって、注目画素がブラシパターン3gを配置する画素であると判定された時に、グレー変換された元画像(ここでは加工用画像領域3a2の画像)における注目画素の明るさを取得しておく。本実施形態4の図23の例の場合は「0」である。次に、配置するブラシパターン3gの、色を置く画素の位置の対応する、グレー変換された元画像の画素の明るさを取得する。図23の例では、斜線を引いた画素がそれに当たる。注目画素とそれらの明るさの値の差をそれぞれ求め、それがあらかじめ定められた(初期処理ステップS2で設定するか、あるいはプログラムで固定的に指定されている、またはユーザの操作により指定される)値よりも大きい(明るさの差が激しい)場合には、その色は置かないようにする。
【0095】
図23に示す例では、注目している画素の元画像の色の値が「0」であり、ブラシパターン3gのもっとも右上と、そのすぐ左下に当たる位置の元画像の明るさの値は「23」である。ここで「明るさの差が12以上であれば色を置かない」という指定がしてあれば、「0」と「23」との差は23であり、12よりも大きいので、それら2つの画素は出力画像上に配置しないで、注目画素に対してブラシパターン3gを置いた結果は図23の(4)のようになる。また、ブラシパターンのもっとも左下に当たる位置のもと画像の明るさの値は「10」であり、注目している画素との明るさの値の差は10で、12よりも小さいので、その画素は出力画像上に配置することになる。注目画素のすぐ左下に当たる位置の元画像の明るさは「0」であり、注目している画素との明るさの差は0(注目している画素の明るさと同じ)で、12よりも小さいので、その画素も出力画像上に配置する。
【0096】
このような処理を画像の全画素に対して行なうことにより、明るさの差が激しい輪郭線のような部分はそのまま残り、実施形態2よりも、元画像の性質を残したペン画風の処理結果を得ることができる。この処理を行なった画像の例が、図26の画像8である。
【0097】
(実施形態5)
実施形態2〜4で説明したペン画処理では、二値化処理によって生じた画素に対してブラシパターン3gを配置しているが、明るい(白に近い)部分をより明るくしたい場合には、本実施形態5で説明するような方法が有効である。本実施形態5もこれまでに説明した実施形態2〜4と同様に、ステップS8(図21のフローチャート)に示すステップS16の処理だけが異なるため、その処理だけを説明する。この全体の流れを示すものが図16のフローチャートである。図16のフローチャートのステップS8−6のブラシ配置位置判定処理(2)が、本実施形態5で説明する手段である。このステップS8−6のブラシ配置位置判定処理(2)によって、注目している画素に対してブラシを配置するか否かを判定するが、ここで「配置する」と判定された場合だけステップS8−4のブラシパターン配置処理へ進む。「配置しない」と判定された場合は、次の画素へ注目画素を移す。
【0098】
ステップS8−6のブラシ配置位置判定処理(2)を、図24で説明する。図24の例では、明るさの値は0(黒)〜23(白)としている。この処理は、注目している画素のグレー変換された元画像(ここでは加工用画像領域3a2の画像)の明るさの値が、あらかじめ定められた(初期処理ステップS2で設定するか、あるいはプログラムで固定的に指定されている、またはユーザの操作により指定される)値(図25の例では18)以上(明るい)の場合には、その条件を満たす、二値化によって発生した画素の2(もしくはそれ以上)画素のうち1画素にだけブラシパターン3gを置くというものである。2(もしくはそれ以上)画素のうち1画素にだけブラシパターン3gを置く方法は、上記条件を満たす画素に関して、カウンタを1つ準備しておき、2(もしくはそれ以上)を超えるまで、上記条件を満たす画素がある度に1を加えていき、超える時にブラシパターン3gを置いていけば良い。
【0099】
この図24を見ればわかるように、(1)における、この範囲でブラシを置く画素の元画像の明るさがすべて20であり、18以上の明るさを持つ画素の場合は、2画素のうちの1画素にしかブラシを置かないとすると、実際にブラシを置く画素は(2)のようになる。そして、これらの画素にブラシを置くと、(3)のように、この判定を行なわないよりも明るい結果が得られる。
【0100】
このような処理を画像の全画素に対して行なうことにより、明るい部分はより明るく表現されたペン画風の処理結果を得ることができる。
【0101】
(実施形態6)
実施形態3〜5で説明した各処理は、組み合わせて使用することにより、さらに効果的な結果を生み出すことができる。
【0102】
実施形態2で説明したペン画加工処理の基本処理に加え、実施形態4で説明した、ステップS8−5のブラシ配置位置判定処理(1)と、実施形態5で説明した、ステップS8−6のブラシ配置位置判定処理(2)を組み合わせ(図17のフローチャート)ることにより、明るさの差の激しい部分はその性質が残り、明るい部分はより明るく表現されるという効果を得ることができる。
【0103】
(実施形態7)
実施形態2で説明したペン画加工処理の基本処理に加え、実施形態3で説明した、ステップS8−3のブラシパターン選択処理と、実施形態5で説明した、ステップS8−6のブラシ配置位置判定処理(2)を組み合わせ(図18のフローチャート)ることにより、強弱を持ったペン画風の効果と、明るい部分はより明るく表現されるという効果を得ることができる。
【0104】
(実施形態8)
実施形態2で説明したペン画加工処理の基本処理に加え、実施形態3で説明した、ステップS8−3のブラシパターン選択処理と、実施形態4で説明した、ステップS8−6のブラシ配置位置判定処理(1)を組み合わせ(図19のフローチャート)ることにより、明るさの差の激しい部分はその性質が残り、明るい部分はより明るく表現されるという効果を得ることができる。
【0105】
(実施形態9)
実施形態2で説明したペン画加工処理の基本処理に加え、実施形態3で説明した、ステップS8−3のブラシパターン選択処理と、実施形態4で説明した、ステップS8−6のブラシ配置位置判定処理(1)と、実施形態5で説明した、ステップS8−6のブラシ配置位置判定処理(2)を組み合わせ(図20のフローチャート)ることにより、強弱を持ったペン画風の効果と、明るさの差の激しい部分はその性質が残り、明るい部分はより明るく表現されるという効果を得ることができる。
【0106】
(実施形態10)
上記の各実施形態では、明るさ変換テーブル3dとしてガンマ変換を用い、明るい部分はより明るく、暗い部分はより暗く変換する方法について説明した。しかし、変換テーブルは、例えば図7に示すように段階的に明るさを変換することにより、ある範囲の明るさのところは一定の明るさに変換される(ポスタリゼーション)ように作成することもできる。図7の例では、明るさを0から23の24段階とした場合に、元の画像の明るさ3から8までの画素は、すべて3の明るさに変換され、元の画像の明るさ14から20までの画素は、すべて15の明るさに変換される。図26の画像7が、この例である。明るさが、等高線で塗り分けられたように、数段階に分かれていることが分かる。このように、明るさ変換テーブル3dを数段階に設定することにより、イラスト風の効果を得ることができる。
【0107】
その他にも、上記各実施形態の明るさ変換テーブル3dは、ガンマ変換を用いる場合でも、ガンマ値の値によっては、明るさと暗さに大きく差が出たり、また、あまり差が出なかったりするなど、さまざまな結果が得られる。
【0108】
最後に、図26の各画像について、まとめて説明する。
【0109】
まず、画像1は、画像3の元画像をグレーに変換し、ガンマ<1のガンマ変換により全体的に明るく変換した画像に対して、ブラシ配置位置判定処理(1)を用いたペン画処理を行なった画像である。
【0110】
本発明で説明しているように、グレー画像のピーク明るさ検出処理、明るさの平均化変換テーブル作成処理、明るさ変換テーブル作成処理、明るさ変換処理、ヒストグラムテーブル、明るさ平均化変換テーブル、明るさ変換テーブルを用いない場合には、このように非常に劣化した画像に変換されてしまう。
【0111】
次に、画像2は、画像3の元画像に対して、本発明による処理を行なった画像である。この例は、実施形態4によるものである。画像1に比較しても、元画像の性質をよく残しながら、美しくペン画調に加工されていることが分かる。
【0112】
次に、画像3は、画像1、2、及び4〜8に対して加工処理を行なう前の、元画像である。
【0113】
次に、画像4は、元画像3に対し、グレーに変換した(ステップS4−1)画像の例である。
【0114】
次に画像5は、画像4に対し、明るさの平均化(ステップS8−11)を行なった画像の例である。
【0115】
次に、画像6は、画像5に対し、ガンマ変換を用いた明るさ変換テーブルにしたがって明るさを変換した(ステップS8−12)画像の例である。
【0116】
次に、画像7は、画像5に対し、段階的に明るさを変換する明るさ変換テーブル2にしたがって明るさを変換した(ステップS8−12)画像の例である。
【0117】
最後に、画像8は、画像7に対し、ブラシ配置位置判定処理(1)を用いてペン画調に加工した画像の例である。
【0118】
【発明の効果】
以上説明したように、本発明によれば、入力画像の明るさなどに依存せずに、カラー画像や白黒多値画像の明暗を見映え良く表現したり、ペン画風の加工結果をほどこしたりするなど、画像をよりアピールしたり、表現力を増したりすることができるので、画像やその扱い方、色などの知識をあまり持ち合わせていない一般ユーザであっても、簡単に画像処理を行うことができ、また、さらには画像処理により親しみが持てるといった効果を得ることができる。
【図面の簡単な説明】
【図1】本発明の実施形態1に係るデータ処理装置の概略構成を示すブロック図である。
【図2】本実施形態1で扱うカラー画像データの構成例を示す図である。
【図3】本実施形態1で扱うヒストグラムの例を示す図である。
【図4】本実施形態1で扱うヒストグラムの例を示す図である。
【図5】本実施形態1で扱う明るさの平均化変換テーブルの例を示す図である。
【図6】本実施形態1で扱う明るさ変換テーブルの例を示す図である。
【図7】本実施形態1で扱う明るさ変換テーブルの例を示す図である。
【図8】本実施形態1の動作を説明するためのフローチャートである。
【図9】本実施形態1の動作を説明するためのフローチャートである。
【図10】本実施形態1の動作を説明するためのフローチャートである。
【図11】本実施形態1の動作を説明するためのフローチャートである。
【図12】本発明のその他の実施形態に係るデータ処理装置の概略構成を示すブロック図である。
【図13】本発明の実施形態2の動作を説明するためのフローチャートである。
【図14】本発明の実施形態3の動作を説明するためのフローチャートである。
【図15】本発明の実施形態4の動作を説明するためのフローチャートである。
【図16】本発明の実施形態5の動作を説明するためのフローチャートである。
【図17】本発明の実施形態6の動作を説明するためのフローチャートである。
【図18】本発明の実施形態7の動作を説明するためのフローチャートである。
【図19】本発明の実施形態8の動作を説明するためのフローチャートである。
【図20】本発明の実施形態9の動作を説明するためのフローチャートである。
【図21】本発明の実施形態10の動作を説明するためのフローチャートである。
【図22】本発明のその他の実施形態で扱うブラシの配置を説明するための図である。
【図23】本発明のその他の実施形態で扱うブラシの配置位置判定を説明するための図である。
【図24】本発明のその他の実施形態で扱うブラシの配置位置判定を説明するための図である。
【図25】本発明のその他の実施形態で扱うブラシパターンの種類を説明するための図である。
【図26】本発明の各実施形態で処理される画像をまとめて示した図である。
【符号の説明】
1 CPU
2 ROM
3 RAM
4 キーボード
5 マウス
6 表示器
7 外部記憶装置
8 バスライン
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing method and apparatus for performing processing on a two-dimensional color image or black-and-white multivalued image developed on a memory, and a storage medium storing a computer program for realizing the method. It is.
[0002]
[Prior art]
Conventionally, when processing a two-dimensional color image or black-and-white multi-valued image according to the user's preference, several processes are overlaid or parameters are designated.
[0003]
[Problems to be solved by the invention]
However, since the above conventional technique requires many instructions in order to obtain a good-looking processed result, a general user who does not have much image processing knowledge can create a desired processed image according to his / her preference. It was very difficult to get. That is, when a general user wants to obtain a good-looking processed image, he has to learn some degree of image processing knowledge and repeat trial and error.
[0004]
The present invention has been made to solve the above-described problems. In particular, it does not depend on properties such as brightness from an input two-dimensional color image or black-and-white multivalued image according to a simple instruction from a user. Another object of the present invention is to provide an image processing method and apparatus and a storage medium capable of obtaining an effective monochrome image with better appearance.
[0005]
[Means for Solving the Problems]
  In order to achieve the above object, an image processing apparatus according to the present invention includes an image storage unit that stores a monochrome multi-valued image, and a histogram creation unit that creates a histogram of a monochrome multi-valued image stored in the image storage unit. , A peak detection means for detecting the brightness peak of the monochrome multi-valued image stored in the image storage means, a histogram created by the histogram creation means, and a brightness peak detected by the peak detection means, An average conversion means for performing a conversion for averaging the brightness of the black and white multi-valued image, and an intensity conversion means for performing a conversion for adding a strength to the brightness of the image converted by the averaging conversion means., Binarization conversion means for converting the black and white multi-valued image converted by the strength conversion means into binary data, pixels of the image converted by the binarization conversion means, and pixels in the vicinity of the pixels , A brush pattern placement means for placing a brush pattern imitating a drawing with a pen, and whether each element of a given brush pattern is placed for a certain pixel when placing the brush pattern by the brush pattern placement means An arrangement determining unit that determines whether or not the brush pattern is based on a difference between a brightness of a target pixel of the monochrome multi-valued image and a brightness of a pixel adjacent to the target pixel. Place the brush pattern by placing meansWas established.
[0006]
Preferably, the image processing device further includes a gray conversion unit that converts a two-dimensional color image into a black and white multi-value image, and the image storage unit stores the black and white multi-value image converted by the gray conversion unit.
[0009]
  Preferably, the arrangement determination unit is configured to determine whether the difference between the brightness of the target pixel of the monochrome multi-valued image and the brightness of a pixel adjacent to the target pixel is larger than a predetermined value. Do not place the brush pattern by.
[0013]
  Further preferably, the arrangement determination unit performs the arrangement of the brush pattern by the brush pattern arrangement unit based on the brightness value of each pixel of the monochrome multi-valued image.
[0014]
  In order to achieve the above object, an image processing method according to the present invention includes a histogram creation step of creating a histogram of a monochrome multi-value image stored in the image storage means, and a monochrome multi-value stored in the image storage means. Based on the peak detection step for detecting the brightness peak of the value image, the histogram created in the histogram creation step, and the brightness peak detected in the peak detection step, the brightness of the monochrome multi-value image An averaging conversion step for performing conversion for averaging the intensity, and an intensity conversion step for performing conversion for adding strength to the brightness of the image converted by the averaging conversion step., A binarization conversion step for converting the monochrome multi-valued image converted by the strength conversion step into binary data, an image pixel converted by the binarization conversion step, and a pixel in the vicinity of the pixel , A brush pattern placement step for placing a brush pattern imitating a drawing with a pen, and whether each element of a given brush pattern is placed for a certain pixel in the placement of the brush pattern in the brush pattern placement step An arrangement determining step for determining whether or not the brush pattern is based on a difference between the brightness of the pixel of interest of the monochrome multi-valued image and the brightness of a pixel adjacent to the pixel of interest. Place the brush pattern in the placement processWas established.
[0015]
Preferably, the image storing means stores the black and white multi-valued image converted in the gray converting step, including a gray converting step of converting the two-dimensional color image into a black and white multi-valued image.
[0018]
  Preferably, the arrangement determination step includes the brush pattern arrangement step when the difference between the brightness of the target pixel of the black and white multi-valued image and the brightness of a pixel adjacent to the target pixel is larger than a predetermined value. Do not place the brush pattern by.
[0022]
  Preferably, in the arrangement determining step,The monochrome multi-valued imageThe brush pattern is arranged in the brush pattern arranging step based on the brightness value of each pixel.
[0023]
  In order to achieve the above object, a storage medium that stores a computer program for realizing the image processing method according to the present invention and can be called by the computer is a histogram of a monochrome multi-valued image stored in the image storage means. A histogram creation step for creating a peak, a peak detection step for detecting a brightness peak of a black and white multi-valued image stored in the image storage means, a histogram created in the histogram creation step, and a detection in the peak detection step An average conversion step for performing a conversion for averaging the brightness of the black and white multi-valued image based on the brightness peak, and a conversion for adding strength to the brightness of the image converted by the average conversion step And a strong and weak conversion process, A binarization conversion step for converting the monochrome multi-valued image converted by the strength conversion step into binary data, an image pixel converted by the binarization conversion step, and a pixel in the vicinity of the pixel , A brush pattern placement step for placing a brush pattern imitating a drawing with a pen, and whether each element of a given brush pattern is placed for a certain pixel in the placement of the brush pattern in the brush pattern placement step An arrangement determining step for determining whether or not the brush pattern is based on a difference between the brightness of the pixel of interest of the monochrome multi-valued image and the brightness of a pixel adjacent to the pixel of interest. Place the brush pattern in the placement processHave
[0024]
DETAILED DESCRIPTION OF THE INVENTION
(Embodiment 1)
Embodiment 1 of the present invention will be described below with reference to the drawings.
[0025]
FIG. 1 is a block diagram showing a schematic configuration of a data processing apparatus according to the first embodiment of the present invention.
[0026]
The data processing apparatus according to the first embodiment includes a CPU (Central Processing Unit) 1, a ROM (Read Only Memory) 2, a RAM (Random Access Memory) 3, a keyboard 4, a mouse 5, a display 6, and an external storage device 7. These components are connected to each other by a bus line 8. Depending on the system configuration, a system program and an image processing program described later may be stored in an external storage device such as a hard disk instead of the ROM 2.
[0027]
The CPU 1 is in the form of a microprocessor, for example, and controls the operation of each part of this apparatus. The ROM 2 includes a system program 2a and an image processing program 2b1 according to the present invention, and stores an image application program 2b for instructing other various processes.
[0028]
The RAM 3 stores an original image area 3a1 for storing the original image to be processed, and a processing image area 3a2 for storing the processed image when the original image before the processing is left behind. The histogram table 3b, the brightness averaging conversion table 3c, the brightness conversion table 3d, and the other management / work area 3f that are necessary for the processing according to the present invention.
[0029]
The original image area 3a1 is an area of an image to be processed. When an image is read from the external storage device 7, it is first stored here. This original image is used when, for example, some kind of processing is performed but the processing result is not desired, for example, when it is restored. When any processing is performed, processing is performed on the original image, and the processed image is stored in the processing image area 3a2. In the first embodiment, this flow is described. However, in the case of a specification or mode in which the same or different processing is performed again on an image that has been processed once, it is not the original image of the original image area 3a1, Processing is performed on the processing image in the processing image area 3a2 that has already been processed. In that case, if the conditions such as the need not to store the first image and the need for the image area for restoration are satisfied, the original image area 3a1 and the processing image area 3a2 should use the same area. It is also possible to reduce the memory used.
[0030]
If the image is generally bright (white) or dark (blackish) on the contrary, some sort of processing will cause it to become blurred or even brighter or darker. The impression of the original image may be faded or broken. In such a case, as in the first embodiment, processing for converting the brightness of the entire image to be average is effective. In that case, the histogram table 3b is used.
[0031]
The histogram table 3b divides the brightness into several levels between white and black, detects which level each pixel is contained in a certain image, and sums the number of pixels at each level. Is what we asked for. Depending on the shape of the histogram according to the histogram table 3b, it is possible to quantitatively see the properties of the image as a whole, such as bright or dark. Based on this histogram table 3b, the brightness average conversion table 3c is a table created and referred to in order to determine the nature of the brightness of the image to be processed and to average the brightness of the entire image.
[0032]
In the first embodiment, in order to further improve the appearance of the processed image, in addition to averaging the brightness, another brightness conversion process is performed once more in order to add a sharper brightness. For this purpose, the brightness conversion table 3d is used. The brightness conversion table 3d described in the first embodiment performs a process of adding intensity to the brightness by converting even a bright part to be brighter and conversely a dark part to be darker.
[0033]
The other management / work area 3f is an area for managing various other information and data and using it as a work.
[0034]
The keyboard 4 is used by the user to input data such as letters, numbers, symbols, and various instructions to the CPU 1. The mouse 5 gives various instructions to the CPU 1 by instructing various information displayed on the display device 6. A system such as a trackball, a pen, or a touch panel may be used instead of the mouse. The display 6 is composed of an LCD or the like, and displays various data under the control of the CPU 1. The external storage device 7 is made of a medium such as a floppy disk, for example, and various data read from the external storage device 7 under the control of the CPU 1 is expanded on the RAM 3 via the bus line 8.
[0035]
Under the above configuration, the operation of the first exemplary embodiment will be described with reference to the flowcharts of FIGS. 8 to 11 and various data table configurations and processing outline examples of FIGS. The flowchart shown in FIG. 8 shows the overall flow of the image processing according to the first embodiment. The flowchart shown in FIG. 9 shows an example of a technique for converting an input image into a gray image and creating a brightness histogram. The flowchart shown in FIG. 10 shows the flow of processing for averaging the brightness of an image converted to gray. The flowchart shown in FIG. 11 shows the flow of processing for converting an image using the created brightness averaging conversion table 3c and the brightness conversion table 3d.
[0036]
FIG. 2 shows an example of the image structure described in the first embodiment.
[0037]
In FIG. 2, one pixel of the image is composed of 3 bytes in total, each of “R” indicating red, “G” indicating green, and “B” indicating blue, each having 1 byte (= 8 bits). A set of G and B represents one pixel of a color image. Here, each of R, G, and B can have a value of 0 to 255. The closer to 255, the closer to the primary colors of red, green, and blue, and the closer to 0, the closer to white. Further, when R = G = B = 0, the color is black, and when R = G = B = 255, the color is white.
[0038]
An image having such a configuration can express 16.7 million colors, which is the cube of 256.
[0039]
In the first embodiment, the image is first converted to gray. In order to obtain a black and white image from a color input image, “gray pixel value = 0.3 * (R value) + 0.6 * ( G value) + 0.1 * (B value) ”. An image converted to gray can be obtained by setting the obtained “gray pixel” as the R, G, and B values after conversion for all the pixels. An image 4 in FIG. 26 is an example in which the original image 3 is gray-converted. Pixels with a gray value of 0 are black and pixels with 255 are white. The closer to 0, the darker the color, and the closer to 255, the more whitish. In the description of the first embodiment, the expression “dark” is used as a dark color and “light” is used as a whitish color. In order to simplify the description, in the description after FIG. 3, the gray value is also described in 24 stages from 0 to 23.
[0040]
Next, FIGS. 3 and 4 show examples of different histograms for each image. An overall blackish (dark) image is when there are many pixels near black as shown in FIG. 3, and an overall whitish (bright) image is shown in FIG. This is a case where there are many pixels near white.
[0041]
FIG. 5 shows an example of a brightness averaging table for averaging the brightness of an image from the obtained histogram.
[0042]
Next, FIG. 6 shows an example of a brightness conversion table used for further sharpening the brightness. Here, conversion by gamma conversion is performed. As can be seen from FIG. 6, a dark place is converted to darker, and a bright place is converted to brighter. Therefore, the image to be converted is converted into a sharp image with a large difference between brightness and darkness.
[0043]
FIG. 7 is a diagram showing another example of the brightness conversion table. Here, the brightness of the resulting image is stepwise. Here, the overall brightness is not so different, but the brightness in a certain range is converted to a constant brightness.
[0044]
Hereinafter, the flow of processing will be described with reference to the flowcharts of FIGS. 8 to 11 and FIGS. However, the flow of processing such as starting an image application and performing various initial processes and calling an image is omitted in the flowchart of FIG.
[0045]
First, when the image application is activated, the image application program 2b and the image processing program 2b1 for processing an image as in the first embodiment are read from the ROM 2. However, if the image processing program 2b1 is read out when the image processing is started from the image application, it is effective in that a useless area is not used.
[0046]
Various information and areas necessary for image processing are secured on the RAM 3. The original image data area 3a1 required for calling an image from the external storage device 7 and the like, and the processing image data area 3a2 required for image processing may be secured at the time of activation, but each is required. If it is ensured at this point, a useless area is not used, which is effective when other processing using a memory area is performed.
[0047]
The histogram table 3b requires as many elements as the number of brightness steps. In the first embodiment, since there are 256 stages from 0 to 255, an array having the number of elements of 256 is secured in advance or when necessary. Each element of the histogram table 3b stores the number of pixels indicating how many pixels exist for each brightness. Similarly to the histogram table 3b, the brightness averaging conversion table 3c and the brightness conversion table 3d require the same number of elements as the number of brightness steps. In these conversion tables, the brightness of the pixel of interest is input, and in the case of the brightness, the brightness to be converted is output.
[0048]
These areas may also be secured in advance or when necessary. However, since the brightness averaging table 3c has different values depending on the input image, it must be calculated and constructed each time the input image (original image) changes and image processing is called. Since the brightness conversion table 3d does not depend on the input image, if it is created in advance and stored as a table with fixed values in the program, an image application is started or image processing is performed. This is efficient because it is not necessary to perform calculation for constructing the table each time the process is started. The other management / work area 3f may be secured in advance when the application is started or may be secured when necessary.
[0049]
When an image to be processed is called by the image application and the image processing processing in the first embodiment is instructed by the image application, the processing after step S1 in the flowchart of FIG. 8 is entered. At this time, the called image data is stored in the original image data area 3a1. In step S1, a processing image for performing processing from now on is created based on the called image. However, when the image application is activated and the image is called up, the image that has already been processed is processed for processing, for example, by copying the image that has been called in advance to be displayed on the display in the processing image area 3a2. If it is created in the image area 3a2, this step need not be performed. Further, for example, when the image of the processing result is an original image that has been scaled, such as enlarged or reduced, it may be scaled in advance when the processing image is created here.
[0050]
When an image to be processed from now on is created in the processing image area 3a2, in step S2, initial processing for initializing information and tables necessary for performing the processing from now on is performed. In the first embodiment, the histogram table 3b is cleared.
[0051]
When preparation for processing is completed up to step S2, in step S4, data to be processed is converted to gray (step S4-1), and processing for creating a histogram is performed (step S4-2). However, when the input image is a monochrome multi-valued image, the process of converting to gray can be omitted.
[0052]
The process of step S4 will be described in more detail using the flowchart of FIG. In step S4, processing is performed for all pixels of the image in the processing image area 3a2. First, step S4-01, step S4-02, step S4-03, step S4-04, step S4-05, and step S4-06 show a row and column loop for processing all pixels. Since it is a thing, detailed description is abbreviate | omitted. Steps S4-11 and S4-21 are processing for gray conversion and histogram creation performed for all pixels.
[0053]
In step S4-11, the pixel of interest is converted to gray (however, as described above, when the input image is a monochrome multi-valued image, this gray conversion process can be omitted). In the first embodiment, the gray value is obtained by the equation “gray pixel value = 0.3 * (R value) + 0.6 * (G value) + 0.1 * (B value)”. This gray pixel value has any value from 0 to 255. 0 is black and 255 is white. The closer to 0, the darker the color is and the closer to 255, the brighter. A value obtained by substituting the values into R, G, and B can be viewed as a color after the original pixel is converted to gray. In the image, pixels that appear bright in the original image are expressed in light gray, and pixels that appear dark are expressed in dark gray. When this gray pixel value is calculated for all pixels and substituted for each of R, G, and B, an image converted to gray having the same structure as the original image can be obtained. However, when the original image is a black and white multi-valued image, it follows the structure.
[0054]
After performing gray conversion on all pixels to obtain a gray image for the original image, a histogram of the image may be obtained. However, in the first embodiment, in order to shorten the processing time, step S4-21 is performed. The histogram table 3b is created in the same loop as that for converting to gray. When obtaining the histogram of the brightness of the image used in the first embodiment, the brightness is divided into several steps (in the case of the first embodiment, 256 steps from 0 to 255), The number of pixels included in the stage is calculated. Therefore, +1 is added to the value of the brightness of the pixel of interest (the gray pixel value obtained in step S4-11) in the histogram table 3b which is secured in advance and initialized to 0 in step S2. In this way, the histogram table 3b can be created by obtaining the brightness for all the pixels and counting the number of pixels of that brightness.
[0055]
Next, description will be made while showing examples of the histograms of FIGS. 3 and 4 described above. Here, in order to simplify the description, the brightness is described as 24 levels from 0 to 23. In addition, the size of the image is set to 80, for example, 10 pixels in the horizontal direction and 8 pixels in the vertical direction. In the example of the histogram of FIG. 3, the number of pixels having 0 brightness is 1, the number of pixels having 1 brightness is 4, and the number of pixels having 22 brightness is 0. In this histogram, the number of pixels having the brightness of 3 is the largest, and since the distribution is such that the number of pixels is closer to the overall brightness of 0, the image is dark overall. I understand. Similarly, in the example of the histogram of FIG. 4, the number of pixels having 0 brightness is 0, the number of pixels having 22 brightness is 1, and the number of pixels having 1 and 23 brightness is 1, and the number of pixels is The most frequent image has a brightness of 18 and has a distribution in which the number of pixels is closer to the overall brightness of 24, indicating that the image is bright overall.
[0056]
When the processing in step S4 is completed, an image obtained by converting the original image of the original image region 3a1 into gray is formed in the processing image region 3a2, and a histogram of the brightness of the image is formed in the histogram table 3b. As described in the description of step S4, the image in the processing image area 3a2 may be an image that is biased in terms of brightness, such as entirely dark or bright, depending on the nature of the original image. In the first embodiment, the brightness of the image converted to gray is averaged to minimize the deterioration of the image and obtain a good-looking processing result. To do.
[0057]
In step S5, based on the histogram obtained in step S4, the central brightness after the brightness averaging conversion, which is a parameter for averaging the brightness, is obtained. The flow is shown in the flowchart of FIG.
[0058]
In step S5-1, the ratio of the number of pixels as the center of brightness is set. Here, the brightness of the image after conversion is 1/2 when it is desired to make the bright part and the dark part the same level, larger than 1/2 when it is desired to be a little darker, and 1 when it is desired to be a little brighter. What is necessary is just to set a ratio smaller than / 2 (for example, 2/5 when the brightness that has reached 2/5 of the total number of pixels is the center of the brightness after conversion). If it is larger than ½, the number of pixels larger than ½ of the total number of pixels in the darker part than the center of the brightness after conversion, and conversely if it is smaller than ½, the brightness after conversion. This is because a number of pixels larger than ½ of the total number of pixels is assigned to a portion brighter than the center of the. When the ratio is fixed by this image application, it is not set here, and the value may be described in the program as a constant beforehand.
[0059]
In step S5-2, the counter that stores the total number of pixels is set to 0 and initialized. In step S5-3, a brightness pointer indicating the brightness for which the number of pixels is added is initialized to zero. After step S5-4, the number of pixels of each brightness is added to the counter until the desired brightness is obtained. The desired brightness can be obtained when the counter value reaches the number of pixels obtained by multiplying the total number of pixels by the ratio set in step S5-1 (step S5-5, step S5-6, step S5-7).
[0060]
An explanation will be given using the histogram of FIG. 3 as an example. First, assuming that the brightness of the converted image is about the same between the bright part and the dark part, and the ratio is halved in step S5-1, the brightness including the pixel of 80/2 = 40th pixel is included. Will be asked. In step S5-2 and step S5-3, the counter and the brightness pointer are initialized to zero. In step S5-4, first, the number of pixels having 0 brightness is added to the counter. In the case of FIG. 3, since it is 1, the value of the counter is 1. In step S5-5, it is determined whether or not the counter value exceeds the number of pixels to be obtained (in this case, 40 pixels). However, since it has not exceeded, the process proceeds to step S5-6, and 1 is added to the brightness pointer. Then, move the pointer to the next noticed brightness. In step S5-4, the number of pixels having brightness 1 indicated by the brightness pointer is added to the counter. Since the number of pixels having brightness 1 is 4, if 4 is added to the counter, the value of the counter becomes 5.
[0061]
When Steps S5-4, S5-5, and S5-6 are repeated in this way, the counter exceeds 40 pixels when the brightness pointer is 5, so the brightness of the original image is set to the brightness average. It can be seen that the brightness after conversion to 11 (the center of brightness) may be used. Based on this value, the brightness averaging conversion table 3c is created in step S6.
[0062]
In the brightness averaging conversion table 3c, in the first embodiment, the brightness after conversion is simply obtained by a linear function. That is, in the above example, the brightness 0 to 5 of the original gray image is converted to the brightness 0 to 11 of the converted image, so the brightness of 0 to 5 of the original gray image. A value obtained by multiplying each by 11/5 is a value after conversion. Similarly, the brightness 6 to 23 of the original gray image is linearly converted into the converted values 12 to 23. FIG. 5 shows an example of the brightness averaging conversion table obtained as a result. As another method of obtaining, the minimum value (brightness 0 in FIG. 3) of the brightness whose number of pixels is other than 0 in the histogram is changed to 0 which is the minimum value of brightness after conversion, and the number of pixels is other than 0. The maximum value (20 in FIG. 3) is adjusted to 23 which is the maximum value of the brightness after conversion, or the average of the brightness is taken as the peak value of the brightness after conversion. There are methods.
[0063]
Furthermore, in the first embodiment, the brightness conversion table 3d is created in step S7 in order to perform conversion so that a dark place is darker and a bright place is brighter. As the brightness conversion table 3d, in the first embodiment, a table using gamma conversion is used. The gamma conversion satisfies the expression y = xa, 0 ≦ x ≦ 1, and when a <1, the locus shown in the upper right part of the graph of FIG. 6 is shown, and when a> 1, the graph of FIG. Draw a trajectory like the bottom left of. In the first embodiment, a value obtained by converting a brightness from 0 to the middle brightness with a locus by gamma conversion of a> 1, and a value from the middle brightness to the maximum brightness by a locus of gamma conversion of a <1 is converted. Of course, the shape of the graph can be arbitrarily defined. Since the brightness conversion table 3d does not depend on the input image, it is more likely that the brightness conversion table 3d is created in advance by creating the brightness conversion table 3d outside the program and describing it as a constant in the program. This leads to a reduction in calculation time and is efficient.
[0064]
Using the gray image on the processing image area 3a2, the histogram table 3b, the brightness averaging conversion table 3c, and the brightness conversion table 3d obtained by the processing so far, the brightness of the image is adjusted, and the The process for obtaining a good image is the brightness conversion process in step S8. The brightness conversion process in step S8 will be described with reference to the flowchart of FIG. Since this process is also performed for all the pixels of the image in the processing image area 3a2 as described in the process of step S4 in the flowchart of FIG. 9, steps S8-01, S8-02, and step Detailed description of the row / digit loop shown in S8-03, S8-04, S8-05, and S8-07 will be omitted.
[0065]
Steps S8-11 and S8-12 are processes for converting the brightness. Steps S8-11 and S8-12 are processes for converting the brightness of the original gray image using the brightness averaging conversion table 3c and the brightness conversion table 3d created in steps S6 and S7, respectively. For all pixels, first, the brightness is averaged by the brightness averaging conversion table 3c in step S8-11, and the brightness is converted by the brightness conversion table 3d in step S8-12 for all the pixels of the image. However, in the first embodiment, in order to shorten the processing time, the brightness conversion process in step S8-12 is also performed in the same loop as that in which the brightness is averaged in step S8-11.
[0066]
Image 5 and image 6 in FIG. 26 are images obtained as a result of performing the processes in steps S8-11 and S8-12 separately for easy understanding of the processing results. The image 5 is an image obtained as a result of performing the brightness averaging conversion processing in step S8-11 on the image 4 obtained by converting the original image into gray. The original gray image is a blackish image as a whole, and has a shape close to that of FIG. 3 when the histogram is taken. You can see that the brightness is getting brighter. The image 6 is subjected to the brightness conversion process in step S8-12 in which the brighter portion is converted to a brighter image and the darker portion is converted to a darker image. It is an image of the result. Compared to the image 5, it can be seen that the bright part is brighter and the dark part is darker.
[0067]
The above-described series of processing can be realized in a chain with only one instruction received from the user. However, in places where different results can be obtained by changing parameters, such as when the brightness averaging conversion table 3c is created (step S6) or when the brightness conversion table 3d is created (step S7). It is also possible to provide a user interface that accepts user instructions.
[0068]
As described above, when the image to be edited is not monochrome multi-value data, gray conversion processing (step S4-1) for converting the image into monochrome multi-value data and histogram creation processing (step S4-1) for creating an image histogram. S4-2), the histogram table 3b created by the histogram creation process (step S4-2), and the brightness peak detection process (step S5) for detecting the brightness that is considered to be the brightness peak in the gray image. ), Brightness average conversion table creation processing (step S6) for creating a conversion table for averaging the brightness of the gray image from the histogram table 3b and the brightness peak detection processing (step S5) of the gray image, and brightness. Brightness average obtained by the averaged conversion table creation process (step S6) Brightness conversion table creation processing (step S7) for creating a conversion table 3c, a brightness conversion table for converting bright portions brighter and dark portions darker, and brightness conversion table creation processing (step S7) By the image processing method having the brightness conversion table 3d obtained by (1), it is possible to obtain a good-looking black and white image as shown in the conversion example of the images 6 and 7.
[0069]
(Embodiment 2)
By using the image processing described in Embodiment 1 above and adding other processing to the resulting black and white image, the image obtained in Embodiment 1 can be further utilized to draw a picture with a pen. A more appealing image can be obtained as if it were drawn.
[0070]
The pen image processing according to the second embodiment will be described in detail with reference to FIGS.
[0071]
FIG. 12 is a block diagram showing a schematic configuration of the data processing apparatus described in the first embodiment, which is almost the same as FIG. 1, and therefore only different parts will be described. In addition to the original image area 3a1 for storing the original image to be processed and the processed image area 3a2 for storing the processed image, the RAM 3 also secures 3a3 as the work image area. is doing. Depending on the processing, there may be a need for a work image area 3a3 for storing one or more more images as a work. In the pen image processing according to the second embodiment, as described later, This is the case when a pixel that has undergone a certain process includes a process in which the information of the original image before the process must be referred to again. In the processing according to the second embodiment, a work image corresponding to one processing image is used as the work image.
[0072]
In the pen image processing according to the second embodiment, a pixel on which a line drawn with a pen is placed is obtained by binarization using an error diffusion method. The error diffusion method has advantages such as good gradation, high resolution, and less moiré among various binarization processes, but this method is used in the second embodiment. It may be obtained by binarization processing. This error diffusion method requires a work area, which is secured in 3e of the system configuration diagram of FIG.
[0073]
In the second embodiment, an area 3g for the brush pattern is secured. A brush pattern includes, for a certain pixel, a certain value in pixels of a predetermined pattern for a plurality of pixels in the vicinity of the pixel. This pattern is set to obtain different images. The explanation is shown in FIG.
[0074]
Depending on the type of processing, a method may be considered in which some calculation is performed using the brush pattern 3g and then the pattern is placed on the output image. In the case of the second embodiment, the pattern overlaps the brush pattern. A process of placing a pixel of a preset color at a position is performed.
[0075]
FIG. 13 is a flowchart showing the flow of processing according to the second embodiment. The binarization process in step S8-2 and the brush arrangement process in step S8-4 are processes that are the basis of the pen image process in the second embodiment and other embodiments described thereafter.
[0076]
FIG. 21 is a flowchart showing a flow of processing for arranging a brush for a pen image on pixels generated by the binarization processing on the black and white image converted in the second embodiment.
[0077]
When an image to be processed is called by the image application and the image processing processing in the second embodiment is instructed by the image application, the processing after step S1 in the flowchart of FIG. 13 is entered. At this time, the called image data is stored in the original image data area 3a1. In step S1, a processing image for performing processing from now on is created based on the called image. However, when the image application is activated and the image is called up, the called image is copied to the processing image area 3a2 for display on the display device, and the data that has already been processed is already processed. If the image area 3a2 has been created, this step need not be performed. Further, for example, when the image of the processing result is an original image that has been scaled, such as enlarged or reduced, it may be scaled in advance when the processing image is created here.
[0078]
When an image to be processed from now on is created in the processing image area 3a2, in step S2, initial processing for initializing information and tables necessary for performing the processing from now on is performed. In the second embodiment, in addition to clearing the histogram table 3b, initial processing such as setting of pattern brush data for imitating a pen image, setting of its color, and setting of a color as a background of the pen image is performed. . However, if the setting of the pattern brush data, its color, the color of the background of the pen drawing, etc. is fixed in advance by the program, the setting here is not necessary.
[0079]
When the initial processing in step S2 is completed, a work image area 3a3 used as a work is created in step S3. In the case of the image processing according to the second embodiment, an image as a processing result is generated in the work image area 3a3. The details of the processing will be described below. However, since the pixel on which the brush is arranged is obtained based on the processing image area 3a2, and the brush pattern 3g is arranged on the corresponding pixel on the work image area 3a3. In step S3, an image data area having the same data structure and the same size (number of horizontal pixels and vertical pixels) as the processing image area 3a2 is created. In addition, in order to overwrite the work image area 3a3 with the brush pattern 3g, the work image area 3a3 is previously painted with the background color set in the initial process S2. Internally, for example, when the background color is white, data representing the color white (R = 255, G = 255, B = 255) is written in the entire work image area.
[0080]
In steps S4 to S7, the brightness conversion process performed in the first embodiment is performed. Since the processing contents are the same as those of the first embodiment, description thereof is omitted.
[0081]
At the time when the processing up to the creation processing of the brightness conversion table 3d is completed in step S7, an image obtained by converting the original image into gray is stored in the processing image area 3a2. The flow of step S8 will be described using the flowchart of FIG. Step S8-01, Step S8-02, Step S8-03, Step S8-04, Step S8-05, and Step S8-08 are loops for all the pixels and are the same as those in the first embodiment. Description is omitted. Steps S8-11 and S8-12 have the same contents as those described in the first embodiment, and a description thereof will be omitted. Step S8-06 shows brush determination and arrangement processing performed in other embodiments including the second embodiment, but the contents thereof are different for each embodiment.
[0082]
In step S8-21, a value is obtained by an error diffusion method in order to determine whether or not the pixel of interest is a pixel on which the brush pattern 3g is arranged. Since the error diffusion method is a commonly used method, description thereof is omitted. In the error diffusion method, if the calculated value exceeds the threshold, a black (white / black binary) value is placed there to make the entire image a white or black binary image. In the second embodiment, a method of arranging the brush pattern 3g is adopted for a pixel in which black is to be placed. This determination is made in step S8-22.
[0083]
As described above, if the value is larger than the threshold value, the brush pattern 3g is arranged in the work image area 3a3 by the brush pattern determination and arrangement processing in step S8-06. In the second embodiment, in the brush determination and arrangement process in step S8-06, the brush pattern in step S8-4, which is a basic process of arranging the brush pattern 3g given to the target pixel as it is, is performed. Arrangement processing is performed. As described with reference to FIG. 22, the brush pattern arrangement processing in step S8-4 is performed on the original image (here, for processing) on the image (here, the work image area 3a3) that outputs the image processing result. The pixel of interest in the image area 3a2) is overwritten by aligning the center of the brush pattern with the center of the brush pattern (when the color of the brush pattern set in the initial processing in step S2 is black), a value of 0 indicating black is written into the pixel. ). When this process ends, step S8-07, which is part of the calculation of the error diffusion method, is performed. At this time, as can be seen from FIGS. 22 (3) and 22 (4), the portion protruding from the image is ignored and a brush is placed on all the pixels generated by error diffusion.
[0084]
When the above processing is performed for all the pixels, an image having an effect drawn with a pen is created in the work image area 3a3. Here, in the case of a specification in which the processing result is returned to an area other than the work image area 3a3 with respect to the original process that called the image processing, the contents of the work image area 3a3 are copied to that area ( Step S9).
[0085]
In this way, by performing the above-described processing on all the pixels of the image, it is possible to give the image the effect of drawing with a pen.
[0086]
(Embodiment 3)
It is also possible to prepare a plurality of types of brush patterns described in the second embodiment and classify which pattern is used according to the degree of pixel brightness. The flowchart of FIG. 14 shows the flow of the processing. In the third embodiment, a brush pattern 1 as shown in FIG. 25 is prepared in advance. In the processing flow, the only difference from the second embodiment is that the brush pattern selection processing in step S8-3 is added, so only the portion related thereto will be described. This process is actually executed at step S8-06 in step S8 shown in the flowchart of FIG.
[0087]
As in the second embodiment, when the pixel of interest is a pixel on which a brush is to be placed, the brush pattern selection process in step S8-3 is performed. In the brush pattern selection process in step S8-3, the brightness of the original gray image (here, the surrounding image 3a2) of the pixel of interest is checked, and black to white are set to 0 to 0 as shown in FIG. In the case of dividing into 255 stages, the resulting image can be improved in appearance by changing the brush pattern 3g arranged in each pixel according to the brightness.
[0088]
If the brightness is 0 to 50 (dark), the brush A is used, and if the brightness is 51 to 200, the brush B is used. If the brightness is 201 to 255 (bright), the brush C is used. In the same manner as the brush pattern arrangement process -4, the image is drawn on the output image (here, the work image area 3a3). By performing this process on all the pixels of the image, the dark area can be shown with a thick pen, or the bright area can appear to be drawn with a short pen pitch as if it was drawn strongly. Can be obtained.
[0089]
Different styles can be created by changing the angle of the brush pattern. When a brush pattern as shown in (2) of FIG. 26 is prepared as the brush pattern 3g and any pattern is adopted by a predetermined calculation method, it is possible to obtain a result of drawing with a pen from various directions. As the calculation method, various methods such as the brightness of the pixel of the original image, the count number at which the brush is arranged, and a random number are conceivable.
[0090]
For example, if (brightness of pixel) mod (3) = 0, use brush pattern 1 in (2), use brush pattern 2 if 1, and use brush pattern 3 if 2. Whether to use a pattern can be determined by generating a random number, or can be used in the order of brush patterns 1, 2, and 3 for pixels generated by binarization.
[0091]
(Embodiment 4)
In the case of the processing described in the second and third embodiments, for any pixel on which a brush is placed, a brush pattern is not included in pixels in the vicinity of (brush pattern width / 2) and (brush pattern height / 2). The value (color) by 3g is put. Therefore, in the original image, when pixels with a strong contrast between light and dark are next to each other or close to each other, the pixels are also placed at the boundary portion, so that the difference in light and darkness that can be said to be the outline is blurred. There is a possibility. For example, it is conceivable that the outline of the person and the background portion becomes difficult to understand.
[0092]
In the fourth embodiment, a method for solving such a problem will be described. The brush arrangement position determination process (1) in step S8-5 shown in the flowchart of FIG. However, although the actual processing is performed when the brush pattern 3g is drawn in the output image in step S8-4, it is described separately as step S8-4 and step S8-5 in order to make the processing easy to understand. This process is actually performed in step S8-06 in the flowchart of FIG.
[0093]
The processing of the fourth embodiment will be described with reference to FIG.
[0094]
When it is determined in steps S8-21 and S8-22 in the flowchart of FIG. 21 that the pixel of interest is a pixel on which the brush pattern 3g is arranged, the gray-converted original image (here, the image of the processing image area 3a2) ) Is acquired in advance. In the case of the example of FIG. 23 of the fourth embodiment, it is “0”. Next, the brightness of the pixel of the original image subjected to gray conversion corresponding to the position of the pixel where the color is placed in the brush pattern 3g to be arranged is acquired. In the example of FIG. 23, the hatched pixel corresponds to that. The difference between the pixel of interest and the brightness value thereof is respectively determined and determined in advance (set in the initial processing step S2, or fixedly specified by the program, or specified by the user's operation) ) If the value is greater than the value (the difference in brightness is large), the color should not be placed.
[0095]
In the example shown in FIG. 23, the color value of the original image of the pixel of interest is “0”, and the brightness value of the original image at the position corresponding to the uppermost right and the lower left of the brush pattern 3g is “23”. Is. Here, if there is a designation of “no color is placed if the difference in brightness is 12 or more”, the difference between “0” and “23” is 23, which is larger than 12, so those two The result of placing the brush pattern 3g on the target pixel without arranging the pixel on the output image is as shown in (4) of FIG. In addition, the brightness value of the image at the position corresponding to the lower left of the brush pattern is “10”, and the difference in brightness value from the pixel of interest is 10 and smaller than 12, so that pixel Will be placed on the output image. The brightness of the original image at the position immediately below the target pixel is “0”, and the difference in brightness from the target pixel is 0 (same as the target pixel), which is smaller than 12. Therefore, the pixel is also arranged on the output image.
[0096]
By performing such processing on all the pixels of the image, a portion such as a contour line having a sharp brightness difference remains as it is, and a pen-style processing result that retains the properties of the original image as compared with the second embodiment. Can be obtained. An example of an image on which this processing has been performed is an image 8 in FIG.
[0097]
(Embodiment 5)
In the pen image processing described in the second to fourth embodiments, the brush pattern 3g is arranged for the pixels generated by the binarization processing. However, if the bright (close to white) portion is desired to be brightened, The method described in the fifth embodiment is effective. Similarly to the second to fourth embodiments described so far, the fifth embodiment is different only in the process of step S16 shown in step S8 (flowchart of FIG. 21), and only the process will be described. FIG. 16 is a flowchart showing the overall flow. The brush arrangement position determination process (2) in step S8-6 in the flowchart of FIG. 16 is a means described in the fifth embodiment. Whether or not to place a brush on the pixel of interest is determined by the brush placement position determination process (2) in step S8-6, but only if it is determined to be “place” here, step S8. -4 brush pattern placement processing. If it is determined that “not to arrange”, the target pixel is moved to the next pixel.
[0098]
The brush arrangement position determination process (2) in step S8-6 will be described with reference to FIG. In the example of FIG. 24, the brightness value is set to 0 (black) to 23 (white). In this process, the brightness value of the gray-converted original image of the pixel of interest (here, the image of the processing image area 3a2) is set in advance (set in the initial processing step S2 or is programmed). In the case of a value (18 in the example of FIG. 25) that is fixedly specified by the user or specified by the user's operation (brighter), 2 of the pixels generated by binarization satisfying the condition. The brush pattern 3g is placed on only one pixel (or more) of the pixels. The method of placing the brush pattern 3g on only one pixel out of two (or more) pixels is to prepare one counter for the pixels satisfying the above condition and keep the above condition until it exceeds 2 (or more). Whenever there is a pixel to be filled, 1 is added, and when it exceeds, a brush pattern 3g is placed.
[0099]
As can be seen from FIG. 24, in (1), the brightness of the original image of the pixel to which the brush is placed in this range is all 20, and in the case of a pixel having a brightness of 18 or more, If the brush is placed on only one pixel, the pixel on which the brush is actually placed is as shown in (2). When a brush is placed on these pixels, a brighter result is obtained than when this determination is not performed as in (3).
[0100]
By performing such processing on all the pixels of the image, it is possible to obtain a pen drawing-like processing result in which bright portions are expressed brighter.
[0101]
(Embodiment 6)
By using the processes described in the third to fifth embodiments in combination, more effective results can be generated.
[0102]
In addition to the basic processing of the pen drawing process described in the second embodiment, the brush arrangement position determination process (1) in step S8-5 described in the fourth embodiment and the process in step S8-6 described in the fifth embodiment. By combining the brush arrangement position determination process (2) (flowchart in FIG. 17), it is possible to obtain an effect that the portion where the brightness difference is intense remains the same and the bright portion is expressed brighter.
[0103]
(Embodiment 7)
In addition to the basic processing of the pen drawing process described in the second embodiment, the brush pattern selection process in step S8-3 described in the third embodiment and the brush arrangement position determination in step S8-6 described in the fifth embodiment. By combining the processing (2) (the flowchart of FIG. 18), it is possible to obtain a pen drawing style effect having strength and an effect that bright portions are expressed brighter.
[0104]
(Embodiment 8)
In addition to the basic processing of the pen drawing process described in the second embodiment, the brush pattern selection process in step S8-3 described in the third embodiment and the brush arrangement position determination in step S8-6 described in the fourth embodiment. By combining the processing (1) (flowchart in FIG. 19), it is possible to obtain an effect that the portion where the difference in brightness is intense retains its property and the bright portion is expressed brighter.
[0105]
(Embodiment 9)
In addition to the basic processing of the pen drawing process described in the second embodiment, the brush pattern selection process in step S8-3 described in the third embodiment and the brush arrangement position determination in step S8-6 described in the fourth embodiment. By combining the processing (1) and the brush arrangement position determination processing (2) in step S8-6 described in the fifth embodiment (flowchart in FIG. 20), the effect and brightness of a pen drawing style having strengths are obtained. It is possible to obtain an effect that the portion where the difference is large retains its properties, and the bright portion is expressed more brightly.
[0106]
(Embodiment 10)
In each of the above-described embodiments, a method has been described in which gamma conversion is used as the brightness conversion table 3d and a bright part is converted to be brighter and a dark part is converted to a darker part. However, the conversion table can also be created such that, for example, the brightness is converted stepwise as shown in FIG. 7 so that a certain range of brightness is converted to a constant brightness (posterization). . In the example of FIG. 7, when the brightness is set to 24 levels from 0 to 23, all the pixels of brightness 3 to 8 of the original image are converted to brightness of 3, and the brightness of the original image 14 To 20 pixels are all converted to 15 brightness. An image 7 in FIG. 26 is an example of this. It can be seen that the brightness is divided into several stages, as shown by contour lines. Thus, by setting the brightness conversion table 3d in several stages, an illustration-like effect can be obtained.
[0107]
In addition, the brightness conversion table 3d of each of the above embodiments may have a large difference in brightness and darkness or a little difference depending on the value of the gamma value even when gamma conversion is used. Various results are obtained.
[0108]
Finally, each image in FIG. 26 will be described together.
[0109]
First, for the image 1, the original image of the image 3 is converted to gray, and the pen image processing using the brush arrangement position determination processing (1) is performed on the image that is converted to bright overall by gamma conversion with gamma <1. This is the image that was performed.
[0110]
As described in the present invention, peak brightness detection processing of gray image, brightness averaging conversion table creation processing, brightness conversion table creation processing, brightness conversion processing, histogram table, brightness averaging conversion table When the brightness conversion table is not used, the image is converted into a very deteriorated image.
[0111]
Next, image 2 is an image obtained by performing processing according to the present invention on the original image of image 3. This example is according to the fourth embodiment. Even when compared with image 1, it can be seen that the original image is well processed and the pen image tone is beautifully processed.
[0112]
Next, the image 3 is an original image before the processing is performed on the images 1, 2, and 4 to 8.
[0113]
Next, the image 4 is an example of an image obtained by converting the original image 3 into gray (step S4-1).
[0114]
Next, the image 5 is an example of an image obtained by averaging the brightness of the image 4 (step S8-11).
[0115]
Next, image 6 is an example of an image obtained by converting the brightness of image 5 according to a brightness conversion table using gamma conversion (step S8-12).
[0116]
Next, the image 7 is an example of an image obtained by converting the brightness of the image 5 according to the brightness conversion table 2 that converts the brightness in a stepwise manner (step S8-12).
[0117]
Finally, the image 8 is an example of an image obtained by processing the image 7 into a pen painting tone using the brush arrangement position determination process (1).
[0118]
【The invention's effect】
As described above, according to the present invention, a color image or a monochrome multi-valued image can be expressed in a good-looking manner without depending on the brightness of an input image or the like, and a pen-style-like processing result can be applied. The image can be more appealing and the power of expression can be increased, so even general users who do not have much knowledge about images, how to handle them, and colors can easily perform image processing. In addition, it is possible to obtain an effect that familiarity can be obtained by image processing.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a schematic configuration of a data processing apparatus according to a first embodiment of the present invention.
FIG. 2 is a diagram illustrating a configuration example of color image data handled in the first embodiment.
FIG. 3 is a diagram illustrating an example of a histogram handled in the first embodiment.
FIG. 4 is a diagram illustrating an example of a histogram handled in the first embodiment.
FIG. 5 is a diagram illustrating an example of a brightness averaging conversion table handled in the first embodiment;
FIG. 6 is a diagram showing an example of a brightness conversion table handled in the first embodiment.
FIG. 7 is a diagram illustrating an example of a brightness conversion table handled in the first embodiment.
FIG. 8 is a flowchart for explaining the operation of the first embodiment;
FIG. 9 is a flowchart for explaining the operation of the first embodiment;
FIG. 10 is a flowchart for explaining the operation of the first embodiment;
FIG. 11 is a flowchart for explaining the operation of the first embodiment;
FIG. 12 is a block diagram showing a schematic configuration of a data processing apparatus according to another embodiment of the present invention.
FIG. 13 is a flowchart for explaining the operation of the second embodiment of the present invention.
FIG. 14 is a flowchart for explaining an operation of the third embodiment of the present invention.
FIG. 15 is a flowchart for explaining the operation of the fourth embodiment of the present invention;
FIG. 16 is a flowchart for explaining the operation of the fifth embodiment of the present invention;
FIG. 17 is a flowchart for explaining the operation of the sixth embodiment of the present invention;
FIG. 18 is a flowchart for explaining the operation of the seventh embodiment of the present invention.
FIG. 19 is a flowchart for explaining the operation of the eighth embodiment of the present invention.
FIG. 20 is a flowchart for explaining the operation of the ninth embodiment of the present invention.
FIG. 21 is a flowchart for explaining the operation of the tenth embodiment of the present invention.
FIG. 22 is a diagram for explaining the arrangement of brushes handled in another embodiment of the present invention.
FIG. 23 is a diagram for explaining brush arrangement position handling in another embodiment of the present invention.
FIG. 24 is a diagram for explaining determination of the arrangement position of a brush handled in another embodiment of the present invention.
FIG. 25 is a diagram for explaining the types of brush patterns handled in another embodiment of the present invention.
FIG. 26 is a diagram collectively showing images processed in each embodiment of the present invention.
[Explanation of symbols]
1 CPU
2 ROM
3 RAM
4 Keyboard
5 mouse
6 Display
7 External storage device
8 Bus line

Claims (9)

白黒多値画像を記憶する画像記憶手段と、
前記画像記憶手段に記憶された白黒多値画像のヒストグラムを作成するヒストグラム作成手段と、
前記画像記憶手段に記憶された白黒多値画像の明るさのピークを検出するピーク検出手段と、
前記ヒストグラム作成手段により作成されたヒストグラムと、前記ピーク検出手段により検出された明るさのピークとに基づいて、前記白黒多値画像の明るさを平均化する変換を行う平均化変換手段と、
前記平均化変換手段によって変換された画像の明るさに強弱を付ける変換を行う強弱変換手段と
前記強弱変換手段によって変換された白黒多値画像を二値データに変換する二値化変換手段と、
前記二値化変換手段により変換された画像の画素と、該画素の近傍の画素とに、ペンによる描画を模したブラシパターンを配置するブラシパターン配置手段と、
前記ブラシパターン配置手段によるブラシパターンの配置の際に、ある画素に対して、与えられたブラシパターンの各要素を配置するか否かを判定する配置判定手段とを有し、
前記配置判定手段は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差に基づいて、前記ブラシパターン配置手段によるブラシパターンの配置を行うことを特徴とする画像処理装置。
Image storage means for storing black and white multi-valued images;
Histogram creation means for creating a histogram of a monochrome multi-value image stored in the image storage means;
Peak detection means for detecting the brightness peak of the monochrome multi-valued image stored in the image storage means;
An averaging conversion means for performing conversion for averaging the brightness of the monochrome multi-valued image based on the histogram created by the histogram creation means and the brightness peak detected by the peak detection means;
Strength conversion means for performing conversion to add intensity to the brightness of the image converted by the averaging conversion means ;
Binarization conversion means for converting the monochrome multi-valued image converted by the strength conversion means into binary data;
Brush pattern placement means for placing a brush pattern simulating drawing with a pen on the pixels of the image converted by the binarization conversion means and the pixels in the vicinity of the pixels;
An arrangement determination unit that determines whether or not to arrange each element of a given brush pattern for a certain pixel when the brush pattern is arranged by the brush pattern arrangement unit;
The arrangement determination unit performs the arrangement of the brush pattern by the brush pattern arrangement unit based on the difference between the brightness of the target pixel of the monochrome multi-valued image and the brightness of the pixel adjacent to the target pixel. An image processing apparatus.
2次元カラー画像を白黒多値画像に変換するグレー変換手段を含み、前記画像記憶手段は、前記グレー変換手段により変換された白黒多値画像を記憶することを特徴とする請求項1記載の画像処理装置。  2. The image according to claim 1, further comprising gray conversion means for converting a two-dimensional color image into a monochrome multi-value image, wherein the image storage means stores the monochrome multi-value image converted by the gray conversion means. Processing equipment. 前記配置判定手段は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差が予め定められた値よりも大きい場合、前記ブラシパターン配置手段によるブラシパターンの配置を行わないことを特徴とする請求項1記載の画像処理装置。When the difference between the brightness of the target pixel of the black and white multi-valued image and the brightness of a pixel adjacent to the target pixel is larger than a predetermined value, the arrangement determining unit determines the brush pattern by the brush pattern arranging unit. 2. The image processing apparatus according to claim 1, wherein no arrangement is performed. さらに、前記配置判定手段は、前記白黒多値画像の各画素の明るさの値に基づいて、前記ブラシパターン配置手段によるブラシパターンの配置を行うことを特徴とする請求項1乃至3記載の画像処理装置。The image according to any one of claims 1 to 3 , wherein the arrangement determination unit performs arrangement of a brush pattern by the brush pattern arrangement unit based on a brightness value of each pixel of the monochrome multi-valued image. Processing equipment. 画像記憶手段に記憶された白黒多値画像のヒストグラムを作成するヒストグラム作成工程と、
前記画像記憶手段に記憶された白黒多値画像の明るさのピークを検出するピーク検出工程と、
前記ヒストグラム作成工程で作成されたヒストグラムと、前記ピーク検出工程で検出された明るさのピークとに基づいて、前記白黒多値画像の明るさを平均化する変換を行う平均化変換工程と、
前記平均化変換工程によって変換された画像の明るさに強弱を付ける変換を行う強弱変換工程と
前記強弱変換工程によって変換された白黒多値画像を二値データに変換する二値化変換工程と、
前記二値化変換工程により変換された画像の画素と、該画素の近傍の画素とに、ペンによる描画を模したブラシパターンを配置するブラシパターン配置工程と、
前記ブラシパターン配置工程によるブラシパターンの配置の際に、ある画素に対して、与えられたブラシパターンの各要素を配置するか否かを判定する配置判定工程とを有し、
前記配置判定工程は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差に基づいて、前記ブラシパターン配置工程によるブラシパターンの配置を行うことを特徴とする画像処理方法。
A histogram creating step for creating a histogram of the monochrome multi-valued image stored in the image storage means;
A peak detection step of detecting a brightness peak of the black and white multivalued image stored in the image storage means;
An averaging conversion step for performing conversion for averaging the brightness of the black and white multi-valued image based on the histogram created in the histogram creation step and the brightness peak detected in the peak detection step;
An intensity conversion step for performing conversion to add intensity to the brightness of the image converted by the averaging conversion step ;
A binarization conversion step of converting the monochrome multi-valued image converted by the strength conversion step into binary data;
A brush pattern arranging step of arranging a brush pattern imitating a drawing with a pen on a pixel of the image converted by the binarization conversion step and a pixel in the vicinity of the pixel;
An arrangement determination step for determining whether or not to arrange each element of a given brush pattern for a certain pixel at the time of arrangement of the brush pattern by the brush pattern arrangement step,
In the arrangement determining step, the brush pattern is arranged by the brush pattern arrangement step based on the difference between the brightness of the target pixel of the monochrome multi-valued image and the brightness of the pixel adjacent to the target pixel. Image processing method.
2次元カラー画像を白黒多値画像に変換するグレー変換工程を含み、前記画像記憶手段は、前記グレー変換工程により変換された白黒多値画像を記憶することを特徴とする請求項記載の画像処理装置。6. The image according to claim 5 , further comprising a gray conversion step of converting a two-dimensional color image into a monochrome multi-value image, wherein the image storage means stores the black-and-white multi-value image converted by the gray conversion step. Processing equipment. 前記配置判定工程は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差が予め定められた値よりも大きい場合、前記ブラシパターン配置工程によるブラシパターンの配置を行わないことを特徴とする請求項5記載の画像処理装置。When the difference between the brightness of the pixel of interest of the black and white multi-valued image and the brightness of a pixel adjacent to the pixel of interest is greater than a predetermined value, the arrangement determining step determines the brush pattern in the brush pattern arrangement step. 6. The image processing apparatus according to claim 5, wherein no arrangement is performed. さらに、前記配置判定工程は、前記白黒多値画像の各画素の明るさの値に基づいて、前記ブラシパターン配置工程によるブラシパターンの配置を行うことを特徴とする請求項5乃至7記載の画像処理装置。The image according to any one of claims 5 to 7 , wherein the arrangement determination step performs arrangement of a brush pattern by the brush pattern arrangement step based on a brightness value of each pixel of the monochrome multi-valued image. Processing equipment. 画像記憶手段に記憶された白黒多値画像のヒストグラムを作成するヒストグラム作成工程と、
前記画像記憶手段に記憶された白黒多値画像の明るさのピークを検出するピーク検出工程と、
前記ヒストグラム作成工程で作成されたヒストグラムと、前記ピーク検出工程で検出された明るさのピークとに基づいて、前記白黒多値画像の明るさを平均化する変換を行う平均化変換工程と、
前記平均化変換工程によって変換された画像の明るさに強弱を付ける変換を行う強弱変換工程と
前記強弱変換工程によって変換された白黒多値画像を二値データに変換する二値化変換工程と、
前記二値化変換工程により変換された画像の画素と、該画素の近傍の画素とに、ペンによる描画を模したブラシパターンを配置するブラシパターン配置工程と、
前記ブラシパターン配置工程によるブラシパターンの配置の際に、ある画素に対して、与えられたブラシパターンの各要素を配置するか否かを判定する配置判定工程とを有し、
前記配置判定工程は、前記白黒多値画像の注目画素の明るさと、該注目画素に隣接する画素の明るさとの差に基づいて、前記ブラシパターン配置工程によるブラシパターンの配置を行うことを具備したことを特徴とする画像処理方法を実現するためのコンピュータプログラムを格納し、コンピュータにより呼び出し可能な記憶媒体。
A histogram creating step for creating a histogram of the monochrome multi-valued image stored in the image storage means;
A peak detection step of detecting a brightness peak of the black and white multivalued image stored in the image storage means;
An averaging conversion step for performing conversion for averaging the brightness of the black and white multi-valued image based on the histogram created in the histogram creation step and the brightness peak detected in the peak detection step;
An intensity conversion step for performing conversion to add intensity to the brightness of the image converted by the averaging conversion step ;
A binarization conversion step of converting the monochrome multi-valued image converted by the strength conversion step into binary data;
A brush pattern arranging step of arranging a brush pattern imitating a drawing with a pen on a pixel of the image converted by the binarization conversion step and a pixel in the vicinity of the pixel;
An arrangement determination step for determining whether or not to arrange each element of a given brush pattern for a certain pixel at the time of arrangement of the brush pattern by the brush pattern arrangement step,
The arrangement determining step includes arranging the brush pattern by the brush pattern arranging step based on a difference between the brightness of the target pixel of the monochrome multi-valued image and the brightness of a pixel adjacent to the target pixel . A storage medium storing a computer program for realizing an image processing method characterized in that the computer program can be called by a computer.
JP29000696A 1996-10-31 1996-10-31 Image processing method and apparatus, and storage medium Expired - Fee Related JP3950501B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29000696A JP3950501B2 (en) 1996-10-31 1996-10-31 Image processing method and apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29000696A JP3950501B2 (en) 1996-10-31 1996-10-31 Image processing method and apparatus, and storage medium

Publications (2)

Publication Number Publication Date
JPH10134178A JPH10134178A (en) 1998-05-22
JP3950501B2 true JP3950501B2 (en) 2007-08-01

Family

ID=17750567

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29000696A Expired - Fee Related JP3950501B2 (en) 1996-10-31 1996-10-31 Image processing method and apparatus, and storage medium

Country Status (1)

Country Link
JP (1) JP3950501B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11080831B2 (en) 2016-02-05 2021-08-03 Nec Platforms, Ltd. Image data conversion device, image data conversion method, image data conversion program, POS terminal device, and server

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69937302T2 (en) 1998-07-31 2008-07-10 Seiko Epson Corp. MONTONE CONVERSION DEVICE, MONOTONE CONVERSION PROCESS AND MEDIUM ON WHICH A MONOTONE CONVERTIBLE PROGRAM CAN BE TAKEN
SG75190A1 (en) 1998-12-14 2000-09-19 Canon Kk Image processing method and apparatus image processing system and storage medium
US7375844B2 (en) 2000-12-22 2008-05-20 Seiko Epson Corporation Method for generating a print data file, method for storing print data, a data storage medium therefor, and an apparatus for generating a data storage file
US7283275B2 (en) 2000-12-28 2007-10-16 Seiko Epson Corporation Logo data generating apparatus, logo data generating method, and data storage medium
US7428074B2 (en) 2000-12-28 2008-09-23 Seiko Epson Corporation Logo data generating apparatus, logo data generating method, and data storage medium
US7292369B2 (en) 2000-12-28 2007-11-06 Seiko Epson Corporation Logo data generating method and system
US7280258B2 (en) 2001-01-05 2007-10-09 Seiko Epson Corporation Logo data generating system, logo data generating method, and data storage medium
JP4243081B2 (en) 2002-09-05 2009-03-25 三洋電機株式会社 Image data processing apparatus and image data processing method
JP5679767B2 (en) * 2010-10-28 2015-03-04 ラピスセミコンダクタ株式会社 Fingerprint authentication apparatus and fingerprint authentication program
JP6338194B2 (en) * 2017-08-09 2018-06-06 Necプラットフォームズ株式会社 Image data conversion apparatus, image data conversion method, image data conversion program, POS terminal apparatus, and server
JP6384943B2 (en) * 2018-05-08 2018-09-05 Necプラットフォームズ株式会社 Image data conversion apparatus, image data conversion method, image data conversion program, POS terminal apparatus, and server
JP6384942B2 (en) * 2018-05-08 2018-09-05 Necプラットフォームズ株式会社 Image data conversion apparatus, image data conversion method, image data conversion program, POS terminal apparatus, and server

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11080831B2 (en) 2016-02-05 2021-08-03 Nec Platforms, Ltd. Image data conversion device, image data conversion method, image data conversion program, POS terminal device, and server
US11138705B2 (en) 2016-02-05 2021-10-05 Nec Platforms, Ltd. Image data conversion device, image data conversion method, image data conversion program, POS terminal device, and server

Also Published As

Publication number Publication date
JPH10134178A (en) 1998-05-22

Similar Documents

Publication Publication Date Title
JP3950501B2 (en) Image processing method and apparatus, and storage medium
US6021221A (en) Image processing apparatus
KR100369909B1 (en) Apparatus and method for modifying original images
Szeliski Locally adapted hierarchical basis preconditioning
US7817159B2 (en) Digital painting
Phillips Image processing in C
KR100320298B1 (en) Image processing method and system
US6529202B2 (en) Color adviser
EP0843283B1 (en) Method of font rendering employing grayscale processing of grid fitted fonts
EP0740270B1 (en) Image output device
CN101510302B (en) Method and apparatus for enhancing image
Pinoli The logarithmic image processing model: Connections with human brightness perception and contrast estimators
US7123269B1 (en) Modifying vector objects
KR20040076804A (en) Color gradient paths
GB2236463A (en) Method and apparatus for dithering antialiased vectors
JP5939154B2 (en) Image processing apparatus and computer program
JP3550362B2 (en) Image processing apparatus and method, and recording medium
JPH10214339A (en) Picture filtering method
JP2006031688A (en) Image processing device, method, and program
US9875555B2 (en) Partitioning an image
Rizani Image quality improvement using image processing method image brightness contrast and image sharpening
JPH08123940A (en) Method and device for extracting picture area
JP4019239B2 (en) Image sharpening method and image sharpening device
JP2973710B2 (en) Limited color determination method and limited color determination device
JP6711031B2 (en) Image processing apparatus, image processing method, image processing system and program

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060929

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061003

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061204

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070109

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070312

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070423

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

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130427

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130427

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20140427

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees