JP3757484B2 - Image processing device - Google Patents
Image processing device Download PDFInfo
- Publication number
- JP3757484B2 JP3757484B2 JP23331496A JP23331496A JP3757484B2 JP 3757484 B2 JP3757484 B2 JP 3757484B2 JP 23331496 A JP23331496 A JP 23331496A JP 23331496 A JP23331496 A JP 23331496A JP 3757484 B2 JP3757484 B2 JP 3757484B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- error
- image data
- pixel
- error data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000006243 chemical reaction Methods 0.000 claims description 92
- 238000003672 processing method Methods 0.000 claims description 5
- 238000011144 upstream manufacturing Methods 0.000 claims description 5
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 claims description 3
- 230000001360 synchronised effect Effects 0.000 description 17
- 238000000034 method Methods 0.000 description 14
- 238000009792 diffusion process Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 230000003111 delayed effect Effects 0.000 description 4
- 230000006866 deterioration Effects 0.000 description 4
- 230000015654 memory Effects 0.000 description 4
- 230000015556 catabolic process Effects 0.000 description 3
- 238000006731 degradation reaction Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000007423 decrease Effects 0.000 description 2
- 230000004888 barrier function Effects 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000001934 delay Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、ある注目画素に対しそれより前に走査された画素の処理結果を参照して、その注目画素の画像データを処理する画像処理装置に関する。
【0002】
【従来の技術】
一般に、階調変換処理において広く用いられている方式として誤差拡散法がある。かかる誤差拡散法は、1画素Nビットで表わされる画像データを1画素Kビットで表わされる画像データに変換する際に(ただし、N、KはN>Kとする自然数)、発生する誤差を周辺画素に所定の割合で振り分け、画像劣化を最小限に抑えることを目的とした処理方式の1つであり、特に、中間調画像データを処理する場合に有効な手法である。
ここで誤差拡散法は、通常、ある1つの画素(注目画素)の画像データを処理する場合に、当該画素よりも前に走査された画素であって、当該画素の周辺に位置する数画素の誤差データを参照する。例えば、注目画素が存在する直前1ラインの数画素と、注目画素の直前1画素とについての誤差データを参照する。
【0003】
この例の誤差拡散法を実行するための一般的な回路構成を、図12に示す。この図に示す処理回路は、N=8、K=4の場合、すなわち、1画素8ビットの画像データを、それよりも階調が低い1画素4ビットの画像データに変換するものである。
図において、まず、注目画素にかかる1画素8ビットの画像データは、加算部201によって、乗算部202から供給された誤差データ、詳細には、注目画素が存在するラインよりも1ライン前に位置する参照画素の誤差データと加算され、F/Fにより同期化された後、F/Fを介して加算部203の一方の入力端に供給される。加算部203の他方の入力端には、後述する乗算部204から供給された直前1画素の誤差データが供給される。このため、直前1ライン分の誤差データが加算された画像データには、さらに、直前1画素の誤差データが加算されて、データ変換部205に供給される。データ変換部205は、所定のしきい値と比較して、1画素8ビットの画像データを1画素4ビットの画像データに変換するとともに、当該変換に伴う誤差データを出力する。この誤差データは、乗算部204により所定の誤差係数およびフィルタ係数で重み付けされ、F/Fで同期化された後、加算部203の他方の入力端にフィードバックされるとともに、ラインメモリとして機能するFIFO(First In First Out:先入れ先出しメモリ)206に供給され、一旦格納される。FIFO206に格納された誤差データは、1ライン分遅延したタイミングで読み出され、乗算部202により所定の誤差係数およびフィルタ係数で重み付けされた後、加算部201にフィードバックされて、直前1ラインの誤差データとして参照されることとなる。
【0004】
【発明が解決しようとする課題】
さて、このような処理において、注目画素における直前1画素の誤差データについて注目すると、その処理過程が、加算部203→データ変換部205→乗算部203という3段の処理ブロックとなっているため、高速な処理を実行する場合の障壁となっていた(フィルタ係数や誤差係数を乗じない構成としても2段の処理ブロックが必要である)。
このため、従来では、▲1▼直前画素を参照する場合に、画像処理クロックを低速にする、あるいは▲2▼画像処理クロックを高速にする場合には、直前画素を参照しない、としていた。
しかしながら、▲1▼では、当然のことながら、画像処理に要する時間が長大となり、また▲2▼では、アルゴリズムの一部を省略するため、変換後の画質劣化が大きい、といった問題点があった。
本発明は、上記背景に鑑みてなされたものであり、その目的とするところは、画像処理にかかるクロックの高速化が可能であって、かつ、変換後の画質劣化が小さい画像処理装置を提供することにある。
【0005】
【課題を解決するための手段】
上記課題を解決するために、本発明にあっては、注目画素よりも上流に位置する少なくとも1つ以上の参照画素にかかる処理結果を用いて、当該注目画素を示すNビットの画像データを、Kビットの画像データに変換する(ただし、N、KはN>Kとする自然数)画像処理装置において、当該注目画素を示すNビットの画像データを、Kビットの画像データに変換する第1のデータ処理手段と、前記第1のデータ処理手段による変換の際に、その誤差データを生成する誤差データ生成手段と、前記誤差データ生成手段により生成された誤差データと前記参照画素の画像データを変換した際の誤差データとの加算結果に基づいて、前記第1のデータ処理手段により変換した画像データに対する補正信号を生成する補正信号生成手段と、前記第1のデータ処理手段により変換した画像データを、前記補正信号により補正する第2のデータ処理手段とを具備することを特徴としている。
【0006】
(作用)
注目画素よりも上流に位置する少なくとも1つ以上の参照画素にかかる処理結果を用いて、当該注目画素の画像データを処理する画像処理装置の従来構成は、注目画素の画像データと参照画素の処理結果とを加算する加算手段と、その加算結果に対し所定の処理を施すとともに、その処理にかかる処理結果を加算手段にフィードバックする処理手段とからなっていた。すなわち、フィードバックループに存在する手段は、加算手段と処理手段との2つである。
これに対し本発明では、第1のデータ処理手段が、注目画素の画像データに所定の処理を施して第1のデータを生成し、補正信号生成手段が、第1のデータの処理結果および参照画素の処理結果から、前記第1のデータに対する補正信号を生成し、第2のデータ処理手段が、第1のデータを補正信号により補正するので、フィードバックループに存在する手段は補正信号生成手段の1つのみである。したがって、その分、画像処理を高速化することが可能となる。しかも、本発明による処理結果は、従来構成と同様に、注目画素の処理結果が次の位置の画素に対応する画像データに反映されているので、画像処理における画質劣化を従来と全く同様に小さく抑えることが可能となる。
【0007】
【発明の実施の形態】
以下、本発明の実施形態について、図面を参照して説明する。
【0008】
<第1実施形態>
はじめに、本発明の第1実施形態にかかる画像処理装置について説明する。本実施形態にかかる画像処理装置は、1画素8ビットの画像データ(すなわち、レベルが0〜255で示される256階調の画像データ)を、1画素4ビットの画像データ(すなわち、レベルが0〜15で示される16階調の画像データ)に階調変換するものであって、その変換の際に、図2に示すフィルタを用いるものである。
このフィルタは、図2に示すように、処理対象にかかる注目画素xの画像データを処理する場合に、当該画素xよりも1ライン前に存在する画素であって、主走査方向の位置が1画素前〜1画素後の画素a〜cおよび当該画素xと同じラインに存在する画素であって直前の画素dについての計4画素の誤差データを参照するものである。
そして、これらの誤差データは、所定の誤差係数およびフィルタ係数で重み付けされた後、注目画素xの画像データXに加算されて、その変換処理の際に参照されることとなる。
【0009】
さて、本実施形態において、注目画素xに加算すべき誤差データΔXは、次式のように表わされる。
ΔX=e(Ka・Da+Kb・Db+Kc・Dc+Kd・Dd)……(1)
なお、この式(1)において、eは注目画素xについての誤差係数であり、Da〜Ddは、それぞれ画素a〜dについての係数乗算前の誤差データであり、Ka〜Kdは、それぞれ誤差データDa〜Ddについてのフィルタ係数であって、これらの総和が1となるものである。
【0010】
また、注目画素xにおいて、誤差データを考慮した画像データX’は、次式のようになる。
X’=X+ΔX ……(2)
そして、この式(2)によって得られる1画素Nビットの画像データX’を、1画素Kビットの画像データに変換することにより、階調を落としても画像劣化の少ない画像データを得ることが可能となる。
【0011】
次に、本実施形態にかかる画像処理装置の構成について、図1を参照して説明する。
この図において、加算部101は、注目画素xの階調を8ビットで表した画像データに、注目画素xが存在するラインより1ライン手前に位置する画素a、b、cの誤差データを累積加算する。これらの誤差データは、それぞれ乗算部102によって、所定のフィルタ係数および誤差係数がすでに乗算されて重み付けされている。
次に、第1データ変換部103は、誤差データが加算された8ビットの画像データを、所定のしきい値と比較して1次的に4ビットの画像データに変換するとともに、変換の際に生じた誤差データを出力する。加算部104は、注目画素xの誤差データと直前画素dの誤差データとを加算する。乗算部105は、次の3つの機能を有するブロックである。
すなわち、乗算部105は、第1に、加算された誤差データ(係数乗算なし)を、後に説明する補正信号に応じて置換して、第1の誤差データとしてFIFO106に供給する機能と、第2に、第1の誤差データに所定のフィルタ係数および誤差係数を乗算して第2の誤差データを求め、これを、注目画素の次に位置する画素について処理する場合に当該画素に対する直前画素の誤差データとすべく、加算部104にフィードバックする機能と、第3に、第1データ変換部103により変換された4ビットの画像データに対する補正信号を、加算された誤差データに対応して生成し、これを第2データ変換部107に供給する機能とを有する。ここで、FIFO106は、少なくとも1ライン分の誤差データを格納する容量を有するラインメモリである。
そして、第2データ変換部107は、第1データ変換部103により変換された4ビットの画像データを、乗算部105により生成された補正信号により補正して、最終的な出力とするものである。
なお、各ブロック間に設けられたF/F(フリップ・フロップ)は、図示しないシステムクロックにより当該データを同期化するためのものである。
【0012】
<第1の実施形態の動作>
次に、上述した実施形態による動作について説明する。
まず、1画素8ビットの画像データが入力されると、当該画像データは、加算部101によって、乗算部102から供給された画素a、b、cの誤差データと累積加算され、F/Fにより同期化された後、第1データ変換部103に供給される。
なお、加算部101に入力される画像データが最初の1ラインに存在する画素に対応するものである場合、参照すべき画素a、b、cが存在しないので、乗算部102は、存在しない位置に対応する画素の誤差データを“0”とする。すなわち、この場合、加算部101に入力された画像データは、そのまま出力される。
また、2ライン目以降における各ラインの先頭画素については、参照すべき画素aが存在しないので、他の画素b、cの誤差データのみが加算部101に入力される。反対に、2ライン目以降における各ラインの最終画素については、参照すべき画素cが存在しないので、他の画素a、bの誤差データのみが加算部101に入力される。
【0013】
さて、加算部101の出力データは、入力される画像データが8ビットであるのにもかかわらず10ビットとなっているが、これは次の理由による。すなわち、入力した画像データに誤差データを加算する場合、その誤差データによっては、加算結果が「0」未満となる場合あるいは「255」を越える場合があるため、これによるアンダーフローあるいはオーバーフローを防止するため、データの1ビットと符合の1ビットとを追加して計10ビットとしたのである。そして、この10ビットの加算結果、すなわち、入力された1画素8ビットの画像データに、画素a、b、cの誤差データを加算したものは、第1データ変換部103に供給される。
【0014】
次に、第1データ変換部103は、10ビットの画像データを、予め設定されたしきい値と比較して、4ビットの画像データに変換するとともに、その変換にかかる誤差データを生成する。ここで、しきい値と誤差データとの関係について説明する。
本実施形態において、入力される画像データが取り得る値は、8ビットであるため0〜255である。ここで、直前1ラインの画素a、b、cの誤差データの和が取り得る値を−6〜+6とすると、第1データ変換部103に入力される画像データVDが取り得る値は、−6〜+261となる。これを1画素4ビットの画像データに変換するためには、例えば、図4に示すような15個のしきい値が用いられる。
このようなしきい値を用いて、画像データVDが取り得る−6〜+261の範囲を16もの領域に区切り、それぞれの領域に対し、4ビットで示される0〜15の濃度値を割り当てておく。そして、第1データ変換部103は、画像データVDの値がいずれの領域に属するかを比較判断し、当該領域に割り当てられた濃度値を、変換後の画像データの値として出力する。
なお、8ビットから4ビットへの変換により発生する誤差データは、図3に示すように、−8〜+8の範囲に収まるので、そのためのビット数は「5」で足りる。
また、第1データ変換部103において、変換に用いるしきい値は図4に示すものに限られない。さらに、しきい値は固定であっても、可変であっても良い。可変の場合には、しきい値設定用のレジスタと、そのアクセスコントローラとを新たに設けることにより、任意のしきい値が設定可能となる。
【0015】
さて、第1データ変換部103により変換された4ビットの画像データは、2段のF/Fにより同期化されて、第2データ変換部107に供給される一方、5ビットで示される誤差データは、1段のF/Fにより同期化されて、加算部104に供給される。ここで、画像データの方が1段だけF/Fが多いのは、後述する補正処理とのタイミングの調整を行なっているためである。
【0016】
加算部104に入力された誤差データには、乗算部105によりフィードバックされた直前画素dの誤差データが加算されて、乗算部105に入力される。なお、加算部104に入力される画像データがラインの先頭に位置する画素に対応するものである場合、参照すべき画素dが存在しないので、乗算部105は、参照誤差データとして“0”を出力する。すなわち、この場合、加算部104に入力された画像データがそのまま出力されることとなる。
【0017】
ここで、加算部104の加算結果について検討してみる。第1データ変換部103が図4に示したしきい値を用いて、8ビットの画像データを4ビットの画像データに変換する場合、その誤差データは、前述したように−8〜+8の範囲内に収まる。ただし、第1データ変換部103により生成された誤差データには、注目画素xの1ライン前に位置する画素a、b、cの誤差データしか加味されておらず、直前画素dの誤差データについては加味されていない。したがって、第1データ変換部103による誤差データに直前画素dの誤差データを加算部104により加算すると、−8〜+8の範囲外となる場合がある。
いま、乗算部105から加算部104にフィードバックされる直前画素dの誤差データを3ビットで表わし、その取り得る範囲を−2〜+2とすると、加算部104による加算結果が取り得る範囲は、−10〜+10となる。
【0018】
次に、このような範囲の加算結果を入力した場合の乗算部105の動作ついて図5を参照して説明する。
この図に示すように、乗算部105は、加算部104の出力に対応して、前述した3つの機能にそれぞれにかかる信号を生成する。すなわち、乗算部105は、係数乗算前の誤差データであって、補正信号による補正を考慮した第1の誤差データと、第1の誤差データに所定のフィルタ係数および誤差係数を乗算して重み付けした第2の誤差データと、第1データ変換部103により変換された4ビットの画像データに対する補正信号と、をそれぞれ生成する。
【0019】
この図に示すように、乗算部105は、加算部104の出力が−8〜+8の範囲にある場合に、特に目立った処理をせず、第1の誤差データについては、加算部104の出力そのものとし、第2の誤差データについては、第1の誤差データにフィルタ係数および誤差係数を乗算したものとし、そして、補正信号については、“0”として、第1データ変換部103による変換された画像データを特に補正しない旨を指示する。
一方、乗算部105は、加算部104の出力が−10〜−9の範囲にある場合に、補正信号については、“−1”として、第1データ変換部103により変換された画像データの階調を1レベルだけ下げる(デクリメントする)旨を指示し、第1の誤差データについては、階調を1レベル下げた場合に対応するものに置き換え、第2の誤差データについても、それに対応したものとする。
また、乗算部105は、加算部104の出力が+9〜+10の範囲にある場合に、補正信号については、“+1”として、第1データ変換部103により変換された画像データの階調を1レベルだけ上げる(インクリメントする)旨を指示し、第1の誤差データについては、階調を1レベル上げた場合に対応するものに置き換え、第2の誤差データについても、それに対応したものとする。
【0020】
このように、乗算部105は、加算部104による加算結果が第1データ変換部103において生じ得る誤差範囲内であれば、その変換結果を補正しない旨を指示する一方、誤差範囲を上回ればあるいは下回れば、その変換結果をインクリメントあるいはデクリメントする旨の指示を行なう。これにより、第1データ変換部103により変換された4ビットの画像データは、直前画素dの誤差データについても考慮され、その考慮の結果を受けて補正されることなる。
また、この際、乗算部105は、加算部104による加算結果が第1データ変換部103において生じ得る誤差範囲外であれば、加算部104にフィードバックする誤差データは、補正信号による補正結果を見込んだものに置換される。これにより、当該補正による誤差データの不一致が防止される。
【0021】
そして、乗算部105により生成された補正信号は、第2データ変換部107に供給される。第2データ変換部107は、第1データ変換部103により変換された画像データの階調を、補正信号が“0”であれば補正せず、“−1”であれば1レベルだけ下げ、“+1”であれば1レベルだけ上げて、本画像処理装置における最終的な出力とする。
【0022】
なお、乗算部105における第2の誤差データについて説明すると、第1の誤差データに対する誤差係数eは、当該画像データに加味すべき誤差データの割合を画素毎に決定する係数であり、例えば、誤差係数が“0”であれば、誤差データを全く加味せず、また、“1”であれば誤差データを100%加味することとする。したがって、誤差係数eは、0〜1(0〜100%)の値を取り得る。ここで、誤差係数eが1ビットであれば、誤差係数を2段階(0/100%)で設定でき、また、2ビットであれば、4段階(0/33/66/100%)で設定できる。このように、誤差係数eを表わすビット数を広げれば、その分、加算すべき誤差データの割合を細かく設定することが可能となる。
一方、フィルタ係数Kは、本実施形態において参照すべき4つの画素a、b、c、dの誤差データを、どのような比率で加味すべきかを決定する係数であり、例えば、Ka=1/8、Kb=3/8、Kc=1/8、Kd=3/8(Ka+Kb+Kc+Kd=1)とすれば、a:b:c:d=1:3:1:3の割合で周辺画素の誤差データが加味される。
ここで、ある注目画素xの画像データに実際に加算される誤差データは、これらの誤差係数eとフィルタ係数Kとを誤差データに乗じた値、すなわち、e・Ka・Da、e・Kb・Db、e・Kc・Dcおよびe・Kd・Ddの和である。これが式(1)の右辺に相当する。
ただし、乗算部105は、直前画素dのみを対象とするから(他の画素a、b、cについては乗算部102が対象としている)、乗算部105では、e・Kd・Ddが計算される。
なお、言うまでもなく、図5に示した第2の誤差データは、一例であり、フィルタ係数あるいは誤差係数により異なる値をとる。
【0023】
次に、本実施形態にかかる画像処理装置による階調変換処理のタイミングチャートを、図6に示す。
この図に示すように、ある特定の画素、例えば1画素目について着目した場合、はじめの第1クロックT1においては、1画素目の画像データと乗算部102による誤差データとが加算部101により加算される。なお、本実施形態において、直前1ラインで参照すべき画素はa、b、cであるため、これらの画素の誤差データが次々とFIFO106から読み出され、乗算部102による乗算処理を受けた後、加算部102において、入力した画像データと累積加算される。この加算結果は、F/Fにより同期化されるため、次の第2クロックT2において第1データ変換部103に入力される。
次の第2クロックT2においては、かかる加算結果が第1データ変換部103によって4ビットの画像データに変換されるとともに、その変換誤差を示す誤差データが生成される。前者の画像データは、2段のF/Fにより同期化されるため、第4クロックT4において第2データ変換部107に入力される一方、後者の誤差データは、1段のF/Fにより同期化されるため、次の第3クロックT3において加算部104に入力される。
第3クロックT3においては、第1データ変換部103による誤差データと、乗算部105による誤差データとが加算部104によって加算されるとともに、その加算結果が乗算部105により処理される。この結果、乗算部105においては、係数乗算前の誤差データであって、補正信号による補正を考慮した第1の誤差データと、この第1の誤差データに所定のフィルタ係数および誤差係数を乗算して重み付けした第2の誤差データと、変換された4ビットの画像データに対する補正信号とがそれぞれ生成される。ここで、第1の誤差データは、この第3クロックにおいてFIFO106に直ちに入力されるが、第2の誤差データおよび補正信号は、ともに1段のF/Fにより同期化されるため、それぞれ第4クロックT4において加算部104あるいは第2データ変換部107に入力される。
なお、第3クロックT3において、乗算部105から加算部104に入力される誤差データが“0”となるのは、注目画素の位置関係による。
そして、第4クロックT4においては、変換された4ビットの画像データを乗算部105の補正信号によって補正する処理が第2データ変換部107によって実行されて、最終的な変換結果となる4ビットの画像データが出力される。
このような処理が、第1ラインの先頭の画素から主走査方向の画素に対してクロック毎に順次行なわれ、以降、同様な処理がラインを副走査方向に順次移動させて行なわれる。
【0024】
このような第1実施形態による画像処理装置によれば、図12に示した従来の画像処理装置と同様な画像データおよび誤差データが得られる。さらに、図12において、直前画素の誤差データを処理するための加算部203→データ変換部205→乗算部204というフィードバックを、第1実施形態では、データ変換部205に相当するブロックを当該フィードバックから外に出して、加算部203および乗算部204に相当する2つにブロックのみとしたので、当該フィードバックにおける処理速度を大幅に高速化することができる(実験の結果、約2倍)。
したがって、従来のように、処理速度あるいは画質のいずれかに制限が加わることもなく、高速かつ高画質の誤差拡散処理を行なうことができる。
【0025】
<第2の実施形態>
次に、本願発明の第2実施形態について説明する。本実施形態にかかる画像処理装置は、上述した第1実施形態と同様に、1画素8ビットの画像データを1画素4ビットの画像データに階調変換するものであるが、参照画素を拡大したフィルタを用いるものである。
このフィルタは、図8に示すように、処理対象にかかる注目画素xの画像データを処理する処理する場合、当該画素xよりも2ライン前に存在する画素であって、主走査方向の座標が2画素前〜2画素後の画素a〜eと、当該画素xよりも1ライン前に存在する画素であって、主走査方向の座標が2画素前〜2画素後の画素f〜jと、当該画素xと同じラインに存在する画素であって2画素前の画素kと、同じく1画素前の画素mとについての計12画素の誤差データを参照するものである。そして、これらの誤差データは、第1の実施形態と同様に、所定の誤差係数およびフィルタ係数で重み付けれた後、注目画素xの画像データXに加算される。
【0026】
さて、本実施形態において、注目画素xに加算すべき誤差データΔXは、次式のように表わされる。
なお、この式(1)において、eは注目画素xについての誤差係数であり、Da〜Dmは、それぞれ画素a〜mについての係数乗算前の誤差データであり、Ka〜Kmは、それぞれ誤差データDa〜Dmについてのフィルタ係数であって、これらの総和が1となるものである。
【0027】
したがって、注目画素xにおいて、誤差データに考慮した画像データX’は、式(2)と同様に、次式のようになる。
X’=X+ΔX ……(4)
そして、この式(4)によって得られる1画素Nビットの画像データX’を、1画素Kビットの画像データに変換することにより、階調を落としても画像劣化の少ない画像データを得ることが可能となる。
【0028】
次に、本実施形態にかかる画像処理装置の構成について、図7を参照して説明する。
この図に示すように、加算部701は、注目画素xの階調を8ビットで表した画像データに、注目画素xが存在するラインより2ライン手前に位置する画素a〜e、および1ライン手前に位置する画素f〜jについての誤差データを累積加算する。この誤差データは、乗算部702によって、所定のフィルタ係数および誤差係数がすでに乗算されて重み付けされている。
次に、第1データ変換部703は、第1データ変換部103と同様に、誤差データが加算された8ビットの画像データを、所定のしきい値と比較して1次的に4ビットの画像データに変換するとともに、変換の際に生じた誤差データを出力する。加算部704は、注目画素xの誤差データと2画素前の画素kの誤差データと直前の画素mの誤差データとを加算する。乗算部705は、次の3つの機能を有するブロックである。
すなわち、乗算部705は、第1に、加算された誤差データ(係数乗算なし)を、後に説明する補正信号に応じ置換して、第1の誤差データとしてFIFO706aに供給する機能と、第2に、第1の誤差データに所定のフィルタ係数および誤差係数を乗算して第2の誤差データを求め、これを、注目画素の次に位置する画素について処理する場合に当該画素に対する直前画素の誤差データとすべく、加算部704にフィードバックする機能と、第3に、第1データ変換部703により変換された4ビットの画像データに対する補正信号を、加算された誤差データに対応して生成する機能とを有する。さらに、乗算部705は、第1の誤差データに所定の誤差係数およびフィルタ係数を乗算し、1クロックだけ遅延させて第3の誤差データとし、これを、注目画素から2つ目の画素について処理する場合に当該画素に対する2画素前の誤差データとすべく、加算部704にフィードバックする機能も有する。
なお、FIFO706aおよび706bは、FIFO106と同様に、それぞれ少なくとも1ライン分の誤差データを格納する容量を有するラインメモリであり、誤差データを1ライン分だけ遅延させるために設けられる。特に、本実施形態では、画素a〜eの誤差データについては2ライン分遅延させる必要から、FIFO706aおよび706bの2段カスケード接続となっている。
そして、第2データ変換部707は、第1データ変換部703により変換された4ビットの画像データを、乗算部705により生成された補正信号により補正するものである。なお、各ブロック間に設けられたF/Fは、図示しないシステムクロックにより当該データを同期化するためのものである。
【0029】
<第2の実施形態の動作>
次に、上述した実施形態による動作について説明する。
まず、1画素8ビットの画像データが入力されると、当該画像データは、加算部701によって、乗算部702から供給された2ライン前の画素a〜eおよび1ライン前の画素f〜jの誤差データと累積加算され、F/Fにより同期化された後、第1データ変換部703に供給される。
【0030】
なお、図8に示すフィルタを用いた場合、図2に示したフィルタの考え方と同様に、注目画素の位置によっては、参照すべき誤差が存在しないときがある。そのようなときには、乗算部702は、存在しない位置に対応する画素の誤差データを“0”とする。例えば、注目画素が最初の1ラインに位置する場合、2ライン前の画素a〜eおよび1ライン前の画素f〜jの誤差データは、“0”にされる。また、注目画素が2ライン目に位置する場合、2ライン前の画素a〜eの誤差データは、“0”にされる。
【0031】
また、加算部701の出力データは、入力される画像データが8ビットであるのにもかかわらず10ビットとなっているが、これは、第1実施形態と同様な理由による。すなわち、入力した画像データに加算する誤差データによっては、その加算結果が「0」未満となる場合あるいは「255」を越える場合があるため、これによるアンダーフローあるいはオーバーフローを防止するため、データの1ビットと符合の1ビットとを追加して計10ビットとしたのである。そして、この10ビットの加算結果、すなわち、入力された1画素8ビットの画像データに、画素a〜jの誤差データを加算したものは、第1データ変換部703に供給される。
【0032】
次に、第1データ変換部703は、10ビットの画像データを、予め設定されたしきい値と比較して、4ビットの画像データに変換するとともに、その変換にかかる誤差データを生成する。ここで、しきい値と誤差データとの関係について説明する。
本実施形態において、入力される画像データが取り得る値は、8ビットであるため0〜255である。ここで、2ライン前の画素a〜eおよび1ライン前の画素f〜jの誤差データの和が取り得る値を−8〜+8とすると、第1データ変換部703に入力される画像データVDが取り得る値は、−8〜+263となる。これを1画素4ビットの画像データに変換するためには、例えば、図9に示すような15個のしきい値が用いられる。
このようなしきい値を用いて、−8〜+263の範囲を16もの領域に区切り、それぞれの領域に対し、4ビットで示される0〜15の濃度値を割り当てておく。そして、変換する際には、画像データの値がいずれの領域に属するかを比較判断し、当該領域に割り当てられた濃度値を、変換後の画像データの値とするようになっている。そして、8ビットから4ビットへの変換により発生する誤差データは、−8〜+8の範囲に収まるので、そのためのビット数は「5」で足りる。
なお、第1データ変換部703において、変換に用いるしきい値は図9に示すものに限られない。さらに、しきい値は固定であっても、可変であっても良い。可変の場合には、しきい値設定用のレジスタと、そのアクセスコントローラとを新たに設けることにより、任意のしきい値が設定可能となる。
【0033】
第1データ変換部703により変換された4ビットの画像データは、2段のF/Fにより同期化されて、第2データ変換部707に供給される一方、5ビットで示される誤差データは、1段のF/Fにより同期化されて、加算部704に供給される。ここで、画像データの方が1段だけF/Fが多いのは、第1実施形態と同様に、後述する補正処理のため、タイミングの調整を行なっているためである。
【0034】
さて、加算部704に入力された誤差データには、乗算部705によりフィードバックされた2画素前の画素kおよび直前画素mの誤差データが加算されて、乗算部705に入力される。
なお、加算部704に入力される画像データがラインの先頭に位置する画素に対応するものである場合、参照すべき画素kおよびmが存在しないので、乗算部705からの参照誤差データは“0”である。すなわち、この場合、加算部704に入力された画像データが、そのまま出力されることとなる。
また、加算部704に入力される画像データがラインの先頭から2画素目に位置する画素に対応するものである場合、直前画素mは存在するが、2画素前の画素kは存在しないので、乗算部705から出力される、2画素前の画素kに対応する誤差データは“0”である。すなわち、この場合、加算部704に入力された画像データは、直前画素mの誤差データのみが加算されて出力されることとなる。
【0035】
ここで、加算部704の加算結果について検討してみる。第1データ変換部703において図9に示したしきい値を用いて、8ビットの画像データを4ビットの画像データに変換する場合、その誤差データは、すでに説明した通り−8〜+8の範囲内に収まるが、加算部704により加算された誤差データは、この範囲内に収まらない場合がある。それは、第1データ変換部703により生成された誤差データには、注目画素xの2ライン前および直前ライン前に位置する画素a〜jの誤差データしか加味されておらず、2画素前の画素kおよび直前画素mの誤差データを加味していないためである。
いま、乗算部705から加算部704にフィードバックされる2画素前の画素kおよび直前画素mの誤差データをそれぞれ2ビットで表わして、それらの取り得る範囲を−1〜+1とする。また、第1データ変換部703から加算部704に供給される誤差データが取り得る範囲は、前述のように−8〜+8である。したがって、両者を加算した加算部104の出力が取り得る範囲は、−10〜+10となる。
【0036】
次に、このような範囲の加算結果に対し、乗算部705が、いかなる動作をするかについて図10を参照して説明する。
この図に示すように、乗算部705は、加算部704の出力に対応して、前述した機能にそれぞれにかかる信号を生成する。すなわち、乗算部705は、係数乗算前の誤差データであって、補正信号による補正を考慮した第1の誤差データと、第1の誤差データに所定のフィルタ係数および誤差係数を乗算して重み付けした第2の誤差データと、第1の誤差データに所定の誤差係数およびフィルタ係数を乗算し、1クロックだけ遅延させた第3の誤差データと、第1データ変換部103により変換された4ビットの画像データに対する補正信号と、をそれぞれ生成する。
【0037】
図10に示すように、加算部704の出力が−8〜+8の範囲にある場合、乗算部705は、特に目立った処理をせず、第1の誤差データについては、加算部704の出力そのものとし、第2の誤差データについては、加算部704の出力にフィルタ係数および誤差係数を乗算したものとし、そして、第3の補正信号については、“0”として、第1データ変換部703による出力された画像データを特に補正しない旨を指示する。
また、加算部704の出力が−10〜−9の範囲にある場合、乗算部705は、補正信号については、“−1”として、第1データ変換部703により出力された画像データの階調を1レベルだけ下げる旨を指示し、第1の誤差データについては、階調を1レベル下げた場合に対応するものに置き換え、第2の誤差データについても、置き換えた第1の誤差データにフィルタ係数および誤差係数を乗算したものとする。
一方、加算部704の出力が+9〜+10の範囲にある場合、乗算部705は、補正信号については、“+1”として、第1データ変換部703により出力された画像データの階調を1レベルだけ上げる旨を指示し、第1の誤差データについては、階調を1レベル上げた場合に対応するものに置き換え、第2の誤差データについても、置き換えた第1の誤差データにフィルタ係数および誤差係数を乗算したものとする。
【0038】
このように、乗算部705は、加算部704による加算結果が第1データ変換部703において生じ得る誤差範囲内であれば、その変換結果を補正しない旨を指示する一方、誤差範囲を上回ればあるいは下回れば、その変換結果をインクリメントあるいはデクリメントする旨の指示を行なう。これにより、第1データ変換部703により変換された4ビットの画像データは、2画素前の画素kおよび直前画素mの誤差データについても考慮されて補正を受けることなる。
また、この際、乗算部705は、加算部704による加算結果が第1データ変換部703において生じ得る誤差範囲外であれば、加算部704にフィードバックする誤差データについては、2画素前の画素kおよび直前画素mの誤差データについて考慮した結果を見込んで生成される。これにより、当該補正による誤差データの不一致が防止される。
【0039】
そして、乗算部705により生成された補正信号は、第2データ変換部707に供給される。第2データ変換部707は、第1データ変換部703により変換された画像データの階調を、補正信号が“0”であれば補正せず、“−1”であれば1レベルだけ下げ、“+1”であれば1レベルだけ上げて、最終的に、1画素4ビットの画像データとして出力する。
【0040】
なお、乗算部705における第2および第3の誤差データについて説明すると、誤差係数eは、第1実施形態と同様に、画像データに加味すべき誤差データの割合を画素毎に決定する係数であり、0〜1(0〜100%)の値を取り、誤差係数eを表わすビット数を広げれば、その分、加算すべき誤差データの割合を細かく設定することができる点も同様である。
一方、フィルタ係数Ka〜kmは、本実施形態において参照すべき12個の画素(図8参照)の誤差データについて、それぞれどのような比率で加味すべきかを決定する係数であって、これらの総和が1となるものである。
例えば、フィルタ係数を、
Ka=1/48、
Kb=3/48、
Kc=5/48、
Kd=3/48、
Ke=1/48、
Kf=3/48、
Kg=5/48、
Kh=7/48、
Ki=5/48、
Kj=3/48、
Kk=5/48、
Km=7/48
にそれぞれ設定した場合、a:b:c:d:e:f:g:h:i:j:k:m=1:3:5:3:1:3:5:7:5:3:5:7の割合で周辺画素の誤差データが加味される。
【0041】
ここで、ある注目画素xの画像データに対して実際に加算される誤差データは、これらの誤差係数eとフィルタ係数Ka〜Kmとを、各参照画素毎に誤差データに乗じた値、すなわち、e・Ka・Da〜e・Km・Dmの和であり、これが式(3)の右辺に相当する。
ただし、乗算部705は、2画素前の画素kおよび直前画素mを対象とするから(他の画素a〜jについては乗算部702が対象としている)、乗算部705では、e・Kk・Dkおよびe・Km・Dmが計算される。
なお、言うまでもなく、図10に示した第2および第3の誤差データは、一例であり、フィルタ係数あるいは誤差係数により異なる値をとる。
【0042】
次に、第2実施形態にかかる画像処理装置による階調変換処理のタイミングチャートを、図11に示す。
この図に示すように、ある特定の画素について着目した場合についてみた場合、はじめの第1クロックT1においては、入力された8ビットの画像データと乗算部702による誤差データとが加算部701により加算される。この加算結果は、F/Fにより同期化されるため、次の第2クロックT2において第1データ変換部703に入力される。
次の第2クロックT2においては、かかる加算結果が第1データ変換部703によって4ビットの画像データに変換されるとともに、その変換誤差を示す誤差データが生成される。前者の画像データは、2段のF/Fにより同期化されるため、第4クロックT4において第2データ変換部707に入力される一方、後者の誤差データは、1段のF/Fにより同期化されるため、次の第3クロックT3において加算部704に入力される。
第3クロックT3においては、第1データ変換部703による誤差データに、2画素前の画素kの誤差データと直前画素mの誤差データとが加算部704によって加算されるとともに、その加算結果が乗算部705により処理される。この結果、乗算部705においては、係数乗算前の誤差データであって、補正信号による補正を考慮した第1の誤差データと、この第1の誤差データに所定のフィルタ係数および誤差係数を乗算して重み付けした第2の誤差データと、第1の誤差データに所定の誤差係数およびフィルタ係数を乗算し、1クロックだけ遅延させた第3の誤差データと、変換された4ビットの画像データに対する補正信号とがそれぞれ生成される。ここで、第1の誤差データは、この第3クロックにおいてFIFO706aに入力されるが、第2、第3の誤差データおよび補正信号は、ともに1段のF/Fにより同期化されるため、それぞれ第4クロックT4において加算部704あるいは第2データ変換部707に入力される。
なお、第3クロックT3において、乗算部705から加算部704に入力される誤差データが“0”となるのは、注目画素の位置関係による。
そして、第4クロックT4においては、変換された4ビットの画像データを乗算部705の補正信号によって補正する処理が第2データ変換部707によって実行されて、最終的な変換結果となる4ビットの画像データが出力される。
このような処理が、第1ラインの先頭の画素から主走査方向の画素に対してクロック毎に順次行なわれ、以降、同様な処理がラインを副走査方向に順次移動させて行なわれる。
【0043】
このような第2実施形態による画像処理装置によれば、誤差データを参照する画素を拡大するフィルタを用いる場合においても、図12に示した従来の画像処理装置と同様な、画像データおよび誤差データが得られる。さらに、第1実施形態と同様に、図12において、直前画素の誤差データを処理するための加算部203→データ変換部205→乗算部204というフィードバックを、第2実施形態では、データ変換部205に相当するブロックを当該フィードバックから外に出し、加算部203および乗算部204に相当する2つにブロックのみとしたので、当該フィードバックにおける処理速度を大幅に高速化することができる(実験の結果、約2倍)。
したがって、この第2実施形態によれば、第1実施形態と同様に、処理速度あるいは画質のいずれかに制限が加わることもなく、高速かつ高画質の誤差拡散処理を行なうことができる。
【0044】
<その他>
なお、上述第1および第2実施形態にかかる画像処理装置においては、いずれも画像処理として誤差拡散法に適用した場合について説明したが、本願発明はこれに限定されるものではなく、これに類するアルゴリズムを有する処理法、すなわち、注目画素よりも上流に位置する少なくとも1つ以上の参照画素の処理結果をフィードバックして、当該注目画素の画像データを処理する画像処理法に対して広く適用可能である。
また、上述した各実施形態においては、いずれも乗算部105(205)が補正信号を生成することとしているが、本願発明において、誤差データに誤差係数やフィルタ係数を乗じる手段は必須構成要件ではなく、あくまでも任意的構成要件である。このため、誤差データに誤差係数やフィルタ係数を乗じない構成とする場合、第1実施形態においては乗算部102および105を、第2実施形態においては、乗算部702および705を、それぞれ省略することも可能である。ただし、本願発明において、補正信号を生成する手段は必須構成要件であるので、乗算部を省略する場合に、補正信号を生成する手段については、第1実施形態の加算部104あるいは第2実施形態の加算部704に負わせれば良い。
【0045】
【発明の効果】
以上説明したように、本発明によれば、画像処理にかかるクロックの高速化が可能であって、かつ、変換後の画質劣化が小さく済ますことが可能となる。
【図面の簡単な説明】
【図1】 本発明の第1実施形態にかかる画像処理装置の構成を示すブロック図である。
【図2】 同画像処理装置に用いるフィルタであって、同処理装置による誤差拡散法において参照する画素の位置関係を説明するための図である。
【図3】 階調変換前後における画像データ、しきい値および誤差データの関係を示す図である。
【図4】 同画像処理装置における第1データ変換部の変換過程を説明するための図表である。
【図5】 同画像処理装置における乗算部105により生成される信号の一例を示す図表である。
【図6】 同画像処理装置のタイミングチャートを示す図である。
【図7】 本発明の第2実施形態にかかる画像処理装置の構成を示すブロック図である。
【図8】 同画像処理装置に用いるフィルタであって、同処理装置による誤差拡散法において参照する画素の位置関係を説明するための図である。
【図9】 同画像処理装置における第1データ変換部の変換過程を説明するための図表である。
【図10】 同画像処理装置における乗算部705により生成される信号の一例を示す図表である。
【図11】 同画像処理装置のタイミングチャートを示す図である。
【図12】 従来の画像処理装置の構成を示すブロック図である。
【符号の説明】
103、703……第1データ変換部(第1のデータ処理手段、誤差生成手段、誤差データ生成手段)、
105、705……乗算部(補正信号生成手段)、
107、707……第2データ変換部(第2のデータ処理手段)[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image processing apparatus that processes image data of a target pixel with reference to a processing result of a pixel scanned before that of a certain target pixel.
[0002]
[Prior art]
In general, there is an error diffusion method as a method widely used in gradation conversion processing. Such an error diffusion method converts an image data represented by N bits of one pixel into image data represented by 1 bit of K bits (where N and K are natural numbers satisfying N> K). This is one of the processing methods aimed at distributing pixels to a predetermined ratio and minimizing image degradation, and is an effective method particularly for processing halftone image data.
Here, in the error diffusion method, when image data of a certain pixel (target pixel) is processed, pixels scanned before the pixel and several pixels located around the pixel are usually processed. Refer to error data. For example, error data for several pixels in one line immediately before the target pixel and one pixel immediately before the target pixel are referred to.
[0003]
FIG. 12 shows a general circuit configuration for executing the error diffusion method of this example. The processing circuit shown in this drawing converts N = 8, K = 4, that is, image data of 8 bits per pixel to image data of 4 bits per pixel having a lower gradation than that.
In the figure, first, image data of 8 bits per pixel relating to the pixel of interest is located at one line before the error data supplied from the
[0004]
[Problems to be solved by the invention]
Now, in such processing, if attention is paid to the error data of the immediately preceding pixel in the target pixel, the processing process is a three-stage processing block of the
For this reason, conventionally, when referring to (1) the immediately preceding pixel, the image processing clock is set to a low speed, or (2) when the image processing clock is set to the high speed, the immediately preceding pixel is not referred to.
However, in (1), of course, the time required for image processing becomes long, and in (2), a part of the algorithm is omitted, so that there is a large deterioration in image quality after conversion. .
The present invention has been made in view of the above background, and an object of the present invention is to provide an image processing apparatus capable of speeding up the clock for image processing and having little image quality deterioration after conversion. There is to do.
[0005]
[Means for Solving the Problems]
In order to solve the above-described problem, in the present invention, a processing result relating to at least one reference pixel located upstream of the target pixel is used, and the target pixel N bit indicating Image data , K-bit image data (where N and K are natural numbers such that N> K) In the image processing apparatus, the pixel of interest N bit indicating Image data Is converted to K-bit image data First data processing means and the first data processing means Based on the result of addition of error data generated by the error data generating means and error data generated by converting the image data of the reference pixel. Converted by the first data processing means Correction signal generating means for generating a correction signal for the image data; The image data converted by the first data processing means is And a second data processing means for correcting with the correction signal.
[0006]
(Function)
The conventional configuration of the image processing apparatus that processes the image data of the pixel of interest using the processing result of at least one reference pixel located upstream of the pixel of interest is the processing of the image data of the pixel of interest and the reference pixel The adding means for adding the results and the processing means for performing a predetermined process on the addition results and feeding back the processing results for the processes to the adding means. That is, there are two means in the feedback loop: the adding means and the processing means.
On the other hand, in the present invention, the first data processing unit performs predetermined processing on the image data of the target pixel to generate first data, and the correction signal generation unit performs the processing result and reference of the first data. From the pixel processing result, a correction signal for the first data is generated, and the second data processing means corrects the first data with the correction signal, so that the means existing in the feedback loop is the correction signal generating means. There is only one. Therefore, it is possible to increase the image processing speed accordingly. In addition, since the processing result of the present invention reflects the processing result of the target pixel in the image data corresponding to the pixel at the next position as in the conventional configuration, the image quality degradation in the image processing is completely reduced as in the conventional configuration. It becomes possible to suppress.
[0007]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0008]
<First Embodiment>
First, the image processing apparatus according to the first embodiment of the present invention will be described. The image processing apparatus according to the present embodiment converts image data of 8 bits per pixel (that is, image data of 256 gradations indicated by
As shown in FIG. 2, this filter is a pixel existing one line before the pixel x when processing image data of the pixel of interest x to be processed, and the position in the main scanning direction is 1 Reference is made to error data of a total of four pixels for pixels a to c before and after
These error data are weighted with a predetermined error coefficient and filter coefficient, added to the image data X of the pixel of interest x, and referred to in the conversion process.
[0009]
In the present embodiment, the error data ΔX to be added to the target pixel x is expressed by the following equation.
ΔX = e (Ka · Da + Kb · Db + Kc · Dc + Kd · Dd) (1)
In Equation (1), e is an error coefficient for the target pixel x, Da to Dd are error data before multiplication of coefficients for the pixels a to d, and Ka to Kd are error data, respectively. These are filter coefficients for Da to Dd, and the sum of these is 1.
[0010]
Further, the image data X ′ in consideration of error data at the target pixel x is expressed by the following equation.
X ′ = X + ΔX (2)
Then, by converting the 1-pixel N-bit image data X ′ obtained by the equation (2) into 1-pixel K-bit image data, it is possible to obtain image data with little image deterioration even if the gradation is lowered. It becomes possible.
[0011]
Next, the configuration of the image processing apparatus according to the present embodiment will be described with reference to FIG.
In this figure, the adding
Next, the first
That is, the
Then, the second
An F / F (flip flop) provided between the blocks is for synchronizing the data with a system clock (not shown).
[0012]
<Operation of First Embodiment>
Next, the operation according to the above-described embodiment will be described.
First, when image data of 8 bits per pixel is input, the image data is cumulatively added to the error data of the pixels a, b, and c supplied from the
Note that when the image data input to the adding
In addition, since there is no pixel a to be referred to for the first pixel of each line after the second line, only the error data of the other pixels b and c are input to the adding
[0013]
The output data of the
[0014]
Next, the first
In the present embodiment, the values that can be taken by the input image data are 8 bits, and are 0 to 255. Here, assuming that a value that can be taken by the sum of error data of pixels a, b, and c in the immediately preceding line is −6 to +6, a value that can be taken by the image data VD input to the first
Using such a threshold value, the range of −6 to +261 that the image data VD can take is divided into 16 areas, and a density value of 0 to 15 indicated by 4 bits is assigned to each area. Then, the first
Note that the error data generated by the conversion from 8 bits to 4 bits falls within the range of -8 to +8 as shown in FIG. 3, so the number of bits for that is sufficient.
In the first
[0015]
The 4-bit image data converted by the first
[0016]
The error data input to the
[0017]
Here, the addition result of the adding
Now, if the error data of the immediately preceding pixel d fed back from the
[0018]
Next, the operation of the
As shown in this figure, the
[0019]
As shown in this figure, the multiplying
On the other hand, when the output of the adding
In addition, when the output of the
[0020]
In this way, the
At this time, if the addition result by the
[0021]
Then, the correction signal generated by the
[0022]
The second error data in the
On the other hand, the filter coefficient K is a coefficient that determines at what ratio the error data of the four pixels a, b, c, and d to be referred to in the present embodiment should be considered. For example, Ka = 1 / 8. If Kb = 3/8, Kc = 1/8, and Kd = 3/8 (Ka + Kb + Kc + Kd = 1), the error of peripheral pixels is a ratio of a: b: c: d = 1: 3: 1: 3. Data is taken into account.
Here, the error data actually added to the image data of a certain pixel of interest x is a value obtained by multiplying the error data by the error coefficient e and the filter coefficient K, that is, e · Ka · Da, e · Kb · It is the sum of Db, e · Kc · Dc and e · Kd · Dd. This corresponds to the right side of Equation (1).
However, since the
Needless to say, the second error data shown in FIG. 5 is an example, and takes different values depending on the filter coefficient or the error coefficient.
[0023]
Next, FIG. 6 shows a timing chart of gradation conversion processing by the image processing apparatus according to the present embodiment.
As shown in this figure, when focusing on a specific pixel, for example, the first pixel, the first first clock T 1 In, the image data of the first pixel and the error data by the
Next second clock T 2 In, the addition result is converted into 4-bit image data by the first
3rd clock T Three , The error data from the first
The third clock T Three The error data input from the
And the fourth clock T Four , The second
Such processing is sequentially performed for each clock from the first pixel of the first line to the pixels in the main scanning direction, and thereafter, similar processing is performed by sequentially moving the line in the sub-scanning direction.
[0024]
According to the image processing apparatus according to the first embodiment, image data and error data similar to those of the conventional image processing apparatus shown in FIG. 12 can be obtained. Further, in FIG. 12, feedback of the
Therefore, as in the prior art, high-speed and high-quality error diffusion processing can be performed without any limitation on either processing speed or image quality.
[0025]
<Second Embodiment>
Next, a second embodiment of the present invention will be described. The image processing apparatus according to the present embodiment, as in the first embodiment described above, performs gradation conversion of 8-bit image data per pixel into 4-bit image data per pixel, but has expanded the reference pixels. A filter is used.
As shown in FIG. 8, when processing image data of a pixel of interest x to be processed, this filter is a pixel existing two lines before the pixel x and has coordinates in the main scanning direction. Pixels a to e after 2 pixels before and after 2 pixels, pixels existing one line before the pixel x, and pixels f to j whose coordinates in the main scanning direction are 2 pixels before and 2 pixels after, The error data of a total of 12 pixels with respect to the pixel k existing in the same line as the pixel x and the pixel k two pixels before and the pixel m one pixel before is referred to. These error data are weighted with a predetermined error coefficient and filter coefficient as in the first embodiment, and then added to the image data X of the target pixel x.
[0026]
In the present embodiment, the error data ΔX to be added to the target pixel x is expressed by the following equation.
In Equation (1), e is an error coefficient for the pixel of interest x, Da to Dm are error data before coefficient multiplication for the pixels a to m, and Ka to Km are error data, respectively. Filter coefficients for Da to Dm, and the sum of these is 1.
[0027]
Accordingly, the image data X ′ considered in the error data at the target pixel x is expressed by the following equation, similarly to the equation (2).
X ′ = X + ΔX (4)
Then, by converting the 1-pixel N-bit image data X ′ obtained by the equation (4) into 1-pixel K-bit image data, it is possible to obtain image data with little image degradation even if the gradation is lowered. It becomes possible.
[0028]
Next, the configuration of the image processing apparatus according to the present embodiment will be described with reference to FIG.
As shown in this figure, the
Next, similarly to the first
That is, the
Like the
The second
[0029]
<Operation of Second Embodiment>
Next, the operation according to the above-described embodiment will be described.
First, when image data of 8 bits per pixel is input, the image data is added to the pixels a to e before two lines and the pixels f to j before one line supplied from the
[0030]
When the filter shown in FIG. 8 is used, there is a case where there is no error to be referred to depending on the position of the target pixel, similarly to the concept of the filter shown in FIG. In such a case, the
[0031]
The output data of the
[0032]
Next, the first
In the present embodiment, the values that can be taken by the input image data are 8 bits, and are 0 to 255. Here, assuming that a value that can be taken by the sum of error data of the pixels a to e before two lines and the pixels f to j before one line is −8 to +8, the image data VD input to the first
Using such a threshold value, the range of −8 to +263 is divided into 16 areas, and a density value of 0 to 15 indicated by 4 bits is assigned to each area. At the time of conversion, a comparison is made as to which region the value of the image data belongs to, and the density value assigned to the region is used as the value of the converted image data. Since the error data generated by the conversion from 8 bits to 4 bits falls within the range of -8 to +8, "5" is sufficient for the number of bits.
In the first
[0033]
The 4-bit image data converted by the first
[0034]
Now, the error data input to the
Note that when the image data input to the
In addition, when the image data input to the adding
[0035]
Here, the addition result of the
Now, the error data of the previous pixel k and the previous pixel m fed back from the
[0036]
Next, the operation of the
As shown in this figure, the
[0037]
As shown in FIG. 10, when the output of the
When the output of the
On the other hand, when the output of the
[0038]
In this way, the
At this time, if the addition result by the
[0039]
The correction signal generated by the
[0040]
The second and third error data in the
On the other hand, the filter coefficients Ka to km are coefficients that determine what ratio should be taken into consideration for the error data of 12 pixels (see FIG. 8) to be referred to in the present embodiment, and are the sum of these. Is one.
For example, filter coefficients
Ka = 1/48,
Kb = 3/48,
Kc = 5/48,
Kd = 3/48,
Ke = 1/48,
Kf = 3/48,
Kg = 5/48,
Kh = 7/48,
Ki = 5/48,
Kj = 3/48,
Kk = 5/48,
Km = 7/48
Respectively, a: b: c: d: e: f: g: h: i: j: k: m = 1: 3: 5: 3: 1: 3: 5: 7: 5: 3: The error data of the surrounding pixels is taken into account at a ratio of 5: 7.
[0041]
Here, the error data actually added to the image data of a certain pixel of interest x is a value obtained by multiplying the error data by the error coefficient e and the filter coefficients Ka to Km for each reference pixel, that is, The sum of e · Ka · Da to e · Km · Dm corresponds to the right side of Equation (3).
However, since the
Needless to say, the second and third error data shown in FIG. 10 are merely examples, and take different values depending on the filter coefficient or the error coefficient.
[0042]
Next, FIG. 11 shows a timing chart of gradation conversion processing by the image processing apparatus according to the second embodiment.
As shown in this figure, when focusing on a specific pixel, the first first clock T 1 In, the input 8-bit image data and the error data from the
Next second clock T 2 In, the addition result is converted into 4-bit image data by the first
3rd clock T Three , The error data of the pixel k two pixels before and the error data of the immediately preceding pixel m are added to the error data by the
The third clock T Three The error data input from the
And the fourth clock T Four , The second
Such processing is sequentially performed for each clock from the first pixel of the first line to the pixels in the main scanning direction, and thereafter, similar processing is performed by sequentially moving the line in the sub-scanning direction.
[0043]
According to such an image processing apparatus according to the second embodiment, even when a filter for enlarging pixels referring to error data is used, image data and error data similar to those of the conventional image processing apparatus shown in FIG. Is obtained. Further, as in the first embodiment, in FIG. 12, feedback of the
Therefore, according to the second embodiment, similarly to the first embodiment, high-speed and high-quality error diffusion processing can be performed without any limitation on either processing speed or image quality.
[0044]
<Others>
In the image processing apparatuses according to the first and second embodiments described above, the case where both are applied to the error diffusion method as image processing has been described, but the present invention is not limited to this and is similar thereto. The present invention can be widely applied to a processing method having an algorithm, that is, an image processing method for processing the image data of the target pixel by feeding back the processing result of at least one reference pixel located upstream from the target pixel. is there.
In each of the above-described embodiments, the multiplication unit 105 (205) generates the correction signal. However, in the present invention, means for multiplying the error data by the error coefficient or the filter coefficient is not an essential component. This is an optional component. Therefore, when the error data is not multiplied by the error coefficient or the filter coefficient, the
[0045]
【The invention's effect】
As described above, according to the present invention, it is possible to increase the speed of the clock for image processing, and to reduce image quality deterioration after conversion.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an image processing apparatus according to a first embodiment of the present invention.
FIG. 2 is a diagram for explaining a positional relationship of pixels referred to in the error diffusion method by the processing device, which is a filter used in the image processing device.
FIG. 3 is a diagram illustrating a relationship among image data, threshold values, and error data before and after gradation conversion.
FIG. 4 is a chart for explaining a conversion process of a first data conversion unit in the image processing apparatus.
FIG. 5 is a chart showing an example of a signal generated by a
FIG. 6 is a timing chart of the image processing apparatus.
FIG. 7 is a block diagram showing a configuration of an image processing apparatus according to a second embodiment of the present invention.
FIG. 8 is a diagram for explaining the positional relationship of pixels referred to in the error diffusion method by the processing apparatus, which is a filter used in the image processing apparatus.
FIG. 9 is a chart for explaining a conversion process of a first data conversion unit in the image processing apparatus.
FIG. 10 is a chart showing an example of a signal generated by a
FIG. 11 is a timing chart of the image processing apparatus.
FIG. 12 is a block diagram illustrating a configuration of a conventional image processing apparatus.
[Explanation of symbols]
103, 703... First data converter (first data processing means, error generation means, error data generation means),
105, 705... Multiplying unit (correction signal generating means)
107, 707... Second data conversion unit (second data processing means)
Claims (4)
当該注目画素を示すNビットの画像データを、Kビットの画像データに変換する第1のデータ処理手段と、
前記第1のデータ処理手段による変換の際に、その誤差データを生成する誤差データ生成手段と、
前記誤差データ生成手段により生成された誤差データと前記参照画素の画像データを変換した際の誤差データとの加算結果に基づいて、前記第1のデータ処理手段により変換した画像データに対する補正信号を生成する補正信号生成手段と、
前記第1のデータ処理手段により変換した画像データを、前記補正信号により補正する第2のデータ処理手段と
を具備することを特徴とする画像処理装置。Using the processing result of at least one reference pixel located upstream of the target pixel, N-bit image data indicating the target pixel is converted into K-bit image data (where N and K are N> K is a natural number) In the image processing apparatus,
First data processing means for converting N-bit image data indicating the pixel of interest into K-bit image data;
Error data generating means for generating error data at the time of conversion by the first data processing means;
Based on the addition result of the error data generated by the error data generation means and the error data when the image data of the reference pixel is converted, a correction signal is generated for the image data converted by the first data processing means. Correction signal generating means for performing,
An image processing apparatus comprising: second data processing means for correcting the image data converted by the first data processing means with the correction signal.
前記誤差データ生成手段により生成された誤差データと前記参照画素の画像データを変換した際の誤差データとの加算結果が前記第1のデータ変換手段において生じ得る誤差範囲内であれば、前記第1のデータ処理手段により変換した画像データを補正しない旨を指示し、
前記誤差範囲を上回れば、前記第1のデータ処理手段により変換した画像データをインクリメントする旨を指示し、
前記誤差範囲を下回れば、前記第1のデータ処理手段により変換した画像データをデクリメントする旨を指示する
ことを特徴とする請求項1記載の画像処理装置。The correction signal generation unit is configured to send the correction signal to the second data conversion unit via
If the addition result of the error data generated by the error data generation means and the error data when the image data of the reference pixel is converted is within an error range that can occur in the first data conversion means, the first data conversion means Instructed not to correct the image data converted by the data processing means,
If the error range is exceeded, the image data converted by the first data processing means is instructed to be incremented,
2. The image processing apparatus according to claim 1 , wherein if it falls below the error range, the image data converted by the first data processing unit is instructed to be decremented.
ことを特徴とする請求項1記載の画像処理装置。The correction signal generation means adds the result of addition of the error data generated by the error data generation means and the error data when the image data of the reference pixel is converted to the reference pixel for the pixel located next to the target pixel. The image processing apparatus according to claim 1 , wherein feedback is performed as error data.
当該注目画素を示すNビットの画像データをKビットの画像データに変換するとともに、その変換の際の誤差データを生成する第1のステップと、A first step of converting N-bit image data indicating the pixel of interest into K-bit image data and generating error data in the conversion;
前記第1のステップにおいて生成された誤差データと前記参照画素の画像データを変換した際の誤差データとの加算結果に基づいて、前記第1のステップにおいて変換された画像データに対する補正信号を生成する第2のステップと、Based on the addition result of the error data generated in the first step and the error data when the image data of the reference pixel is converted, a correction signal for the image data converted in the first step is generated. A second step;
前記第1のステップにおいて変換された画像データを、前記補正信号により補正する第3のステップとA third step of correcting the image data converted in the first step by the correction signal;
を具備することを特徴とする画像処理方法。An image processing method comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP23331496A JP3757484B2 (en) | 1996-09-03 | 1996-09-03 | Image processing device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP23331496A JP3757484B2 (en) | 1996-09-03 | 1996-09-03 | Image processing device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH1079022A JPH1079022A (en) | 1998-03-24 |
| JP3757484B2 true JP3757484B2 (en) | 2006-03-22 |
Family
ID=16953195
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP23331496A Expired - Fee Related JP3757484B2 (en) | 1996-09-03 | 1996-09-03 | Image processing device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3757484B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2000152005A (en) | 1998-11-17 | 2000-05-30 | Toshiba Corp | Image processing device |
| JP5228929B2 (en) * | 2009-01-14 | 2013-07-03 | 株式会社ニコン | Image processing apparatus, imaging apparatus, and image processing program |
-
1996
- 1996-09-03 JP JP23331496A patent/JP3757484B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH1079022A (en) | 1998-03-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5990968A (en) | Video signal processing device for automatically adjusting phase of sampling clocks | |
| JP4455513B2 (en) | Image processing method, image processing apparatus, and image display apparatus | |
| JP2003153006A (en) | Image processing device | |
| KR20040089511A (en) | Image processor, image processing method, and recording medium on which image processing program is recorded | |
| JP2009017200A (en) | Image processing apparatus, image processing method, and program | |
| US6442294B1 (en) | Digital image processing apparatus with interpolation and adder circuits | |
| JP3757484B2 (en) | Image processing device | |
| JP3132055B2 (en) | Image processing apparatus and image processing method | |
| US7042524B2 (en) | Video data correction device and video data correction method | |
| JP2771712B2 (en) | Pixel density converter | |
| JPH0630246A (en) | Summary image generating system | |
| EP1575264B1 (en) | Image processing apparatus and image processing method | |
| US6486919B1 (en) | Apparatus and method for correcting jitter in a television system | |
| US4455611A (en) | Multiplier for multiplying n-bit number by quotient of an integer divided by an integer power of two | |
| JP3080019B2 (en) | Video signal processing device | |
| JPH10178539A (en) | Image processing unit and image processing method | |
| JP2779080B2 (en) | Gradation correction device | |
| JP2002077619A (en) | Image processing device | |
| JPH04275776A (en) | Picture reader | |
| JP2606846B2 (en) | Image signal processing device | |
| JPS6346881A (en) | Digital outline correcting circuit | |
| JP3722740B2 (en) | Video processing apparatus and video processing method | |
| JP2871323B2 (en) | Video signal processing device | |
| JP2532775B2 (en) | Electronic zoom circuit | |
| JPH0638024A (en) | Image processing device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050419 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050510 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050705 |
|
| 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: 20051206 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20051219 |
|
| 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: 20100113 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110113 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120113 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120113 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130113 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130113 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140113 Year of fee payment: 8 |
|
| LAPS | Cancellation because of no payment of annual fees |