JP2004096709A - Image processing apparatus and image processing method - Google Patents

Image processing apparatus and image processing method Download PDF

Info

Publication number
JP2004096709A
JP2004096709A JP2003130539A JP2003130539A JP2004096709A JP 2004096709 A JP2004096709 A JP 2004096709A JP 2003130539 A JP2003130539 A JP 2003130539A JP 2003130539 A JP2003130539 A JP 2003130539A JP 2004096709 A JP2004096709 A JP 2004096709A
Authority
JP
Japan
Prior art keywords
pixel
value
error
image processing
quantization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2003130539A
Other languages
Japanese (ja)
Other versions
JP2004096709A5 (en
JP4136779B2 (en
Inventor
Takashi Ishikawa
石川 尚
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 JP2003130539A priority Critical patent/JP4136779B2/en
Priority to US10/611,948 priority patent/US8009327B2/en
Publication of JP2004096709A publication Critical patent/JP2004096709A/en
Publication of JP2004096709A5 publication Critical patent/JP2004096709A5/ja
Application granted granted Critical
Publication of JP4136779B2 publication Critical patent/JP4136779B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To decrease a required buffer memory capacity while reducing the influence of a calculation error in error diffusion processing. <P>SOLUTION: A quantization circuit 4 quantizes input image data and outputs an output code. The quantization error which has occurred in the quantization circuit 4 is calculated by an inverse quantization circuit 5 and a subtractor 6. The calculated quantization error is stored in a buffer 8. Since the buffer 8 only needs to have a size capable of storing the quantization error, its size can be made smaller than before. A diffusion filter 9 diffuses the quantization error by using a quantization error or the like which is stored in the buffer 8. A latch 3 and a bit connector 1 are useful for reducing the influence of the calculation error in error diffusion processing on the next input image data. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は画像処理方法及び装置に係り、とりわけ、入力画像濃度と出力画像濃度等の差を誤差拡散法等により保存しつつ、入力データを2値又は多値データへと量子化する画像処理方法及び装置に関する。
【0002】
【従来の技術】
従来、入力多値データを、2値又は入力多値データのレベルよりも少ないレベルの多値で表現するには、疑似中間調処理が用いられる。その一例として誤差拡散法が知られている。この誤差拡散法については、”An Adaptive Algorithm for Spatial Gray Scale”in society for Information Display 1975 Symposium Digest of Technical Papers,1975,36で発表されている。この方法では、着目画素をPとし、その画素の濃度をvとし、Pの周辺に存在する2値化処理前の画素P0、P1、P2、P3の濃度をそれぞれv0、v1、v2、v3とし、2値化のための閾値をTとして、経験的に求めた重み係数W0、W1、W2、W3を用い、着目点Pにおける2値化誤差Eを重み付けし、周辺画素P0、P1、P2、P3のそれぞれへと配分するものである。すなわち、この方法は、マクロ的に出力画像の平均濃度を入力画像の濃度と等しくする方法である。このとき、出力2値データをoとすると、以下の式により周辺画素P0、P1、P2、P3に対する誤差E0、E1、E2、E3を求めることができる。
【0003】
v≧Tならばo=1、E=v−Vmax
v<Tならばo=0、E=v−Vmin
(ただし、Vmax:最大濃度、Vmin:最小濃度)
E0=E×W0;
E1=E×W1;
E2=E×W2;
E3=E×W3;
(重み係数の例:W0=7/16,W1=1/16,W2=5/16,W3=3/16)
ところで、この誤差を伝播するためには、誤差バッファが必要である。なお、上記の例からも解るように重み係数は1以下の小数である。
【0004】
従って、上記重み係数の例で入力画像のビット数を8とし、2値化の閾値を128に固定したとすれば、量子化誤差は−127〜127となるから、誤差バッファのビット数として12ビットも必要になるという欠点があった。
【0005】
これを解決する方法として、特許文献1及び特許文献2においては、2値化誤差に重み係数を乗じた結果の小数部を切り捨てて求めた誤差配分値の総和を求め、2値化誤差との差分より剰余誤差を演算し、周辺画素へ再配分する方法が開示されている。
【0006】
また、特許文献3においては2値化誤差より下位nビットを抽出し、下位nビットを0で補填した2値化誤差に重み係数を乗じたもの誤差配分値とし、上記抽出した2値化誤差の下位nビットを上記誤差配分値の1つに加算して周辺画素へ配分する方法が開示されている。
【0007】
また、特許文献4においては2値化誤差の上位ビットをバッファメモリへ格納し、2値化誤差の下位ビットはラッチして次画素へ加算する方法が開示されている。
【0008】
【特許文献1】
特公平06−066876号公報
【特許文献2】
特公平07−022334号公報
【特許文献3】
特公平07−093682号公報
【特許文献4】
特開平05−075863号公報。
【0009】
【発明が解決しようとする課題】
ところが、上記特許文献1または特許文献2に開示された方法では、誤差配分値の総和を求め、2値化誤差との差分より剰余誤差を演算しなければならないという欠点があった。
【0010】
また、特許文献3に開示された方法では、上記剰余誤差を演算しなくて良いが、誤差配分の演算に用いる2値化誤差のビット精度が落ちるため、配分比率が2値化誤差の大きさに依存して変わってしまうという欠点があった。例えば、上記の重み係数の場合、剰余誤差を0にするには2値化誤差の下位4ビットを0にして係数を乗じるが、2値化誤差が15以下の場合は全て0になってしまうので、特定の画素に全ての2値化誤差が配分されてしまう。
【0011】
また、特許文献4に開示された方法では、2値化誤差の上位ビットをバッファメモリへ格納するため、バッファメモリは大幅に削減できるが、特許文献3に開示された方法と同様に誤差配分の演算に用いる2値化誤差のビット精度が落ちるため、配分比率が2値化誤差の大きさに依存して変わってしまうという欠点があった。例えば、上記の重み係数の場合、剰余誤差を0にするには2値化誤差の上位4ビットをバッファメモリに格納し、ラッチに下位4ビットを格納しなければならないが、2値化誤差が15以下の場合は全て0になってしまうので、次の画素に全ての2値化誤差が配分されてしまう。また、誤差配分の精度をあげるため、2値化誤差の上位5ビット以上をバッファメモリに格納する場合は丸め(切捨て)による誤差が発生してしまう。さらに、特許文献4には2値化誤差の「下位ビットは符号を拡張した後、ラッチ回路4に保存される」と記載されているが、2値化誤差が負の時に下位ビットを符号拡張した場合は上位ビットに1を加算しなければならない。
【0012】
例えば−1は8ビットバイナリでは11111111であるが、これを4ビットの上位・下位に分割すると1111と1111になる。下位ビットを負号拡張した場合は11111となり−1を表すが、上位ビット1111は11110000の意味なので−16を意味する。従って上位と下位を加算した結果は−17になってしまう。従って、不一致を避けるには上位ビット1111に1を加えて0000(キャリーは考慮しない)としなければならない。また、2値化誤差の下位ビットを入力画素データに加算するため、2値化誤差のレンジが拡大し1ビット増加してしまうという欠点があった。例えば、2値化誤差の下位4ビットをラッチする場合、通常の2値化誤差のレンジは−127〜127であるので8ビットで表現できるが、特開平05−075863号公報に開示された方法では2値化誤差の下位4ビット(符号拡張されているので−15から15のレンジとなる)が入力画素データに加算されるため、2値化誤差のレンジは−142〜142となり9ビット必要になってしまう。
【0013】
本発明は上述した課題を解決するものであり、誤差拡散時の演算誤差の影響を補償しつつ、バッファメモリの容量を削減することができる画像処理方法及び装置の提供を目的とする。
【0014】
【課題を解決するための手段】
本発明のある観点によれば、入力画像データを量子化する量子化手段と、前記量子化手段の量子化処理により発生した量子化誤差を算出する算出手段と、前記算出された量子化誤差を格納するバッファと、前記バッファに格納されている第1の画素の量子化誤差と、前記算出手段により算出された第2の画素の量子化誤差とに少なくとも基づいて、量子化誤差を拡散する誤差拡散手段と、前記誤差拡散手段による演算誤差が以降の入力画像データに与える影響を低減する低減手段とを備える画像処理装置を提供する。
【0015】
このように、本発明によれば、量子化誤差をバッファメモリに格納することとしたため、バッファメモリは、少なくとも量子化誤差分のビット数だけを備えていればよく、従来よりも容量を削減することが可能となる。さらに、低減手段を設けることにより、演算誤差の影響を排除でき、とりわけ画像のハイライト部分を高画質化することができる。
【0016】
例えば、前記低減手段は、前記誤差拡散手段により量子化誤差を拡散すべく生成された補正値の小数部を次の入力画像データの下位ビット側に結合する結合手段を含んでも良い。すなわち、誤差拡散演算後の小数部を入力画像データの下位ビット側に結合した後、上記入力画像データを補正することになるため、出力画像を高画質化することができる。
【0017】
また、前記補正値を次の画素以降に伝播させることが不適当な場合には、該補正値の伝播を阻止する阻止手段をさらに含んでもよい。不適当な場合とは、例えば、注目画素がラインの先頭画素である場合、注目画素が入力画像の下限レベルの値を有する場合(例:白画素)又は注目画素が入力画像の上限レベルの値を有する場合(例:黒画素)などであろう。もちろん、例示以外の不適当な場合にも本発明が適用できることは言うまでもない。なお、ここでいう下限レベルや上限レベルとは、1つの値だけでなく、所定範囲内に存在する複数の値であってもよい。
【0018】
また、前記補正値の小数部を保持する保持手段と、前記保持手段に保持されている補正値の小数部を次の入力画像データの下位ビット側に結合することが不適当な場合に、前記保持手段に保持されている小数部をクリアするクリア手段とをさらに含んでもよい。
【0019】
また、入力画像の走査方向が反転された場合には、前記クリア手段のクリア処理を制限する処理制限手段をさらに備えてもよい。
【0020】
例えば、1ラインごとに走査方向を反転させる場合は、画像の先頭でのみ0にクリアするようクリア処理を制限することが可能となる。従って、走査方向を反転させる場合にも高画質化の効果を期待できよう。
【0021】
また、前記算出手段により算出された量子化誤差を所定範囲内の数値へと制限する数値制限手段をさらに備えてもよい。これにより、量子化誤差を格納するバッファメモリのサイズを節約することができる。
【0022】
本発明の他の観点によれば、注目画素の画像データをビット拡張するビット拡張手段と、前記ビット拡張された画像データを補正する補正手段と、前記補正された画像データの整数部を量子化する量子化手段と、前記量子化手段により発生する量子化誤差を保持する保持手段と、前記保持手段により保持されている第1の量子化誤差と、前記注目画素に関する第2の量子化誤差とに少なくとも基づいて、前記補正手段により利用される補正値を生成する補正値生成手段と、前記ビット拡張手段のビット拡張処理において、次の画像データの下位ビット側へと結合される前記補正値の少数部を格納する格納手段と、を備える画像処理装置が提供される。
【0023】
このように、本発明によれば、量子化誤差をバッファメモリに格納することとしたため、バッファメモリは、少なくとも量子化誤差分のビット数だけを備えていればよく、従来よりも容量を削減することが可能となる。さらに、誤差拡散演算後の小数部を入力画像データの下位ビット側に結合した後、上記入力画像データを補正することになるため、出力画像を高画質化することができる。
【0024】
本発明のさらに他の観点によれば、入力された画像データの上位ビットを量子化する量子化手段と、前記量子化手段の量子化処理により発生した量子化誤差を算出する算出手段と、
前記算出された量子化誤差を格納するバッファと、前記バッファに格納されている第1の画素の量子化誤差と、前記算出手段により算出された第2の画素の量子化誤差とに少なくとも基づいて、第3の画素の画像データを誤差拡散する誤差拡散手段と、前記誤差拡散された画像データの所定ビット以下の値を保持する保持手段と、前記保持されている値の整数部を、入力された画像データへと加算する加算手段と、前記保持されている値の小数部を、前記整数部を加算された画像データの下位ビット側に結合して前記量子化手段へと出力するビット結合手段とを備える画像処理装置が提供される。
【0025】
このように、量子化誤差の上位ビットをバッファメモリに格納することにより、バッファメモリの容量を削減できる。さらに、誤差拡散手段より補正値が加算された画像データに係る整数部の下位ビットを次の入力画像に加算し、誤差拡散手段からの補正値の小数部を入力画像データの下位ビット側に結合した後、上記入力画像データを補正するように構成したため、演算誤差の影響を排除することができる。
【0026】
また、前記算出手段は、算出された量子化誤差を所定範囲に制限して前記バッファへと出力する数値制限手段を備えていてもよい。これにより、バッファメモリのサイズをより削減できよう。
【0027】
さらに、前記量子化誤差を算出する際に利用される量子化代表値の最大値を、入力される画像データの最大値以上に設定するようにしてもよい。このようにすれば、量子化誤差が補正されずに累積し、処理が破綻することを防止できる。
【0028】
さらに、前記量子化誤差を算出する際に利用される量子化代表値のステップ幅を2のべき乗の一定値にしてもよい。例えば、後述する第2実施形態で説明するように、量子化代表値をすべて16の倍数となるようにすれば、逆量子化器の出力は3ビットで済むため、算出手段の構成を簡易にできる。
【0029】
さらに、入力画像の下限レベル値を有する画素を検出する第1の検出手段と、前記入力画像の下限レベル値を有する画素が検出されると、当該画素に関する出力コードとして、量子化代表値が最小となるような出力コードを出力する第1のコード出力手段とを備えてもよい。
【0030】
さらに、入力画像の上限レベル値を有する画素を検出する第2の検出手段と、前記入力画像の上限レベル値を有する画素が検出されると、当該画素に関する出力コードとして、量子化代表値が最大となるような出力コードを出力する第2のコード出力手段とを備えてもよい。
【0031】
さらに、前記下限レベル値又は上限レベル値を有する画素が検出されると、当該画素に関する量子化誤差を0に置換する置換手段を備えてもよい。
【0032】
このようにすれば、不要な誤差の伝播を抑制できるため、その結果、エッジの追従性が改善され、さらには、細線の欠落やハイライト部の汚れを防止できよう。
【0033】
なお、本発明のさらに他の観点によれば、上述の画像処理装置に対応する画像処理方法及び画像処理プログラムも提供される。
【0034】
【発明の実施の形態】
以下に本願発明の一実施形態を示す。もちろん以下の実施形態は、本願発明の技術分野における当業者による実施を容易にするために開示を提供するものであり、特許請求の範囲によって確定される本願発明の技術的範囲に含まれるほんの一部の実施形態にすぎない。従って、本願明細書に直接的に記載されていない実施形態であっても、技術思想が共通する限り本願発明の技術的範囲に包含されることは当業者にとって自明であろう。
【0035】
なお、便宜上複数の実施形態を記載するが、これらは個別に発明として成立するだけでなく、もちろん、複数の実施形態を適宜組み合わせることでも発明が成立することは、当業者であれば容易に理解できよう。
【0036】
[第1実施形態]
以下、図面を参照して本発明の実施形態を詳細に説明する。図1は本発明の第1の実施形態に係わる画像処理装置の構成を説明するブロック図である。
【0037】
図1において1はビット結合回路であり、ラッチ3からの小数の累積値を入力画像データの下位に結合する。2は加算器であり、拡散フィルタ9からの補正値を入力画像データに加算する。3はラッチであり、加算器2の小数部を1画素分遅延させる。4は量子化器であり、加算器2の整数部を閾値と比較し、出力コードに変換する。5は逆量子化器であり、出力コードより量子化代表値を生成する。6は減算器であり、量子化直前の値より量子化代表値を減算することで量子化誤差を生成する。7はリミッタであり、減算器6からの量子化誤差を所定範囲(存在範囲)にリミットする。8はラインバッファであり、リミッタ7からの量子化誤差を約1ライン分遅延する。9は拡散フィルタであり、ラインバッファ8からの前ラインの拡散対象画素及び現画素の量子化誤差に対応する係数を乗して総和を加算器2にて次の入力画像データに加算する。
【0038】
次に、処理の流れを説明する。以下では5値の誤差拡散に本発明を適用した場合の具体的な数値を記載する。本実施形態では、上記ラインバッファ8の容量を削減するため、誤差拡散後の値(拡散フィルタからの出力値)をラインバッファに格納するのではなく、量子化誤差そのものをラインバッファに格納するようにしている。誤差拡散後の値(例:10ビット)に比して量子化誤差の値(例:6ビット)はサイズが小さいため、バッファの容量を節約できる効果がある。
【0039】
図2に拡散フィルタ9の演算に用いる拡散係数の例を示す。図2に示した如く、周囲の量子化誤差より次の画素の補正値を求める方法(平均誤差最小法)では、誤差拡散法の拡散係数と位置が点対称の関係になる。
【0040】
図1には、入力画像データを8ビットとし、図2の拡散係数を用いて5値の誤差拡散を行った場合の各信号線のビット数を示してある。図2の拡散係数の分母は16であるので、拡散フィルタ9からの補正値と、ビット結合回路1からの出力画像データとの和は、小数部に4ビット、整数部(−31〜286)に10ビットの合計14ビットになる。加算器2からの出力された補正後の画像データの小数部は、ラッチ4にて1画素遅延され、次の画素とともに加算器2に入力される。従って、拡散係数による小数部は切り捨てられることなく次画素以降に伝播されるため、量子化誤差が補正される(量子化誤差の全てが伝播される)。
【0041】
一方、補正後の画像データの整数部は量子化器4にて所定の閾値と比較され、5値のコードに変換される。ここで入力画像データをxとすれば、出力コードc、量子化代表値rは次式のようになる。
【0042】
x<32の時c=0、r=0
32≦x<96の時c=1、r=64
96≦x<160の時c=2、r=128
160≦x<224の時c=3、r=192
224≦xの時c=4、r=255。
【0043】
従って、量子化器の閾値を各量子化代表値の中央に設定した場合、量子化誤差は−31〜31の範囲となる。一方、入力画像データには周囲の画素の量子化誤差による補正値が加算されているため、加算器6の出力は−31〜31の範囲を超えるが、−31〜31の範囲外となるのは、補正後の画像データが入力画像データの存在範囲を超えた場合である。よって、算出された量子化誤差をリミッタ7により所定範囲内に数値制限しても問題はない。
【0044】
リミッタ7により量子化誤差をリミットしたので、ラインバッファ8には−31〜31の範囲の量子化誤差を格納すれば足りる。よって、ラインバッファ8のビット数は6であればよい。これは、拡散フィルタ8の出力が10ビットであることから、4ビットもサイズを節約できたことになる。
【0045】
拡散フィルタ8は、現画素及びラインバッファ8より読み出される1ライン前の量子化誤差に図2の拡散係数をかけて補正値を求め、加算器2へと出力する。
【0046】
以上の処理により、1入力画像データに対する5値化処理が終了する。すべての画素について処理が終了していなければ、処理が終了するまで、以上の処理を1ピクセルずらして繰り返すことになる。この繰り返し処理により、画像全体に対する5値化処理が完了する。
【0047】
なお、ラッチ3は通常のラスタスキャンの場合は、ラインの先頭で0にクリアされる。即ち、前ラインの最終画素と現ラインの先頭画素とは、いずれも物理的には隣接してはいない画素であり、画像データの相関性が低い画素同士ではあるが、処理上は隣接した2つの画素となるため、不要な誤差の伝播を抑制すべく、ラインの先頭で0にクリアするのである。一方、1ライン毎に走査方向を反転させるスキャン方式の場合は、走査反転時(前ラインから現ラインへと移行する時)においても2つの画素は物理的にも処理上も連続することになるので、ラインの先頭で誤差を0にクリアする必要はなく、むしろ誤差を伝播させた方が画質上、好ましい。そのため、走査方向を反転させる場合には、ライン先頭の0クリアを禁止し、画像の先頭または走査方向が反転しない場合のラインの先頭でのみ0クリアするように制御するのが良い。
【0048】
この様に本発明の第1の実施形態によれば、量子化誤差を所定範囲にリミットしてバッファに格納するため、バッファの容量を削減できる。また、誤差拡散演算時の小数部を次の画像データの下位にビット結合させることにより、誤差拡散演算の丸め誤差を補正することができ、その結果、画質の向上、特に量子化誤差の小さなハイライト部の画質を向上させることが可能となる。また、バッファの削減効果は誤差拡散後のレベル数が大きいほど、効果も大きくなるであろう。
【0049】
[第2実施形態]
図3は本発明の第2の実施形態に係わる画像処理装置の構成を説明するブロック図である。図中、11,12は加算器、13はラッチ、14は量子化器、15は逆量子化器、16は減算器、17はリミッタ、18ラインバッファ、19は拡散フィルタである。以下、第1の実施形態と異なる部分のみ説明する。
【0050】
本実施形態ではラッチ13のビット数をmビット拡張し、小数部のみならず、誤差補正後の整数部の下位mビットも累積加算することにより、ラインバッファ18の容量を削減したものである。
【0051】
従って、ラッチ13の出力のうち小数部は前記第1の実施形態と同様に入力画像データの下位に結合されるが、mビットの整数部は加算器11にて入力画像に加算される。このため、ビット結合後の出力は13ビットになる。また、分離された整数部10−mビットは、量子化器14にて出力コードに変換され、逆量子化器15にて量子化代表値となり、減算器16にて量子化誤差が生成される。この量子化誤差はリミッタ17にて前記第1の実施形態と同様に有意の値に制限され、ラインバッファ18にて約1ライン分遅延される。拡散フィルタ19には、現画素の量子化誤差及び隣接する前ラインの量子化誤差が入力され、各々に対応する拡散係数が積和され、次の画素の補正値が算出される。算出された補正値は、加算器12にて次の画素へと加算される。
【0052】
ここで、説明の都合上、m=2とすると、ラッチ13は6ビットとなり、加算器11の出力範囲は0〜258となる。一方、量子化器14の入力xは8ビット(−7〜72となり、出力コードc、量子化代表値rは(実際の重みは2ビット左シフト、すなわち4倍の値になる)次のようにして求められる。
【0053】
x<8の時c=0、r=0
8≦x<24の時c=1、r=16
24≦x<40の時c=2、r=32
40≦x<56の時c=3、r=48
56≦xの時c=4、r=64。
【0054】
ここで、56≦xの時、r=64としているのは次の理由による。すなわち、r=63としたのでは、実際の入力値換算(2ビット左シフト)で、63×4=252となり、入力画像レンジに満たないことになり、その結果、255の入力データが連続した場合、255−252=3の量子化誤差が補正されずに累積し、加算器12の出力レンジを越えて処理が破綻してしまうおそれがある。そこで、このような処理の破綻を抑制するため、量子化代表値の最大値を入力画像データの最大値以上の値に設定することが必要になるのである。
【0055】
なお、この操作により、黒ベタ部の濃度が若干(1/256レベル)低下するが、黒ベタ付近は元々濃度の変化が少ないので、影響は殆どない。よって、有意な量子化誤差の範囲は−8〜7となり、ラインバッファ20は、4ビットに削減される。
【0056】
なお、本実施形態では、量子化代表値を2のべき乗のステップ幅となるように、全て16の倍数している。その結果、逆量子化器15の出力は3ビットで良く、逆量子化器15、減算器16は簡略化されるのである。
【0057】
本実施形態では、入力画素データが量子化代表値に近い値の時の様に、量子化誤差が小さいところでは次画素への誤差配分が相対的に大きくなる。特に、量子化誤差が3以下の場合、次画素に誤差が100%配分される。これはハイライト部のように量子化誤差の小さな部分でのドットの生成を早める結果となり、「掃き寄せ」と呼ばれる濃度変化の大きな部分での誤差拡散時のドット生成の遅れを改善する効果がある。
【0058】
一方、入力データが量子化代表値より遠い場合は、量子化誤差が大きくなるので、誤差の配分比は従来と殆ど変わらずドットの分散性が保持される(ドットのつながりによるテクスチャは従来とあまり変わらない)。
【0059】
なお、入力データが量子化代表値付近であっても、誤差の累積によって隣の(入力データより遠い)量子化代表値が選択された場合は、量子化誤差が大きくなるので、誤差の配分比は従来と殆ど変わらない。従って、mがあまり大きくなければ、ドットの分散性は保持される(ドットのつながりによるテクスチャは従来とあまり変わらない)。
【0060】
なお、mが大きいために、ドットのつながりによるテクスチャが目立ってしまう場合は、拡散係数を変更することによって画質改善が可能である。即ち、直前の画素の量子化誤差が0の場合は図5に示すように直下の拡散係数を大きくするのである。これにより下に伝播される量子化誤差の割合を補償し、縦方向のドットの分散性が改善される。なお、拡散係数を変更する条件を直前画素の量子化誤差が0の場合に限定しているのは、量子化誤差が0の時の実質的な配分比率がとりわけ偏っているからである(量子化誤差が0の時以外の実質的な配分比率の変動は比較的少ない)。また、実質的な配分比率は入力データにも依存しているので、入力データのレベルに応じて拡散係数を変更するようにしても同様の効果が得られる。
【0061】
[第3実施形態]
図4は本発明の第3の実施形態に係わる画像処理装置の構成を説明するブロック図である。図中、20は白画素・黒画素検出器、21はラッチ、22はコード置換回路、23は量子化誤差置換回路である。以下、第2の実施形態と異なる部分のみ説明する。
【0062】
白画素・黒画素検出器20は、入力された画像データが、白画素(前記第2の実施形態では0)及び黒画素(前記第2の実施形態では255)を検出する。検出結果はラッチ21及び置換回路22、23に出力される。
【0063】
白画素・黒画素検出器20が白画素または黒画素を検出すると、ラッチ21は、ラッチをクリアし、次画素以降への誤差の伝播を阻止する。これにより、不要な誤差が伝播されることに伴う、ハイライト部の汚れや、細線の消失などの不適当な結果を抑制できる。
【0064】
コード置換回路22は、白画素が検出された場合は白画素を示すコード(前記第2の実施形態では0)を出力し、黒画素が検出された場合は黒画素を示すコード(前記第2の実施形態では4)を出力し、それ以外では入力されたコードを出力する。
【0065】
量子化誤差置換回路23は白画素及び黒画素が検出された場合は0を出力し、それ以外では前述の実施形態と同様に有意の値に制限された量子化誤差を出力する。
【0066】
ラッチ21のクリア処理、コード置換回路22及び量子化誤差置換回路23を少なくとも一つ設けるだけでも、効果は得られるが、これらのうち2つを組み合わせて採用してもよいし、3つすべてを採用してもよい。より多く採用すれば、より高い効果が期待できる。
【0067】
本実施形態では、入力画像データの上限及び下限の値を検出し、入力画像データの上限及び下限の値の時には量子化誤差を0とし、次画素以降に誤差の伝播を行わないようにしたものである。本構成により、上記第2の実施形態にて説明したような黒ベタ部の濃度の低下や拡散誤差による細線の消失、白画素部にドットが生成されるといった不具合を抑制できよう。
【0068】
また、本実施形態では、白画素及び黒画素を検出することとしたが、これは極端な例であることを当業者であれば理解できよう。本発明はこれに限定されることはない。例えば、白画素と黒画素の検出に代えて、所定のレベル以下の画素や所定のレベル以上の画素を検出し、上記の処理を実施しても良い。所定のレベルは、いわゆる閾値であり、この閾値は画像の劣化とのトレードオフで適宜定めることができる。例えば、ほぼ白画素とみなせるレベルの画素などは、この閾値により、実質的に白画素として使うことが可能であろう。(但し、閾値を大きくすると、白とび、黒つぶれ等の劣化が激しくなってしまうため、通常は入力画像データの最大値・最小値に設定するのが望ましい。)
【他の実施形態】
前述した実施形態の機能を実現するソフトウエアのプログラムコードを記録した記憶媒体を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによっても、本願発明の目的が達成されることは言うまでもない。
【0069】
この場合、記憶媒体から読み出されたプログラムコード自体が本願発明の新規な機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本願発明を構成することになる。
【0070】
プログラムコードを供給するための記憶媒体としては、例えば、フレキシブルディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM,CD−R、磁気テープ、不揮発性のメモリカード、ROMなどを用いることができる。
【0071】
また、コンピュータが読み出したプログラムコードを実行することによって、前述した実施形態の機能が実現される他、そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOSなどが実際の処理の一部または全部を行ない、その処理によっても前述した実施形態の機能が実現され得る。
【0072】
さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行ない、その処理によっても前述した実施形態の機能が実現され得る。
【0073】
なお、本願発明は、前述した実施形態の機能を実現するソフトウエアのプログラムコードを記録した記憶媒体から、そのプログラムを、パソコン通信など通信ラインを介して要求者にそのプログラムを配信する場合にも適用できることは言うまでもない。
【0074】
【発明の効果】
以上、説明したように第1の観点によれば、量子化誤差をバッファメモリに格納するよううに画像処理装置を構成したので、量子化誤差分のビット数だけをバッファメモリは備えればよく、従来よりもバッファメモリのサイズを削減できる。また、誤差拡散演算後の小数部を入力画像データの下位ビット側に結合した後、上記入力画像データを補正することにより、演算誤差の影響を低減できる。特に画像のハイライト部分の高画質化が期待できる。
【0075】
また、第2の観点によれば、量子化誤差の上位ビットのみをバッファメモリに格納するように画像処理装置を構成したので、第1の観点よりもバッファメモリのサイズを小さくすることができる。また、誤差拡散フィルタから出力される補正値を加算してなる画像データの所定ビット以下を累積的に加算する構成を採用すれば、演算誤差の影響を低減することが可能となろう。
【0076】
また、第3の観点によれば、注目画素が、白画素(入力画像レンジの下限)及び黒画素(入力画像レンジの上限)の場合には、不要な誤差の伝播を抑制するため、エッジの追従性を改善し、細線の欠落及びハイライトの汚れを防止することができる。
【図面の簡単な説明】
【図1】図1は、第1の実施形態に係る例示的な画像処理装置の構成を示すブロック図である。
【図2】図2は、拡散フィルタ9の演算に用いる例示的な量子化誤差の位置と拡散係数を示す図である。
【図3】図3は、第2の実施形態に係る例示的な画像処理装置の構成を示すブロック図である。
【図4】図4は、第3の実施形態に係る例示的な画像処理装置の構成を示すブロック図である。
【図5】図5は、直前画素の量子化誤差が0の時の拡散フィルタ19の演算に用いる例示的な量子化誤差の位置と拡散係数を示す図である。
【符号の説明】
1…ビット結合回路
2…加算器
3…ラッチ
4…量子化器
5…逆量子化器
6…減算器
7…リミッタ
8…ラインバッファ
9…拡散フィルタ
11…加算器
12…加算器
13…ラッチ
14…量子化器
15…逆量子化器
16…減算器
17…リミッタ
18…ラインバッファ
19…拡散フィルタ
20…白画素・黒画素検出器
21…ラッチ
22…コード置換回路
23…量子化誤差置換回路
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing method and apparatus, and more particularly to an image processing method for quantizing input data into binary or multi-valued data while storing a difference between an input image density and an output image density by an error diffusion method or the like. And a device.
[0002]
[Prior art]
Conventionally, pseudo halftone processing is used to represent input multi-valued data as multi-valued data having a level lower than that of binary or input multi-valued data. As one example, an error diffusion method is known. This error diffusion method is described in "An Adaptive Algorithm for Spatial Gray Scale" in society for Information Display 1975 Symposium Digest of Technical, Technical Paper, 36, 1973. In this method, the pixel of interest is P, the density of the pixel is v, and the densities of the pixels P0, P1, P2, and P3 around the P before binarization processing are v0, v1, v2, and v3, respectively. Using a threshold value T for binarization as T, weighting the binarization error E at the point of interest P using weighting coefficients W0, W1, W2, and W3 empirically obtained, and surrounding pixels P0, P1, P2, It is allocated to each of P3. That is, this method is a method of making the average density of the output image macroscopically equal to the density of the input image. At this time, assuming that the output binary data is o, errors E0, E1, E2, and E3 with respect to the peripheral pixels P0, P1, P2, and P3 can be obtained by the following equations.
[0003]
If v ≧ T, o = 1, E = v−Vmax
If v <T, o = 0, E = v-Vmin
(However, Vmax: maximum density, Vmin: minimum density)
E0 = E × W0;
E1 = E × W1;
E2 = E × W2;
E3 = E × W3;
(Example of weight coefficient: W0 = 7/16, W1 = 1/16, W2 = 5/16, W3 = 3/16)
Incidentally, an error buffer is required to propagate this error. As can be seen from the above example, the weight coefficient is a decimal number of 1 or less.
[0004]
Therefore, assuming that the number of bits of the input image is 8 and the threshold value for binarization is fixed at 128 in the above example of the weighting coefficient, the quantization error is -127 to 127. There was a disadvantage that a bit was required.
[0005]
As a method for solving this, in Patent Literature 1 and Patent Literature 2, the sum of the error distribution values obtained by rounding down the decimal part of the result of multiplying the binarization error by the weighting coefficient is calculated, and the sum of the error distribution values is calculated. A method of calculating a residual error from a difference and redistributing it to peripheral pixels is disclosed.
[0006]
Further, in Patent Document 3, the lower n bits are extracted from the binarization error, and the binarization error obtained by complementing the lower n bits with 0 is multiplied by a weight coefficient to obtain an error distribution value. Is added to one of the above error distribution values and distributed to peripheral pixels.
[0007]
Patent Document 4 discloses a method in which the upper bits of the binarization error are stored in a buffer memory, and the lower bits of the binarization error are latched and added to the next pixel.
[0008]
[Patent Document 1]
Japanese Patent Publication No. 06-0666676
[Patent Document 2]
Japanese Patent Publication No. 07-022334
[Patent Document 3]
Japanese Patent Publication No. 07-093682
[Patent Document 4]
Japanese Patent Application Laid-Open No. 05-075863.
[0009]
[Problems to be solved by the invention]
However, the method disclosed in Patent Document 1 or Patent Document 2 has a drawback that a sum of error distribution values must be obtained and a residual error must be calculated from a difference from the binarization error.
[0010]
Further, in the method disclosed in Patent Document 3, the above-mentioned residual error does not have to be calculated, but the bit rate of the binarization error used in the calculation of the error distribution is reduced, and therefore, the distribution ratio is set to the magnitude of the binarization error. There is a disadvantage that it changes depending on. For example, in the case of the above-mentioned weighting coefficient, the lower 4 bits of the binarization error are multiplied by 0 to make the residual error 0, but when the binarization error is 15 or less, all become 0. Therefore, all binarization errors are distributed to a specific pixel.
[0011]
Further, in the method disclosed in Patent Document 4, since the upper bits of the binarization error are stored in the buffer memory, the buffer memory can be greatly reduced. Since the bit precision of the binarization error used for the calculation is reduced, there is a disadvantage that the distribution ratio changes depending on the magnitude of the binarization error. For example, in the case of the above-mentioned weight coefficient, in order to make the residual error zero, the upper four bits of the binarization error must be stored in the buffer memory, and the lower four bits must be stored in the latch. In the case of 15 or less, all become zero, so that all binarization errors are distributed to the next pixel. Further, in order to increase the accuracy of the error distribution, when the upper 5 bits or more of the binarization error is stored in the buffer memory, an error due to rounding (truncating) occurs. Further, Patent Document 4 describes that “the lower bits are stored in the latch circuit 4 after the sign is extended,” but the sign of the lower bits is extended when the binary error is negative. In this case, 1 must be added to the upper bit.
[0012]
For example, -1 is 11111111 in an 8-bit binary, but is divided into 1111 and 1111 when it is divided into upper and lower 4 bits. If the lower bit is negative-sign-extended, it becomes 11111 and represents -1. However, since the upper bit 1111 has a meaning of 11110000, it means -16. Therefore, the result of adding the upper and lower bits is -17. Therefore, in order to avoid a mismatch, it is necessary to add 1 to the upper bit 1111 to obtain 0000 (carry is not considered). Further, since the lower bits of the binarization error are added to the input pixel data, there is a disadvantage that the range of the binarization error is expanded and the number of bits is increased by one bit. For example, when latching the lower 4 bits of the binarization error, the normal binarization error has a range of -127 to 127 and can be represented by 8 bits, but the method disclosed in Japanese Patent Application Laid-Open No. 05-075863 is disclosed. In this case, the lower 4 bits of the binarization error (a range from -15 to 15 because of sign extension) are added to the input pixel data, so the range of the binarization error is -142 to 142, and 9 bits are required. Become.
[0013]
An object of the present invention is to solve the above-described problems, and an object of the present invention is to provide an image processing method and apparatus capable of reducing the capacity of a buffer memory while compensating for the influence of a calculation error at the time of error diffusion.
[0014]
[Means for Solving the Problems]
According to one aspect of the present invention, quantization means for quantizing input image data, calculation means for calculating a quantization error generated by a quantization process of the quantization means, An error for diffusing the quantization error based on at least the buffer to be stored, the quantization error of the first pixel stored in the buffer, and the quantization error of the second pixel calculated by the calculation unit. An image processing apparatus includes: a diffusion unit; and a reduction unit configured to reduce an influence of a calculation error by the error diffusion unit on subsequent input image data.
[0015]
As described above, according to the present invention, since the quantization error is stored in the buffer memory, the buffer memory only needs to have at least the number of bits corresponding to the quantization error, and the capacity is reduced as compared with the related art. It becomes possible. Further, by providing the reduction means, it is possible to eliminate the influence of the calculation error, and particularly to improve the image quality of the highlighted portion of the image.
[0016]
For example, the reduction unit may include a coupling unit that couples a decimal part of the correction value generated to diffuse the quantization error by the error diffusion unit to a lower bit side of the next input image data. That is, after the decimal part after the error diffusion operation is connected to the lower bit side of the input image data, the input image data is corrected, so that the output image can have high image quality.
[0017]
Further, if it is inappropriate to propagate the correction value to the next pixel and subsequent pixels, the image processing apparatus may further include a blocking unit that blocks the propagation of the correction value. Inappropriate cases include, for example, when the target pixel is the first pixel of the line, when the target pixel has a value of the lower limit level of the input image (eg, white pixel), or when the target pixel is the value of the upper limit level of the input image. (Eg, a black pixel). Of course, it goes without saying that the present invention can be applied to inappropriate cases other than the examples. Here, the lower limit level and the upper limit level may be not only one value but also a plurality of values existing within a predetermined range.
[0018]
Further, a holding means for holding a decimal part of the correction value, and when it is inappropriate to combine the decimal part of the correction value held in the holding means to the lower bit side of the next input image data, Clearing means for clearing the decimal part held by the holding means.
[0019]
Further, when the scanning direction of the input image is reversed, the image processing apparatus may further include a processing restricting unit that restricts the clearing process of the clearing unit.
[0020]
For example, if the scanning direction is reversed for each line, it is possible to limit the clearing process so that it is cleared to 0 only at the beginning of the image. Therefore, even when the scanning direction is reversed, an effect of high image quality can be expected.
[0021]
The image processing apparatus may further include a numerical value limiting unit that limits the quantization error calculated by the calculating unit to a numerical value within a predetermined range. As a result, the size of the buffer memory for storing the quantization error can be saved.
[0022]
According to another aspect of the present invention, a bit extension unit for bit-extending the image data of the pixel of interest, a correction unit for correcting the bit-extended image data, and quantizing an integer part of the corrected image data Quantization means, holding means for holding a quantization error generated by the quantization means, a first quantization error held by the holding means, and a second quantization error for the pixel of interest. Based on at least a correction value generation unit that generates a correction value used by the correction unit, and in the bit expansion process of the bit expansion unit, the correction value combined with the lower bit side of the next image data. An image processing apparatus comprising: a storage unit for storing a small number of parts.
[0023]
As described above, according to the present invention, since the quantization error is stored in the buffer memory, the buffer memory only needs to have at least the number of bits corresponding to the quantization error, and the capacity is reduced as compared with the related art. It becomes possible. Furthermore, after combining the decimal part after the error diffusion operation to the lower bit side of the input image data, the input image data is corrected, so that the quality of the output image can be improved.
[0024]
According to still another aspect of the present invention, a quantization unit for quantizing upper bits of input image data, and a calculation unit for calculating a quantization error generated by a quantization process of the quantization unit,
A buffer for storing the calculated quantization error, a quantization error of a first pixel stored in the buffer, and a quantization error of a second pixel calculated by the calculation unit. Error diffusion means for error-diffusing image data of a third pixel, holding means for holding a value of a predetermined bit or less of the error-diffused image data, and an integer part of the held value. Adding means for adding the fractional part of the held value to the lower-order bit side of the image data to which the integer part has been added, and outputting the result to the quantizing means. An image processing apparatus comprising:
[0025]
In this way, by storing the upper bits of the quantization error in the buffer memory, the capacity of the buffer memory can be reduced. Further, the lower bits of the integer part of the image data to which the correction value has been added by the error diffusion means are added to the next input image, and the decimal part of the correction value from the error diffusion means is connected to the lower bit side of the input image data. Then, since the input image data is configured to be corrected, the influence of the calculation error can be eliminated.
[0026]
Further, the calculation means may include a numerical limit means for limiting the calculated quantization error to a predetermined range and outputting the result to the buffer. Thus, the size of the buffer memory can be further reduced.
[0027]
Further, the maximum value of the representative quantization value used in calculating the quantization error may be set to be equal to or larger than the maximum value of the input image data. In this way, it is possible to prevent the quantization errors from accumulating without correction and causing the processing to fail.
[0028]
Further, the step width of the quantization representative value used in calculating the quantization error may be a constant value of a power of two. For example, as will be described in a second embodiment described later, if all the quantized representative values are multiples of 16, the output of the inverse quantizer can be 3 bits, so that the configuration of the calculating means can be simplified. it can.
[0029]
Further, first detecting means for detecting a pixel having a lower limit level value of the input image, and detecting a pixel having a lower limit level value of the input image as an output code relating to the pixel, the quantized representative value having a minimum value. And a first code output unit that outputs an output code such as:
[0030]
Further, a second detecting means for detecting a pixel having the upper limit level value of the input image, and detecting a pixel having the upper limit level value of the input image, the output representative code of the pixel has a maximum quantization representative value. And second code output means for outputting an output code such that
[0031]
Further, when a pixel having the lower limit level value or the upper limit level value is detected, a replacement unit that replaces a quantization error relating to the pixel with 0 may be provided.
[0032]
By doing so, the propagation of unnecessary errors can be suppressed, and as a result, the followability of edges can be improved, and furthermore, the loss of fine lines and the contamination of highlight portions can be prevented.
[0033]
According to still another aspect of the present invention, there is also provided an image processing method and an image processing program corresponding to the above-described image processing apparatus.
[0034]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of the present invention will be described below. Of course, the following embodiments are provided for the purpose of facilitating implementation by those skilled in the art of the present invention, and only a part of the scope of the present invention defined by the claims is set forth. It is only an embodiment of the section. Therefore, it will be obvious to those skilled in the art that even embodiments not directly described in the present specification are included in the technical scope of the present invention as long as the technical ideas are common.
[0035]
Although a plurality of embodiments will be described for the sake of convenience, those skilled in the art can easily understand that these inventions can be realized not only individually as inventions but also by appropriately combining a plurality of embodiments. I can do it.
[0036]
[First Embodiment]
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a block diagram illustrating the configuration of the image processing apparatus according to the first embodiment of the present invention.
[0037]
In FIG. 1, reference numeral 1 denotes a bit coupling circuit which couples the decimal accumulated value from the latch 3 to the lower order of the input image data. An adder 2 adds the correction value from the diffusion filter 9 to the input image data. A latch 3 delays the decimal part of the adder 2 by one pixel. Numeral 4 denotes a quantizer which compares the integer part of the adder 2 with a threshold and converts it into an output code. Reference numeral 5 denotes an inverse quantizer, which generates a quantized representative value from an output code. Reference numeral 6 denotes a subtractor, which generates a quantization error by subtracting a quantization representative value from a value immediately before quantization. A limiter 7 limits a quantization error from the subtractor 6 to a predetermined range (existing range). A line buffer 8 delays the quantization error from the limiter 7 by about one line. Reference numeral 9 denotes a diffusion filter, which multiplies a coefficient corresponding to a quantization error of a current pixel and a diffusion target pixel of the previous line from the line buffer 8 and adds the sum to the next input image data by the adder 2.
[0038]
Next, a processing flow will be described. Hereinafter, specific numerical values when the present invention is applied to five-value error diffusion will be described. In the present embodiment, in order to reduce the capacity of the line buffer 8, instead of storing the value after error diffusion (output value from the diffusion filter) in the line buffer, the quantization error itself is stored in the line buffer. I have to. Since the value of the quantization error (eg, 6 bits) is smaller than the value after error diffusion (eg, 10 bits), the buffer capacity can be saved.
[0039]
FIG. 2 shows an example of the diffusion coefficient used for the operation of the diffusion filter 9. As shown in FIG. 2, in the method of obtaining the correction value of the next pixel from the surrounding quantization error (minimum average error method), the diffusion coefficient and the position of the error diffusion method have a point-symmetric relationship.
[0040]
FIG. 1 shows the number of bits of each signal line when the input image data is 8 bits and quinary error diffusion is performed using the diffusion coefficient of FIG. Since the denominator of the diffusion coefficient in FIG. 2 is 16, the sum of the correction value from the diffusion filter 9 and the output image data from the bit combination circuit 1 is 4 bits for the decimal part and an integer part (-31 to 286). To a total of 14 bits. The fractional part of the corrected image data output from the adder 2 is delayed by one pixel in the latch 4 and input to the adder 2 together with the next pixel. Therefore, the decimal part due to the diffusion coefficient is propagated to the next pixel and beyond without being truncated, so that the quantization error is corrected (all of the quantization error is propagated).
[0041]
On the other hand, the integer part of the corrected image data is compared with a predetermined threshold by the quantizer 4 and converted into a quinary code. Here, assuming that the input image data is x, the output code c and the representative quantization value r are as follows.
[0042]
When x <32, c = 0, r = 0
C = 1, r = 64 when 32 ≦ x <96
When 96 ≦ x <160, c = 2, r = 128
When 160 ≦ x <224, c = 3, r = 192
When 224 ≦ x, c = 4, r = 255.
[0043]
Therefore, when the threshold value of the quantizer is set at the center of each of the representative quantization values, the quantization error is in the range of −31 to 31. On the other hand, since the correction value due to the quantization error of the surrounding pixels is added to the input image data, the output of the adder 6 exceeds the range of −31 to 31, but out of the range of −31 to 31. The case where the corrected image data exceeds the existing range of the input image data. Therefore, there is no problem even if the calculated quantization error is numerically limited to a predetermined range by the limiter 7.
[0044]
Since the quantization error is limited by the limiter 7, it is sufficient that the line buffer 8 stores a quantization error in the range of -311 to 31. Therefore, the number of bits of the line buffer 8 may be six. This means that since the output of the diffusion filter 8 is 10 bits, the size can be saved by 4 bits.
[0045]
The diffusion filter 8 multiplies the current pixel and the quantization error read out from the line buffer 8 one line before by the diffusion coefficient in FIG. 2 to obtain a correction value, and outputs the correction value to the adder 2.
[0046]
With the above processing, the quinary processing for one input image data is completed. If the processing has not been completed for all the pixels, the above processing is repeated by shifting one pixel until the processing is completed. By this repetition processing, the quinary processing for the entire image is completed.
[0047]
Incidentally, the latch 3 is cleared to 0 at the head of the line in the case of a normal raster scan. That is, the last pixel of the previous line and the first pixel of the current line are pixels that are not physically adjacent to each other, and are pixels having low correlation of image data, but are adjacent to each other in processing. Since the number of pixels is one, it is cleared to 0 at the head of the line in order to suppress the propagation of unnecessary errors. On the other hand, in the case of the scanning method in which the scanning direction is inverted for each line, the two pixels are physically and continuously continuous even at the time of scanning inversion (when shifting from the previous line to the current line). Therefore, it is not necessary to clear the error to 0 at the head of the line, and it is preferable to propagate the error from the viewpoint of image quality. Therefore, when inverting the scanning direction, it is preferable to prohibit the clearing of 0 at the head of the line, and to perform the clearing only at the head of the image or at the head of the line when the scanning direction is not inverted.
[0048]
As described above, according to the first embodiment of the present invention, since the quantization error is stored in the buffer while being limited to the predetermined range, the capacity of the buffer can be reduced. In addition, the rounding error of the error diffusion operation can be corrected by bit-combining the decimal part at the time of the error diffusion operation to the lower order of the next image data, and as a result, the image quality is improved, and in particular, the highlighting with a small quantization error is performed. It is possible to improve the image quality of the section. Also, the effect of buffer reduction will increase as the number of levels after error diffusion increases.
[0049]
[Second embodiment]
FIG. 3 is a block diagram illustrating a configuration of an image processing apparatus according to the second embodiment of the present invention. In the figure, 11 and 12 are adders, 13 is a latch, 14 is a quantizer, 15 is an inverse quantizer, 16 is a subtractor, 17 is a limiter, 18 line buffers, and 19 is a diffusion filter. Hereinafter, only portions different from the first embodiment will be described.
[0050]
In the present embodiment, the capacity of the line buffer 18 is reduced by extending the number of bits of the latch 13 by m bits and accumulating not only the decimal part but also the lower m bits of the integer part after error correction.
[0051]
Accordingly, the decimal part of the output of the latch 13 is coupled to the lower part of the input image data as in the first embodiment, but the m-bit integer part is added to the input image by the adder 11. Therefore, the output after the bit combination is 13 bits. The 10-m bits of the separated integer part are converted into an output code by the quantizer 14, become a representative quantization value by the inverse quantizer 15, and a quantization error is generated by the subtracter 16. . This quantization error is limited to a significant value by the limiter 17 as in the first embodiment, and is delayed by about one line in the line buffer 18. The quantization error of the current pixel and the quantization error of the adjacent previous line are input to the diffusion filter 19, and the diffusion coefficients corresponding to each are multiplied and summed, and the correction value of the next pixel is calculated. The calculated correction value is added by the adder 12 to the next pixel.
[0052]
Here, for convenience of explanation, if m = 2, the latch 13 has 6 bits, and the output range of the adder 11 is 0 to 258. On the other hand, the input x of the quantizer 14 is 8 bits (−7 to 72), and the output code c and the quantized representative value r (the actual weight is shifted left by 2 bits, that is, quadrupled) as follows: Is required.
[0053]
When x <8, c = 0, r = 0
C = 1, r = 16 when 8 ≦ x <24
When 24 ≦ x <40, c = 2, r = 32
When 40 ≦ x <56, c = 3, r = 48
When 56 ≦ x, c = 4 and r = 64.
[0054]
Here, the reason for r = 64 when 56 ≦ x is as follows. That is, when r = 63, 63 × 4 = 252 in actual input value conversion (2-bit left shift), which is less than the input image range, and as a result, 255 input data are continuous. In this case, the quantization errors of 255-252 = 3 may be accumulated without correction, and may exceed the output range of the adder 12 and break down. Therefore, in order to suppress such a failure of the processing, it is necessary to set the maximum value of the quantization representative value to a value equal to or larger than the maximum value of the input image data.
[0055]
Although this operation slightly lowers the density of the solid black portion (1/256 level), there is almost no effect on the vicinity of the solid black because the density originally changes little. Therefore, the range of the significant quantization error is -8 to 7, and the line buffer 20 is reduced to 4 bits.
[0056]
In the present embodiment, the quantization representative values are all multiples of 16 so as to have a step width of a power of two. As a result, the output of the inverse quantizer 15 may be 3 bits, and the inverse quantizer 15 and the subtractor 16 are simplified.
[0057]
In the present embodiment, where the quantization error is small, such as when the input pixel data is close to the quantization representative value, the error distribution to the next pixel is relatively large. In particular, when the quantization error is 3 or less, 100% of the error is distributed to the next pixel. This hastens the generation of dots in parts with a small quantization error, such as highlights, and has the effect of improving the delay in dot generation during error diffusion in parts with large changes in density, called `` sweeping ''. is there.
[0058]
On the other hand, when the input data is farther than the representative quantization value, the quantization error becomes large, and the distribution ratio of the error is almost the same as in the conventional case, and the dispersibility of the dots is maintained. does not change).
[0059]
Even if the input data is near the quantization representative value, if the next quantization representative value (farther than the input data) is selected by accumulating the error, the quantization error becomes large. Is almost the same as before. Therefore, if m is not too large, the dispersibility of the dots is maintained (the texture due to the connection of the dots is not much different from the conventional one).
[0060]
When the texture due to the connection of dots becomes conspicuous because m is large, the image quality can be improved by changing the diffusion coefficient. That is, when the quantization error of the immediately preceding pixel is 0, the diffusion coefficient immediately below is increased as shown in FIG. This compensates for the proportion of quantization error propagated downward, and improves the dispersibility of the dots in the vertical direction. Note that the condition for changing the diffusion coefficient is limited to the case where the quantization error of the immediately preceding pixel is 0, because the substantial distribution ratio when the quantization error is 0 is particularly biased (quantum The variation of the substantial distribution ratio is relatively small except when the conversion error is 0). Further, since the substantial distribution ratio also depends on the input data, a similar effect can be obtained by changing the diffusion coefficient according to the level of the input data.
[0061]
[Third embodiment]
FIG. 4 is a block diagram illustrating a configuration of an image processing apparatus according to the third embodiment of the present invention. In the figure, 20 is a white pixel / black pixel detector, 21 is a latch, 22 is a code replacement circuit, and 23 is a quantization error replacement circuit. Hereinafter, only portions different from the second embodiment will be described.
[0062]
The white pixel / black pixel detector 20 detects white pixels (0 in the second embodiment) and black pixels (255 in the second embodiment) in the input image data. The detection result is output to the latch 21 and the replacement circuits 22 and 23.
[0063]
When the white pixel / black pixel detector 20 detects a white pixel or a black pixel, the latch 21 clears the latch and prevents propagation of an error to the next pixel and subsequent pixels. As a result, it is possible to suppress inappropriate results such as contamination of a highlight portion and disappearance of a thin line due to propagation of an unnecessary error.
[0064]
The code replacement circuit 22 outputs a code indicating a white pixel (0 in the second embodiment) when a white pixel is detected, and outputs a code indicating a black pixel (the second code) when a black pixel is detected. In the embodiment, 4) is output, and otherwise, the input code is output.
[0065]
The quantization error replacement circuit 23 outputs 0 when a white pixel and a black pixel are detected, and otherwise outputs a quantization error limited to a significant value as in the above-described embodiment.
[0066]
Although the effect can be obtained by simply providing at least one of the clear processing of the latch 21 and the code replacement circuit 22 and the quantization error replacement circuit 23, two of these may be employed in combination or all three may be employed. May be adopted. A higher effect can be expected by adopting more.
[0067]
In the present embodiment, the values of the upper limit and the lower limit of the input image data are detected, and when the values of the upper limit and the lower limit of the input image data are set, the quantization error is set to 0, and the error is not propagated to the next pixel and subsequent pixels. It is. With this configuration, it is possible to suppress problems such as a decrease in density of a solid black portion, disappearance of a thin line due to a diffusion error, and generation of a dot in a white pixel portion as described in the second embodiment.
[0068]
In this embodiment, white pixels and black pixels are detected, but those skilled in the art can understand that this is an extreme example. The present invention is not limited to this. For example, instead of detecting a white pixel and a black pixel, a pixel below a predetermined level or a pixel above a predetermined level may be detected and the above processing may be performed. The predetermined level is a so-called threshold value, and the threshold value can be appropriately determined by a trade-off with image deterioration. For example, a pixel at a level that can be regarded as a substantially white pixel can be substantially used as a white pixel by this threshold value. (However, if the threshold is increased, deterioration such as overexposure and underexposure of black will become severe. Therefore, it is usually desirable to set the maximum value and the minimum value of the input image data.)
[Other embodiments]
A storage medium storing software program codes for realizing the functions of the above-described embodiments is supplied to a system or an apparatus, and a computer (or CPU or MPU) of the system or the apparatus executes the program code stored in the storage medium. It goes without saying that the object of the present invention is also achieved by executing the reading.
[0069]
In this case, the program code itself read from the storage medium realizes the novel function of the present invention, and the storage medium storing the program code constitutes the present invention.
[0070]
As a storage medium for supplying the program code, for example, a flexible disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a nonvolatile memory card, a ROM, and the like can be used.
[0071]
The functions of the above-described embodiments are implemented when the computer executes the readout program code, and the OS or the like running on the computer performs part of the actual processing based on the instructions of the program code. Alternatively, all the operations are performed, and the functions of the above-described embodiments can be realized by the processing.
[0072]
Further, after the program code read from the storage medium is written to a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. The CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments can also be realized by the processing.
[0073]
The invention of the present application is also applicable to a case where the program is delivered to a requester via a communication line such as a personal computer communication from a storage medium storing a program code of software for realizing the functions of the above-described embodiments. It goes without saying that it can be applied.
[0074]
【The invention's effect】
As described above, according to the first aspect, since the image processing apparatus is configured to store the quantization error in the buffer memory, the buffer memory need only have the number of bits corresponding to the quantization error. The size of the buffer memory can be reduced more than before. In addition, by combining the decimal part after the error diffusion calculation with the lower bit side of the input image data and correcting the input image data, the influence of the calculation error can be reduced. In particular, higher image quality can be expected in the highlight portion of the image.
[0075]
Further, according to the second aspect, the image processing apparatus is configured to store only the upper bits of the quantization error in the buffer memory, so that the size of the buffer memory can be made smaller than in the first aspect. In addition, if a configuration in which a predetermined bit or less of the image data obtained by adding the correction values output from the error diffusion filter is cumulatively added, the influence of the calculation error can be reduced.
[0076]
According to the third aspect, when the target pixel is a white pixel (lower limit of the input image range) and a black pixel (upper limit of the input image range), the propagation of unnecessary errors is suppressed. The followability can be improved, and the loss of fine lines and the stain of highlights can be prevented.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of an exemplary image processing apparatus according to a first embodiment;
FIG. 2 is a diagram showing an example of a position of a quantization error and a diffusion coefficient used for an operation of a diffusion filter 9;
FIG. 3 is a block diagram illustrating a configuration of an exemplary image processing apparatus according to a second embodiment;
FIG. 4 is a block diagram illustrating a configuration of an exemplary image processing apparatus according to a third embodiment;
FIG. 5 is a diagram illustrating an example of a position of a quantization error and a diffusion coefficient used for the operation of the diffusion filter 19 when the quantization error of the immediately preceding pixel is 0.
[Explanation of symbols]
1 ... bit coupling circuit
2 ... Adder
3 ... Latch
4: Quantizer
5 Inverse quantizer
6 ... Subtractor
7 ... Limiter
8 ... Line buffer
9 ... Diffusion filter
11 ... Adder
12 ... Adder
13 ... Latch
14 Quantizer
15 ... Inverse quantizer
16 ... Subtractor
17 ... Limiter
18 ... Line buffer
19 ... Diffusion filter
20 white / black pixel detector
21 ... Latch
22 Code replacement circuit
23 ... Quantization error replacement circuit

Claims (49)

入力画像データを量子化する量子化手段と、
前記量子化手段の量子化処理により発生した量子化誤差を算出する算出手段と、
前記算出された量子化誤差を格納するバッファと、
前記バッファに格納されている第1の画素の量子化誤差と、前記算出手段により算出された第2の画素の量子化誤差とに少なくとも基づいて、量子化誤差を拡散する誤差拡散手段と、
前記誤差拡散手段による演算誤差が次の入力画像データに与える影響を低減する低減手段と
を備える画像処理装置。
Quantization means for quantizing the input image data;
Calculation means for calculating a quantization error generated by the quantization processing of the quantization means,
A buffer for storing the calculated quantization error,
Error diffusion means for diffusing the quantization error based at least on the quantization error of the first pixel stored in the buffer and the quantization error of the second pixel calculated by the calculation means;
An image processing apparatus comprising: a reduction unit configured to reduce an influence of a calculation error by the error diffusion unit on next input image data.
前記低減手段は、前記誤差拡散手段により量子化誤差を拡散すべく生成された補正値の小数部を次の入力画像データの下位ビット側に結合する結合手段をさらに含む請求項1に記載の画像処理装置。2. The image according to claim 1, wherein the reducing unit further includes a combining unit that combines a decimal part of the correction value generated to diffuse the quantization error by the error diffusion unit to a lower bit side of the next input image data. Processing equipment. 前記補正値を次の画素以降に伝播させることが不適当な場合には、該補正値の伝播を阻止する阻止手段をさらに含むことを特徴とする請求項2に記載の画像処理装置。The image processing apparatus according to claim 2, further comprising a blocking unit that blocks propagation of the correction value when it is inappropriate to propagate the correction value to the next pixel and subsequent pixels. 前記補正値の小数部を保持する保持手段と、
前記保持手段に保持されている補正値の小数部を次の入力画像データの下位ビット側に結合することが不適当な場合に、前記保持手段に保持されている小数部をクリアするクリア手段と、
をさらに含む請求項2に記載の画像処理装置。
Holding means for holding a decimal part of the correction value,
When it is inappropriate to combine the decimal part of the correction value held by the holding means with the lower bit side of the next input image data, clear means for clearing the decimal part held by the holding means ,
The image processing apparatus according to claim 2, further comprising:
入力画像の走査方向が反転された場合には、前記クリア手段のクリア処理を制限する処理制限手段をさらに備えることを特徴とする請求項4に記載の画像処理装置。The image processing apparatus according to claim 4, further comprising a processing restriction unit that restricts a clear process of the clear unit when a scanning direction of the input image is reversed. 前記不適当な場合とは、注目画素がラインの先頭画素である場合、注目画素が入力画像の下限レベルの値を有する場合又は注目画素が入力画像の上限レベルの値を有する場合の少なくとも1つが含まれていることを特徴とする請求項3乃至請求項5の何れか1項に記載の画像処理装置。The inappropriate case is that at least one of a case where the pixel of interest is the first pixel of the line, a case where the pixel of interest has a value of the lower limit level of the input image, and a case where the pixel of interest has a value of the upper limit level of the input image. The image processing apparatus according to claim 3, wherein the image processing apparatus includes the image processing apparatus. 前記算出手段により算出された量子化誤差を所定範囲内の数値へと制限する数値制限手段をさらに備える請求項1乃至請求項6の何れか1項に記載の画像処理装置。The image processing apparatus according to claim 1, further comprising a numerical value limiting unit that limits the quantization error calculated by the calculating unit to a numerical value within a predetermined range. 注目画素の画像データをビット拡張するビット拡張手段と、
前記ビット拡張された画像データを補正する補正手段と、
前記補正された画像データの整数部を量子化する量子化手段と、
前記量子化手段により発生する量子化誤差を保持する保持手段と、
前記保持手段により保持されている第1の量子化誤差と、前記注目画素に関する第2の量子化誤差とに少なくとも基づいて、前記補正手段により利用される補正値を生成する補正値生成手段と、
前記ビット拡張手段のビット拡張処理において、次の画像データの下位ビット側へと結合される前記補正値の少数部を格納する格納手段と、
を備える画像処理装置。
Bit extension means for bit-extending the image data of the pixel of interest,
Correction means for correcting the bit-extended image data,
Quantizing means for quantizing an integer part of the corrected image data,
Holding means for holding a quantization error generated by the quantization means,
A correction value generation unit configured to generate a correction value used by the correction unit based at least on the first quantization error held by the storage unit and the second quantization error related to the pixel of interest;
In the bit expansion processing of the bit expansion means, storage means for storing a decimal part of the correction value to be combined with the lower bit side of the next image data,
An image processing apparatus comprising:
入力された画像データの上位ビットを量子化する量子化手段と、
前記量子化手段の量子化処理により発生した量子化誤差を算出する算出手段と、
前記算出された量子化誤差を格納するバッファと、
前記バッファに格納されている第1の画素の量子化誤差と、前記算出手段により算出された第2の画素の量子化誤差とに少なくとも基づいて、第3の画素の画像データを誤差拡散する誤差拡散手段と、
前記誤差拡散された画像データの所定ビット以下の値を保持する保持手段と、前記保持されている値の整数部を、入力された画像データへと加算する加算手段と、
前記保持されている値の小数部を、前記整数部を加算された画像データの下位ビット側に結合して前記量子化手段へと出力するビット結合手段と、
を備える画像処理装置。
Quantizing means for quantizing upper bits of the input image data,
Calculation means for calculating a quantization error generated by the quantization processing of the quantization means,
A buffer for storing the calculated quantization error,
An error for error-diffusion of image data of a third pixel based at least on the quantization error of the first pixel stored in the buffer and the quantization error of the second pixel calculated by the calculation unit. Spreading means;
Holding means for holding a value equal to or less than a predetermined bit of the error-diffused image data, and adding means for adding an integer part of the held value to input image data,
Bit combining means for combining the fractional part of the held value with the lower bit side of the image data to which the integer part has been added, and outputting the combined value to the quantization means,
An image processing apparatus comprising:
前記算出手段は、算出された量子化誤差を所定範囲に制限して前記バッファへと出力する数値制限手段を備える請求項9に記載の画像処理装置。The image processing apparatus according to claim 9, wherein the calculating unit includes a numerical value limiting unit that limits the calculated quantization error to a predetermined range and outputs the result to the buffer. 前記量子化誤差を算出する際に利用される量子化代表値の最大値を、入力される画像データの最大値以上に設定することを特徴とする請求項9又は請求項10に記載の画像処理装置。The image processing according to claim 9, wherein a maximum value of a quantization representative value used when calculating the quantization error is set to be equal to or larger than a maximum value of input image data. apparatus. 前記量子化誤差を算出する際に利用される量子化代表値のステップ幅を2のべき乗の一定値にすることを特徴とする請求項11に記載の画像処理装置。12. The image processing apparatus according to claim 11, wherein a step width of a quantization representative value used when calculating the quantization error is set to a constant value of a power of two. 前記保持されている値を次の画素以降に伝播させることが不適当な場合には、該保持されている値の伝播を阻止する阻止手段をさらに含むことを特徴とする請求項9乃至請求項12の何れか1項に記載の画像処理装置。10. The image processing apparatus according to claim 9, further comprising: a blocking unit configured to block the propagation of the held value when it is inappropriate to propagate the held value to the next pixel and subsequent pixels. The image processing device according to any one of claims 12 to 12. 前記阻止手段は、
前記不適当な場合に、前記保持手段に保持されている値をクリアするクリア手段を含む請求項13に記載の画像処理装置。
The blocking means,
14. The image processing apparatus according to claim 13, further comprising a clearing unit that clears the value held in the holding unit when the inappropriate state is found.
入力画像の走査方向が反転された場合には、前記クリア手段のクリア処理を制限する処理制限手段をさらに備えることを特徴とする請求項14に記載の画像処理装置。15. The image processing apparatus according to claim 14, further comprising a processing restriction unit that restricts a clear process of the clear unit when a scanning direction of the input image is reversed. 前記不適当な場合とは、注目画素がラインの先頭画素である場合、注目画素が入力画像の下限レベルの値を有する場合又は注目画素が入力画像の上限レベルの値を有する場合の少なくとも1つが含まれていることを特徴とする請求項13乃至請求項15の何れか1項に記載の画像処理装置。The inappropriate case is that at least one of a case where the pixel of interest is the first pixel of the line, a case where the pixel of interest has a value of the lower limit level of the input image, and a case where the pixel of interest has a value of the upper limit level of the input image. The image processing apparatus according to claim 13, wherein the image processing apparatus includes the image processing apparatus. 入力画像の下限レベル値を有する画素を検出する第1の検出手段と、
前記入力画像の下限レベル値を有する画素が検出されると、当該画素に関する出力コードとして、量子化代表値が最小となるような出力コードを出力する第1のコード出力手段と、
をさらに備える請求項9乃至請求項16の何れか1項に記載の画像処理装置。
First detection means for detecting a pixel having a lower limit level value of the input image;
When a pixel having a lower limit level value of the input image is detected, a first code output unit that outputs an output code having a minimum quantization representative value as an output code for the pixel,
The image processing apparatus according to any one of claims 9 to 16, further comprising:
入力画像の上限レベル値を有する画素を検出する第2の検出手段と、
前記入力画像の上限レベル値を有する画素が検出されると、当該画素に関する出力コードとして、量子化代表値が最大となるような出力コードを出力する第2のコード出力手段と、
をさらに備える請求項9乃至請求項16の何れか1項に記載の画像処理装置。
Second detection means for detecting a pixel having an upper limit level value of the input image;
When a pixel having an upper limit level value of the input image is detected, as an output code related to the pixel, a second code output unit that outputs an output code that maximizes a quantization representative value,
The image processing apparatus according to any one of claims 9 to 16, further comprising:
前記下限レベル値又は上限レベル値を有する画素が検出されると、当該画素に関する量子化誤差を0に置換する置換手段を備える請求項9乃至請求項18の何れか1項に記載の画像処理装置。19. The image processing apparatus according to claim 9, further comprising: a replacement unit configured to replace a quantization error related to the pixel with 0 when a pixel having the lower limit level value or the upper limit level value is detected. . 入力された画像データを量子化するステップと、
前記量子化により発生した量子化誤差を算出するステップと、
前記算出された量子化誤差をバッファに格納するステップと、
前記バッファに格納されている第1の画素の量子化誤差と、前記算出された第2の画素の量子化誤差とに少なくとも基づいて、誤差拡散を実行するステップと、
前記誤差拡散による演算誤差が次の入力画像データに与える影響を低減するステップと
を備える画像処理方法。
Quantizing the input image data;
Calculating a quantization error generated by the quantization;
Storing the calculated quantization error in a buffer;
Performing error diffusion based at least on the quantization error of the first pixel stored in the buffer and the calculated quantization error of the second pixel;
Reducing the influence of the calculation error due to the error diffusion on the next input image data.
前記低減のステップは、前記誤差拡散により量子化誤差を拡散すべく生成された補正値の小数部を次の入力画像データの下位ビット側へと結合するステップを含む請求項20に記載の画像処理方法。21. The image processing according to claim 20, wherein the step of reducing includes a step of combining a decimal part of a correction value generated to diffuse a quantization error by the error diffusion to a lower bit side of next input image data. Method. 前記補正値を次の画素以降に伝播させることが不適当な場合に、該補正値の伝播を阻止するステップをさらに含むことを特徴とする請求項21に記載の画像処理方法。22. The image processing method according to claim 21, further comprising a step of preventing propagation of the correction value when it is inappropriate to propagate the correction value to a subsequent pixel. 前記補正値の小数部を保持するステップと、
前記保持されている補正値の小数部を次の入力画像データの下位ビット側に結合することが不適当な場合に、前記保持ステップに保持されている小数部をクリアするステップと、
をさらに含む請求項21に記載の画像処理方法。
Holding a decimal part of the correction value;
When it is inappropriate to combine the decimal part of the held correction value with the lower bit side of the next input image data, clearing the decimal part held in the holding step,
The image processing method according to claim 21, further comprising:
入力画像の走査方向が反転された場合には、前記クリアの処理を制限するステップをさらに備えることを特徴とする請求項23に記載の画像処理方法。24. The image processing method according to claim 23, further comprising a step of restricting the clearing process when the scanning direction of the input image is reversed. 前記不適当な場合とは、注目画素がラインの先頭画素である場合、注目画素が入力画像の下限レベルの値を有する場合又は注目画素が入力画像の上限レベルの値を有する場合の少なくとも1つが含まれていることを特徴とする請求項22乃至請求項24の何れか1項に記載の画像処理方法。The inappropriate case is that at least one of a case where the pixel of interest is the first pixel of the line, a case where the pixel of interest has a value of the lower limit level of the input image, and a case where the pixel of interest has a value of the upper limit level of the input image. The image processing method according to any one of claims 22 to 24, wherein the image processing method is included. 前記算出ステップにより算出された量子化誤差を所定範囲内の数値へと制限するステップをさらに備える請求項20乃至請求項25の何れか1項に記載の画像処理方法。26. The image processing method according to claim 20, further comprising a step of limiting the quantization error calculated in the calculation step to a numerical value within a predetermined range. 注目画素の画像データをビット拡張するステップと、
前記ビット拡張された画像データを補正するステップと、
前記補正された画像データの整数部を量子化するステップと、
前記量子化により発生する量子化誤差を保持するステップと、
前記保持保持されている第1の量子化誤差と、前記注目画素に関する第2の量子化誤差とに少なくとも基づいて、前記補正のステップにより利用される補正値を生成するステップと、
前記ビット拡張のステップにおいて次の画像データの下位ビット側へと結合される前記補正値の少数部を格納するステップと、
を備える画像処理方法。
Bit expanding the image data of the pixel of interest;
Correcting the bit-extended image data;
Quantizing an integer part of the corrected image data;
Holding a quantization error generated by the quantization,
Generating a correction value used in the correction step based at least on the held first quantization error and the second quantization error related to the pixel of interest;
Storing the fractional part of the correction value that is combined with the lower bit side of the next image data in the step of bit extension;
An image processing method comprising:
入力された画像データの上位ビットを量子化するステップと、
前記量子化処理により発生した量子化誤差を算出するステップと、
前記算出された量子化誤差をバッファに格納するステップと、
前記バッファに格納されている第1の画素の量子化誤差と、前記算出された第2の画素の量子化誤差とに少なくとも基づいて、第3の画素の画像データを誤差拡散するステップと、
前記誤差拡散された画像データの所定ビット以下の値を保持するステップと、前記保持されている値の整数部を、入力された画像データへと加算するステップと、
前記保持されている値の小数部を、前記整数部を加算された画像データの下位ビット側に結合して出力するステップと、
を備える画像処理方法。
Quantizing the upper bits of the input image data;
Calculating a quantization error generated by the quantization process;
Storing the calculated quantization error in a buffer;
Error-diffusion of image data of a third pixel based at least on the quantization error of the first pixel stored in the buffer and the calculated quantization error of the second pixel;
Holding the value of a predetermined bit or less of the error-diffused image data, and adding an integer part of the held value to the input image data,
Combining the fractional part of the held value with the lower bit side of the image data to which the integer part has been added, and outputting the combined value;
An image processing method comprising:
前記算出のステップは、前記算出された量子化誤差を所定範囲に制限して前記バッファへと出力するステップを備える請求項28に記載の画像処理方法。29. The image processing method according to claim 28, wherein the calculating step includes a step of limiting the calculated quantization error to a predetermined range and outputting the result to the buffer. 前記量子化誤差を算出する際に利用される量子化代表値の最大値を、入力される画像データの最大値以上に設定することを特徴とする請求項28又は請求項29に記載の画像処理方法。30. The image processing according to claim 28, wherein a maximum value of a quantization representative value used in calculating the quantization error is set to be equal to or larger than a maximum value of input image data. Method. 前記量子化誤差を算出する際に利用される量子化代表値のステップ幅を2のべき乗の一定値にすることを特徴とする請求項30に記載の画像処理方法。31. The image processing method according to claim 30, wherein a step width of a quantization representative value used in calculating the quantization error is a constant value of a power of two. 前記保持されている値を次の画素以降に伝播させることが不適当な場合には、該保持されている値の伝播を阻止するステップをさらに含むことを特徴とする請求項28乃至請求項31の何れか1項に記載の画像処理方法。32. The method according to claim 28, further comprising, if it is inappropriate to propagate the retained value to the next pixel and subsequent pixels, blocking the propagation of the retained value. The image processing method according to claim 1. 前記阻止のステップは、前記不適当な場合に、前記保持ステップに保持されている値をクリアするステップを含む請求項32に記載の画像処理方法。33. The image processing method according to claim 32, wherein the step of blocking includes a step of clearing the value held in the holding step in the case of the inappropriateness. 入力画像の走査方向が反転された場合に前記クリア処理を制限するステップをさらに備えることを特徴とする請求項33に記載の画像処理方法。The image processing method according to claim 33, further comprising a step of restricting the clearing process when the scanning direction of the input image is reversed. 前記不適当な場合とは、注目画素がラインの先頭画素である場合、注目画素が入力画像の下限レベルの値を有する場合又は注目画素が入力画像の上限レベルの値を有する場合の少なくとも1つが含まれていることを特徴とする請求項32乃至請求項34の何れか1項に記載の画像処理方法。The inappropriate case is that at least one of a case where the pixel of interest is the first pixel of the line, a case where the pixel of interest has a value of the lower limit level of the input image, and a case where the pixel of interest has a value of the upper limit level of the input image. The image processing method according to any one of claims 32 to 34, wherein the method is included. 入力画像の下限レベル値を有する画素を検出するステップと、
前記入力画像の下限レベル値を有する画素が検出されると、当該画素に関する出力コードとして、量子化代表値が最小となるような出力コードを出力するステップと、
をさらに備える請求項28乃至請求項35の何れか1項に記載の画像処理方法。
Detecting a pixel having a lower level value of the input image;
When a pixel having a lower limit level value of the input image is detected, outputting an output code such that a quantization representative value is minimized as an output code for the pixel,
The image processing method according to any one of claims 28 to 35, further comprising:
入力画像の上限レベル値を有する画素を検出するステップと、
前記入力画像の上限レベル値を有する画素が検出されると、当該画素に関する出力コードとして、量子化代表値が最大となるような出力コードを出力するステップと、
をさらに備える請求項28乃至請求項35の何れか1項に記載の画像処理方法。
Detecting pixels having an upper level value of the input image;
When a pixel having an upper limit level value of the input image is detected, outputting an output code such that a quantization representative value is maximized as an output code related to the pixel,
The image processing method according to any one of claims 28 to 35, further comprising:
前記下限レベル値又は上限レベル値を有する画素が検出されると、当該画素に関する量子化誤差を0に置換するステップをさらに備える請求項28乃至請求項37の何れか1項に記載の画像処理方法。38. The image processing method according to claim 28, further comprising: when a pixel having the lower limit level value or the upper limit level value is detected, replacing a quantization error relating to the pixel with 0. . 入力された画像データを量子化するステップと、
前記量子化により発生した量子化誤差を算出するステップと、
前記算出された量子化誤差をバッファに格納するステップと、
前記バッファに格納されている第1の画素の量子化誤差と、前記算出された第2の画素の量子化誤差とに少なくとも基づいて、誤差拡散を実行するステップと、
前記誤差拡散による演算誤差が次の入力画像データに与える影響を低減するステップと
をコンピュータに実行させるための画像処理プログラム。
Quantizing the input image data;
Calculating a quantization error generated by the quantization;
Storing the calculated quantization error in a buffer;
Performing error diffusion based at least on the quantization error of the first pixel stored in the buffer and the calculated quantization error of the second pixel;
A step of reducing the influence of the calculation error due to the error diffusion on the next input image data.
注目画素の画像データをビット拡張するステップと、
前記ビット拡張された画像データを補正するステップと、
前記補正された画像データの整数部を量子化するステップと、
前記量子化により発生する量子化誤差を保持するステップと、
前記保持保持されている第1の量子化誤差と、前記注目画素に関する第2の量子化誤差とに少なくとも基づいて、前記補正のステップにより利用される補正値を生成するステップと、
前記ビット拡張のステップにおいて次の画像データの下位ビット側へと結合される前記補正値の少数部を格納するステップと、
をコンピュータに実行させるための画像処理プログラム。
Bit expanding the image data of the pixel of interest;
Correcting the bit-extended image data;
Quantizing an integer part of the corrected image data;
Holding a quantization error generated by the quantization,
Generating a correction value used in the correction step based at least on the held first quantization error and the second quantization error related to the pixel of interest;
Storing the fractional part of the correction value that is combined with the lower bit side of the next image data in the step of bit extension;
Image processing program for causing a computer to execute.
入力された画像データの上位ビットを量子化するステップと、
前記量子化処理により発生した量子化誤差を算出するステップと、
前記算出された量子化誤差をバッファに格納するステップと、
前記バッファに格納されている第1の画素の量子化誤差と、前記算出された第2の画素の量子化誤差とに少なくとも基づいて、第3の画素の画像データを誤差拡散するステップと、
前記誤差拡散された画像データの所定ビット以下の値を保持するステップと、前記保持されている値の整数部を、入力された画像データへと加算するステップと、
前記保持されている値の小数部を、前記整数部を加算された画像データの下位ビット側に結合して出力するステップと、
をコンピュータに実行させるための画像処理プログラム。
Quantizing the upper bits of the input image data;
Calculating a quantization error generated by the quantization process;
Storing the calculated quantization error in a buffer;
Error-diffusion of image data of a third pixel based at least on the quantization error of the first pixel stored in the buffer and the calculated quantization error of the second pixel;
Holding the value of a predetermined bit or less of the error-diffused image data, and adding an integer part of the held value to the input image data,
Combining the fractional part of the held value with the lower bit side of the image data to which the integer part has been added, and outputting the combined value;
Image processing program for causing a computer to execute.
直前画素の量子化誤差が0であることを検出する手段と、
前記直前画素の量子化誤差が0であると検出されると、該画素に関する誤差拡散係数を変更する変更手段と
をさらに備える請求項9乃至請求項19の何れか1項に記載の画像処理装置。
Means for detecting that the quantization error of the immediately preceding pixel is 0;
20. The image processing apparatus according to claim 9, further comprising: a change unit configured to change an error diffusion coefficient for the pixel when the quantization error of the immediately preceding pixel is detected to be 0. .
前記変更手段は、上のラインの拡散係数の割合が大きくなるように変更することを特徴とする請求項42に記載の画像処理装置。43. The image processing apparatus according to claim 42, wherein the changing unit changes the ratio of a diffusion coefficient of an upper line to be larger. 入力画像データと該入力画像データに最も近い量子化代表値との差分を算出する手段と、
前記差分に応じて誤差拡散係数を変更する変更手段と
をさらに備える請求項9乃至請求項19の何れか1項に記載の画像処理装置。
Means for calculating the difference between the input image data and the quantized representative value closest to the input image data,
20. The image processing apparatus according to claim 9, further comprising a changing unit configured to change an error diffusion coefficient according to the difference.
前記変更手段は、上記差分が小さくなるに従って上のラインの拡散係数の割合が大きくなるように変更することを特徴とする請求項44に記載の画像処理装置。The image processing apparatus according to claim 44, wherein the changing unit changes the ratio of the diffusion coefficient of the upper line to increase as the difference decreases. 直前画素の量子化誤差が0であることを検出するステップと、
前記直前画素の量子化誤差が0であると検出されたとき、該画素に関する誤差拡散係数を変更するステップとをさらに備える請求項28乃至請求項38の何れか1項に記載の画像処理方法。
Detecting that the quantization error of the immediately preceding pixel is 0;
39. The image processing method according to claim 28, further comprising: when the quantization error of the immediately preceding pixel is detected to be 0, changing an error diffusion coefficient for the pixel.
前記変更ステップは、上のラインの拡散係数の割合が大きくなるように変更することを特徴とする請求項46に記載の画像処理装置。47. The image processing apparatus according to claim 46, wherein the changing step changes the ratio of a diffusion coefficient of an upper line to be larger. 入力画像データと該入力画像データに最も近い量子化代表値との差分を算出するステップと、
前記差分に応じて誤差拡散係数を変更するステップと
をさらに備える請求項28乃至請求項38の何れか1項に記載の画像処理装置。
Calculating a difference between the input image data and the quantized representative value closest to the input image data;
39. The image processing apparatus according to claim 28, further comprising: changing an error diffusion coefficient according to the difference.
前記変更ステップは、前記差分が小さくなるに従って上のラインの拡散係数の割合が大きくなるように変更することを特徴とする請求項48に記載の画像処理方法。49. The image processing method according to claim 48, wherein in the changing step, the ratio of the diffusion coefficient of the upper line increases as the difference decreases.
JP2003130539A 2002-07-11 2003-05-08 Image processing apparatus and image processing method Expired - Fee Related JP4136779B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2003130539A JP4136779B2 (en) 2002-07-11 2003-05-08 Image processing apparatus and image processing method
US10/611,948 US8009327B2 (en) 2002-07-11 2003-07-03 Method and apparatus for image processing

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2002203112 2002-07-11
JP2003130539A JP4136779B2 (en) 2002-07-11 2003-05-08 Image processing apparatus and image processing method

Publications (3)

Publication Number Publication Date
JP2004096709A true JP2004096709A (en) 2004-03-25
JP2004096709A5 JP2004096709A5 (en) 2006-06-22
JP4136779B2 JP4136779B2 (en) 2008-08-20

Family

ID=32072206

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003130539A Expired - Fee Related JP4136779B2 (en) 2002-07-11 2003-05-08 Image processing apparatus and image processing method

Country Status (1)

Country Link
JP (1) JP4136779B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006116760A (en) * 2004-10-20 2006-05-11 Pictologic Inc Printer system
JP2012165200A (en) * 2011-02-07 2012-08-30 Ricoh Co Ltd Image processing device, image forming device, image display device, image processing method, program and recording medium
JP2012169840A (en) * 2011-02-14 2012-09-06 Ricoh Co Ltd Image processing system
JP2014011544A (en) * 2012-06-28 2014-01-20 Fuji Xerox Co Ltd Image processing apparatus and program
US8660925B2 (en) 2006-06-16 2014-02-25 Itg Software Solutions, Inc. Algorithmic trading system and method
JP2014197807A (en) * 2013-03-29 2014-10-16 ブラザー工業株式会社 Image processing device, method for controlling image processing device, and program for controlling image processing device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006116760A (en) * 2004-10-20 2006-05-11 Pictologic Inc Printer system
US8660925B2 (en) 2006-06-16 2014-02-25 Itg Software Solutions, Inc. Algorithmic trading system and method
JP2012165200A (en) * 2011-02-07 2012-08-30 Ricoh Co Ltd Image processing device, image forming device, image display device, image processing method, program and recording medium
JP2012169840A (en) * 2011-02-14 2012-09-06 Ricoh Co Ltd Image processing system
JP2014011544A (en) * 2012-06-28 2014-01-20 Fuji Xerox Co Ltd Image processing apparatus and program
JP2014197807A (en) * 2013-03-29 2014-10-16 ブラザー工業株式会社 Image processing device, method for controlling image processing device, and program for controlling image processing device

Also Published As

Publication number Publication date
JP4136779B2 (en) 2008-08-20

Similar Documents

Publication Publication Date Title
JP4533218B2 (en) Image processing apparatus, image processing method, and image processing program
JP4217657B2 (en) Image processing method, program, storage medium, and apparatus
US8009327B2 (en) Method and apparatus for image processing
JPH0765162A (en) Equipment and method for diffusing balanced quantization error
JP2006065834A (en) Image processing device and image processing method
EP2111032B1 (en) Image processing apparatus and method thereof
JP3171993B2 (en) Image processing method and apparatus
JP4136779B2 (en) Image processing apparatus and image processing method
JPH11177818A (en) Image processor
JP4068181B2 (en) Multilevel gradation pixel value level reduction method and system
US6693727B1 (en) Image processing apparatus for performing high-speed error diffusion
JP3209763B2 (en) Image signal processing method
US20100171988A1 (en) Image processing apparatus and image processing method
JP5312158B2 (en) Image processing apparatus and image processing method
JP2000022951A (en) Image processing method and image processor
JPH11252364A (en) Image processing method and its device
JP3723046B2 (en) Image processing device
JP4243855B2 (en) Image processing apparatus, image processing method, image processing program, and storage medium
JP2851661B2 (en) Image processing device
JP2004048194A (en) Image processor and method thereof
US20040179240A1 (en) Method and apparatus for generating binary image using information on location of minority pixels
JP3200274B2 (en) Image processing method and apparatus
JP4035280B2 (en) Image processing apparatus and processing method thereof
KR0150164B1 (en) Quantization method and apparatus using error diffusion for image processing system
US20100183234A1 (en) Apparatus, method, and program

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060428

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060428

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080222

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080422

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080603

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120613

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120613

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130613

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees