JP2004201245A - Image processing apparatus - Google Patents
Image processing apparatus Download PDFInfo
- Publication number
- JP2004201245A JP2004201245A JP2002370684A JP2002370684A JP2004201245A JP 2004201245 A JP2004201245 A JP 2004201245A JP 2002370684 A JP2002370684 A JP 2002370684A JP 2002370684 A JP2002370684 A JP 2002370684A JP 2004201245 A JP2004201245 A JP 2004201245A
- Authority
- JP
- Japan
- Prior art keywords
- pixel
- brightness
- value
- vmax
- values
- 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.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 55
- 238000012937 correction Methods 0.000 claims description 49
- 238000006243 chemical reaction Methods 0.000 claims description 35
- 238000004364 calculation method Methods 0.000 claims description 17
- 238000000034 method Methods 0.000 description 24
- 230000008859 change Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 11
- 230000006870 function Effects 0.000 description 5
- 238000012886 linear function Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000005282 brightening Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Landscapes
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、画像処理装置に関し、特に画像に含まれる、いわゆる裏写りの部分を除去する技術の改良に関する。
【0002】
【従来の技術】
スキャナで雑誌、カタログ等に印刷された画像を読み取って画像データを生成する場合、紙厚が薄いと裏面に印刷された画像や次のページの画像が透けて、表面の画像の中に混ざってしまう、いわゆる裏写りが発生する場合がある。
このような裏写りが発生すると画像が見難くなるため、裏写りの部分を画像処理によって除去する技術が従来から提案されている。
【0003】
裏写り除去の方法として、例えば裏写りは通常、下地(用紙の地肌)部分に薄く現れることが多いため、画像を全体的に明るく補正する、具体的には各画素のR(赤)、G(緑)、B(青)の各色成分の値に所定値を加算して白色に近づける方向に補正し、下地に薄く現れた裏写りの画像を飛ばしてしまう方法がある。
また、画素の明度ヒストグラムを作成し、作成したヒストグラムから画素数が最も多い明度領域を検出し、その領域を含む近傍領域を裏写り部分を含む下地候補領域と仮定し、当該下地候補領域内の全画素のRGB各成分の値を下地、例えば白色に相当する値に置き換える方法も提案されている(特許文献1参照)。
【0004】
【特許文献1】
特開2001−313832号公報
【0005】
【発明が解決しようとする課題】
しかしながら、上記のような画像を全体的に明るくする方法では、例えば下地が白色で、部分的に黄色等のカラーのグラフや図形等を含む原稿の当該カラー領域の中に裏写りが発生しているような場合には、明るくし過ぎると白色に近づき過ぎて色合いが大きく変化してしまう。その一方で、明るさを制限すると、裏写りが残ったままになってしまう。
【0006】
また、下地候補領域を仮定する方法では、下地として仮定した領域だけについてしか適用されないため、上記のような部分的に存在する黄色等のカラー領域の中に裏写りが発生していても下地領域とされなければ裏写りは解消されない。
本発明は、このような問題点に鑑みてなされたものであって、カラー画像について効果的に裏写りを除去することが可能な画像処理装置を提供することを目的とする。
【0007】
【課題を解決するための手段】
上記目的を達成するため、本発明に係る画像処理装置は、カラー画像データを受信する受信手段と、受信したカラー画像データの画素ごとに、当該画素のR、G、B各色成分の値Vr、Vg、Vbの内の最大値Vmaxに所定値Mを加算した値が、所定の閾値Thを越える場合には、前記Vr、Vg、Vbの値を、Vr+(Th−Vmax)、Vg+(Th−Vmax)、Vb+(Th−Vmax)に補正する補正手段と、を備えることを特徴とする。
【0008】
ここで、上記「最大値Vmaxに所定値Mを加算した値が、所定の閾値Thを越える場合には、前記Vr、Vg、Vbの値を〜補正する」とは、「前記最大値Vmaxが、所定の閾値Thから所定値Mを差し引いた値を越える場合には、前記Vr、Vg、Vbの値を〜補正する」と実質的に同じ内容であり、これを含む概念である。
【0009】
また、前記補正手段は、画素毎に、当該画素のR、G、B各色成分の値Vr、Vg、Vbに加算すべき加算量を算出する加算量算出手段を備え、各画素について、前記加算量算出手段により算出された加算量を前記所定値Mとして前記Vmaxに加算することを特徴とする。
さらに、前記補正手段は、画素毎に、当該画素のR、G、B各色成分の値Vr、Vg、Vbの大きさに基づいて明度を算出する明度算出手段と、算出された各画素の明度の値から明度分布を示すヒストグラムを生成するヒストグラム生成手段と、生成されたヒストグラムの明度分布に基づいて、各画素について、その明度の値LをL′に変換する明度変換手段と、を備え、前記明度変換手段は、前記LとL′との差分が、明度が第1の値の画素より、第1の値より大きい第2の値の画素の方が大きくなるように変換し、前記加算量算出手段は、画素ごとに、前記LとL′との差分を前記加算量とすることを特徴とする。
【0010】
また、前記補正手段は、前記カラー画像データの画像を所定の領域に分割し、分割した領域毎に、当該領域内の各画素のR、G、B各色成分の値に基づいて補正に用いるべき閾値を求め、求めた閾値に基づいて各画素のR、G、B各色成分の値を補正することを特徴とする。
さらに、前記補正手段は、明度が所定値以上および彩度が所定値以下の画素については、Vr、Vg、Vb値それぞれに加算すべき(Th−Vmax)の値を所定の条件に基づいて色別に変更することを特徴とする。
【0011】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照しながら説明する。
図1は、本発明に係る画像処理装置200を含む画像処理システムの構成を示す図である。
同図に示すように、この画像処理システムは、画像入力装置100、画像処理装置200、画像記憶装置300および画像出力装置400を備えている。
【0012】
画像入力装置100は、スキャナ等の画像読み取り装置からなり、セットされた原稿の画像を読み取って、R(赤)、G(緑)、B(青)の各色成分からなる画像データを生成し、生成した画像データを画像処理装置200に送出する。
画像処理装置200は、画像入力装置100からの画像データを受信し、受信した画像データに後述の裏写り補正処理を施して、それを画像記憶装置300もしくは画像出力装置400に送出する。
【0013】
画像記憶装置300は、ハードディスク等からなり、受信した画像データを格納する。
画像出力装置400は、公知の画像形成装置からなり、受信した画像データに基づいて用紙に画像形成を行う。
図2は、画像処理装置200の構成を示すブロック図である。
【0014】
同図に示すように、画像処理装置200は、主な構成要素として、受信部201、明度算出部202、明度ヒストグラム作成部203、明度変換式作成部204、RGB色成分補正部205およびRGB色成分変換部206を備えている。受信部201は、画像入力装置100からの画像データを受信して、明度算出部202、RGB色成分補正部205およびRGB色成分変換部206に送出する。
【0015】
明度算出部202〜RGB色成分変換部206は、画像データに裏写り除去のための補正処理(裏写り補正処理)を施す補正手段として機能するものである。明度算出部202は、受信した画像データの各画素について、公知のHSLカラーモデルを用い、当該画素のR、G、B各色成分の信号から明度(Lightness)を求める。
【0016】
具体的には、R色成分の信号値を「Vr」、G色成分の信号値を「Vg」、B色成分の信号値を「Vb」としたとき、明度L=0.3Vr+0.59Vg+0.11Vb・・・(式1)とする。これは、例えば書籍「Mac版 C言語で学ぶ実践画像処理(著者 井上誠喜、八木伸行、住吉英樹 共著、発行者 株式会社オーム社、発行日 平成6年6月25日)」のP.111に記述されているように、R、G、B各色成分の信号と輝度信号Y、色差信号C1、C2との間に、Y=0.3R+0.59G+0.11B・・・(式2)、C1=R−Y=0.7R−0.59G−0.11B・・・(式3)、C2=B−Y=−0.3R−0.59G+0.89B・・・(式4)の関係があり、その場合「R」を「Vr」、「G」を「Vg」、「B」を「Vb」とし、L=Y・・・(式5)、色相H=tan-1(C1/C2)・・・(式6)、彩度S=(C12+C22)1/2・・・(式7)として表すことができることによる。
【0017】
なお、(式1)から、Vr、Vg、Vbそれぞれに、ある値(例えばX)を加えた場合の明度の変化(L→L′)を見ると、L′=0.3(Vr+X)+0.59(Vg+X)+0.11(Vb+X)=L+Xになる。すなわち、一の画素のVr、Vg、Vbそれぞれに、ある値Xを加えると、当該一の画素の明度は、その加算したXだけ上がることになる。また、式(6)からH′=H、式(7)からS′=Sになる(すなわち、Xを加算しても色相、彩度は変化しない。)ことが解る。
【0018】
明度算出部202は、各画素について求めた明度の値を示すデータを明度ヒストグラム作成部203およびRGB色成分補正部205に送出する。
明度ヒストグラム作成部203は、各画素の明度のデータから明度分布を示すヒストグラムを作成する。
図3は、作成されたヒストグラム210の内容例を示す図である。同図では、横軸が明度の値(0〜255:256段階)、縦軸が画素数を示している。なお、明度は、数値が大きくなるほど高くなる。
【0019】
同図のヒストグラム210は、下地が白色の用紙の表面に、黒色の文字が記述され、当該文字領域以外の白色領域の一部に淡い黄色のカラー領域が設けられた原稿を読み取ったときに、当該黄色領域内にその裏面側に記述された黒色文字が透けて裏写りとなって現れている画像に対し作成された場合の例を示したものである。ここで、ヒストグラム210の部分211が黒色文字部、部分212が黄色領域、部分213が下地(白色)部分、部分214が裏写り部分に対応している。
【0020】
また、黄色領域内の裏写りしていない部分212には、ここではVr=210、Vg=230、Vb=30(明度=200)の画素(以下、「画素A」という。)が含まれ、当該黄色領域内の裏写りしている部分214には、Vr=190、Vg=210、Vb=10(明度=180)の画素(以下、「画素B」という。)が含まれているものとする。
【0021】
図2に戻って、明度ヒストグラム作成部203は、作成したヒストグラム210のデータを明度変換式作成部204に送出する。
明度変換式作成部204は、明度ヒストグラム作成部203からのヒストグラムのデータに基づいて、各画素について、当該画素の明度の値LをL′に変換する場合の変換式(ここでは、一次関数)を作成する。
【0022】
明度変換式作成部204は、上記ヒストグラム210から、白色を除く最も明度が高い部分(最明部)と最も明度が低い部分(最暗部)の画素の明度を検出する。具体的には、白色を除くようにするため(その理由については、後述する。)、最大値255から所定の値、ここでは55を差し引いた値「200」から「0」の間で最も明度が高い値「Lv」と低い値「Lmin」を検出するものである。同図の例では、「Lv」が「200」、「Lmin」が「50」になる。なお、Lmin=50となるのは、画素数が所定値よりも低いものについては対象としていないためである。
【0023】
「Lv」と「Lmin」を検出すると、「Lv」が「255」に、「Lmin」が「Lmin」のままになる(変化しないようにする)一次関数の式を求める。同図の例では、Lv=200、Lmin=50であるから、変換式としては、f(L)=(41*L−550)/30・・・(式8)となる。
図4は、当該式(8)による明度の変換例を示す図である。
【0024】
同図に示すように、明度が200の画素については、変換後に255になる。また、明度が50の画素については、変換後も50のままになる。他の画素についても、同様に(式8)に従って変換される。
後述するように、本実施の形態では、裏写り除去のため、画素の明度を上げるようにしており、この(式8)は、明度を上げるための、各画素のVr、Vg、Vbに加算すべき量(加算量)Mを求める式として用いられるものである。その場合、明度が高い部分については裏写りが生じ易く、逆に明度が低い部分では裏写りが生じ難い(黒に近い部分では裏写りしていても人の目には気づかれ難い)ことから、(式8)のようにして明度の高い画素と低い画素について加算量に差を設けるようにしているのである。その際、淡い黄色等の比較的明度が高い、ここでは「200」のカラー部分の裏写りを効果的に除去できるように、明度200の画素について、その明度が上限の「255」に変換されるように変換式を作成している。
【0025】
図2に戻って、明度変換式作成部204は、求めた(式8)を示すデータをRGB色成分補正部205に送出する。
RGB色成分補正部205は、受信部201からの画像データを受信して、一の画素を注目画素とし、当該注目画素の明度の値Lを上記(式8)を用いてL′に変換し、その差分(L′−L)を当該注目画素に対する加算量Mとする。この意味では、RGB色成分補正部205は、加算量を算出する加算量算出手段としての機能を有することになる。
【0026】
例えば、注目画素が上記画素Aの場合、Vr=210、Vg=230、Vb=30、明度L=200なので、f(200)=255、L′=255、L=200になり、加算量Mは(255−200)=55になる(図4のMaに相当)。一方、注目画素が上記画素Bの場合、Vr=190、Vg=210、Vb=10、明度L=180なので、f(180)=227になり、加算量Mは(227−180)=47になる(図4のMbに相当)。
【0027】
RGB色成分補正部205は、注目画素のVr、Vg、Vbの内の最大値Vmaxを求め、そのVmaxに加算量Mを加える。そして、その(Vmax+M)の値が閾値「255」を越える場合には、Vr+M、Vg+M、Vb+Mの値から、255を越えた量(Vmax+M−255)をそれぞれ差し引いた値Vr′、Vg′、Vb′を補正後の値として求める。
【0028】
以下、注目画素を画素A、Bとしたときの当該処理の内容を、図5を参照しながら説明する。ここで、図5(a)は、画素A、Bにおける補正前のVr、Vg、Vbの値を示している。
まず、RGB色成分補正部205は、画素A、Bについて最大値Vmaxを求める。画素Aでは、Vmax=230、画素Bでは、Vmax=210になる。
【0029】
そして、求めたVmaxに加算量Mを加える。画素Aの場合、Vmax+Ma=285になる。画素Bの場合、Vmax+Mb=257になる。
それぞれが閾値「255」を越えるので、画素Aについては、RGB各成分の値をVr+Ma、Vg+Ma、Vb+Maとして(図5(b))、Vr+Ma、Vg+Ma、Vb+Maそれぞれから、(Vmax+Ma)の値が閾値「255」を越えた量(図5(c)の斜線部に相当)を差し引き(図5(d))、その値を補正後のVr′、Vg′、Vb′とする。すなわち図5(c)の網点で示す部分が補正量に相当することになる。
【0030】
具体的には、Vr+Ma=265、Vg+Ma=285、Vb+Ma=85になる。そして、(Vmax+Ma)の値が閾値「255」を越えた量は、285−255=30になるから、Vr′=265−30=235、Vg′=285−30=255、Vb′=85−30=55になる。
一方、画素Bについては、画素Aの場合同様に、Vr+Mb、Vg+Mb、Vb+Mbとして(図5(b))、それぞれから(Vmax+Mb)の値が閾値「255」を越えた量(図5(c)の斜線部)を差し引く(図5(d))。
【0031】
具体的には、Vr+Mb=237、Vg+Mb=257、Vb+Mb=57になる。そして、(Vmax+Mb)の値が閾値「255」を越えた量は、257−255=2になるから、Vr′=237−2=235、Vg′=257−2=255、Vb′=57−2=55になる。
図5(d)に示すように、補正後のRGB各色成分の値は、画素A、B共、等しくなっている。このことは、裏写り部分の画素と裏写りしていない部分の画素の明度、色相、彩度が同一、すなわち同一色であることを意味しており、裏写りしていない部分と裏写りしている部分の色の差がほぼなくなることから、裏写りが解消されることになる。なお、RGB各色成分の値Vr、Vg、Vbに同一の値を加えると、明度が高くなるが、色相、彩度の値は変化しないことは、上記(式1)〜(式6)より明らかである。また、裏写りしていない部分の明度も高くなるが、色合いが変化しなければ人の目には逆にコントラストが上がったように見え、画像全体としてはより見やすくなることになる。
【0032】
一方、図5(e)は、従来の方法を示す図であり、上限である閾値「255」を越えた量を単に差し引いただけのため、画素A、Bについて、補正後のRGB各色成分の値が全く異なり、補正前よりも色合いが変わってしまい、裏写りも解消されないことが解る。
上記の処理は、結果的に、Vr′=Vr+(255−Vmax)、Vg′=Vg+(255−Vmax)、Vb′=Vb+(255−Vmax)・・・(式9)として現すことができる。
【0033】
RGB色成分補正部205は、注目画素を順次変えていきながら全画素について上記した処理を実行することにより、各画素について当該画素のVr′、Vg′、Vb′を求めて行く。
例えば、白色部分213(図3)に含まれる画素として、Vr=「240」、Vg=「240」、Vb=「240」(明度=240)の画素を注目画素とした場合には、f(240)=310であるから、加算量Mは(310−240)=70になり、最大値Vmaxは「240」になる。(Vmax+M)の値が255を越え、(式9)より、Vr′=255、Vg′=255、Vb′=255になる。この場合、当該画素はより白色に近い色になる。
【0034】
また、黒色文字部分211に含まれる画素として、Vr=「50」、Vg=「50」、Vb=「50」(明度=50)の画素を注目画素とした場合には、f(50)=50であるから、加算量Mは(50−50)=0になり、最大値Vmaxは「50」になる。この場合、(Vmax+M)の値が255を越えないため、Vr′=Vr+M、Vg′=Vg+M、Vb′=Vb+M・・・(式10)とする。ここでは、Vr′=「50」、Vg′=「50」、Vb′=「50」になり、補正しても明度は変化しない。
【0035】
このことは、例えばVr=「100」、Vg=「100」、Vb=「100」(明度=100)の画素を注目画素とした場合にも同じことがいえる。この場合、f(100)=118、加算量Mは(118−100)=18になり、最大値Vmaxは「100」になる。(Vmax+M)の値が255を越えないため、(式10)より、Vr′=「118」、Vg′=「118」、Vb′=「118」になる。補正により明度がやや上がるが、大きく変化することはない。なお、明度50以下の画素については、加算量Mを一律に「0」としており、したがって、Vr′=Vr、Vg′=Vg、Vb′=Vbになる。
【0036】
このように明度が高い部分については、裏写り発生の可能性が高いため、加算量を大きくとってより明るめに補正して裏写りの解消を図り、一方で明度が低い部分については、裏写り自体が起こり難く、かつ黒色等の明度の低い画像の明度を上げると人の目にはくすんだ色に見えるため、明度が低くなるに連れて加算量を減らすようにしているので、コントラストを向上させることができる。なお、上記式(8)は、Lv=200、Lmin=50の場合の例によるものであり、Lv、Lminの値が変わると(すなわち、原稿画像が異なると)、当然に変換式も変わることはいうまでもない。
【0037】
図2に戻って、RGB色成分補正部205は、算出した各画素のVr′、Vg′、Vb′を示すデータを、RGB色成分変換部206に送出する。
RGB色成分変換部206は、受信部201からの画像データを受信して、画素ごとに、当該画素のVr、Vg、Vbの値を、RGB色成分補正部205から送信されて来る当該画素の補正後のVr′、Vg′、Vb′の値に変換して行き、変換後の各画素のVr′、Vg′、Vb′の値を示すデータを補正後の画像データとして、画像記憶装置300および/または画像出力装置400に送出する。
【0038】
図6は、画像処理装置200において実行される裏写り補正処理の内容を示すフローチャートである。
まず、画像処理装置200は、外部、ここでは画像入力装置100からRGB各色成分を含む画像データを受信すると(ステップS1)、各画素について、その明度を求める(ステップS2)。明度の算出には、上記(式1)が用いられる。
【0039】
算出した各画素の明度のデータに基づいて、明度ヒストグラム(図3)を生成し(ステップS3)、生成した明度ヒストグラムから最明度「Lv」、最暗度「Lmin」を検出し(ステップS4)、検出した「Lv」、「Lmin」の値に基づいて明度変換式f(L)を生成する(ステップS5)。ここでは、上記したように、「Lv」が「255」、「Lmin」がそのままの値になる一次変換式を求める。
【0040】
そして、一の画素を注目画素として、当該注目画素の明度の値Lを、上記明度変換式を用いてL′に変換し(ステップS6)、その差分(L′−L)の値Mを求めた後(ステップS7)、上記注目画素のVr、Vg、Vbの内の最大値Vmaxを求める(ステップS8)。
Vmax+M>255であることを判断すると(ステップS9で「YES」)、上記(式9)を用いてVr′、Vg′、Vb′を求め(ステップS10)、ステップS11に移る。
【0041】
一方、ステップS9で、Vmax+M>255でない、すなわちVmax+M≦255であることを判断すると(ステップS9で「NO」)、上記(式10)を用いてVr′、Vg′、Vb′を求め(ステップS12)、ステップS11に移る。
ステップS11では、上記注目画素のRGB各色成分の値Vr、Vg、Vbを、上記算出したVr′、Vg′、Vb′に変換し、ステップS13に移る。
【0042】
ステップS13では、全画素について、Vr′、Vg′、Vb′の算出が終了しているか否かを判断し、終了していないことを判断すると(ステップS13で「NO」)、ステップS8に戻り、補正していない画素を注目画素として、ステップS8〜S12までの処理を実行する。
ステップS13において、全画素についての処理が終了したと判断されるまで、上記処理を繰り返し実行し、全画素についての処理が終了したことを判断すると(ステップS13で「YES」)、当該処理を終了する。
【0043】
以上説明したように、本発明に係る画像処理装置は、各画素について、補正前と補正後においてRGBの値の差分を一定にしたまま、すなわちVr−Vg=Vr′−Vg′、Vr−Vb=Vr′−Vb′の関係を保ちながら、裏写り発生の可能性が高い、明度が高い部分の画像をより明るくなるように補正するため、上記黄色等の明度が比較的高い領域に現れる裏写りを色合いを変化させることなく除去することが可能になる。また、明度が低い部分については、そもそも暗い画像であるから裏写り自体が起こり難く、かつ黒色等の明度の低い画像の明度を上げ過ぎると人の目にはくすんだ色に見えるため、明度が低くなるに連れてその画像への補正量を減らすようにしているので、コントラストを向上させることができる。そして、従来のような下地候補領域を仮定するといったことを行わないので、部分的なカラー画像領域内に生じる裏写りに対応できるという効果を奏する。
【0044】
なお、本発明は、上記画像処理装置に限られず、上記した裏写り処理の方法、当該方法をコンピュータにより実現するプログラムに適用することもできる。
そのプログラムとしては、例えば「カラー画像データを受信する受信処理と、受信したカラー画像データの画素ごとに、当該画素のR、G、B各色成分の値Vr、Vg、Vbの内の最大値Vmaxに所定値Mを加算した値が、所定の閾値Thを越える場合には、前記Vr、Vg、Vbの値を、Vr+(Th−Vmax)、Vg+(Th−Vmax)、Vb+(Th−Vmax)に補正する補正処理と、をコンピュータに実行させるためのプログラム。」とすることができる。
【0045】
また、当該プログラムは、例えば磁気テープ、フレキシブルディスク等の磁気ディスク、DVD、CD−ROM、CD−R、MO、PDなどの光記録媒体、Smart Media(登録商標)などのフラッシュメモリ系記録媒体等、コンピュータ読み取り可能な各種記録媒体に記録することが可能であり、当該記録媒体の形態で生産、譲渡等がなされる場合もあるし、プログラムの形態でインターネットを含む有線、無線の各種ネットワーク、放送、電気通信回線、衛星通信等を介して伝送、供給される場合もある。
【0046】
また、当該プログラムは、上記に説明した処理をコンピュータに実行させるための全てのモジュールを含んでいる必要はなく、例えば通信プログラムやオペレーティングシステム(OS)に含まれるプログラムなど、別途情報処理装置にインストールすることができる各種汎用的なプログラムを利用することにより、本発明の各処理をコンピュータに実行させるようにしても良い。従って、上記した記録媒体に必ずしも上記全てのモジュールを記録している必要はないし、また必ずしも全てのモジュールを伝送する必要もない。
【0047】
(変形例)
以上、本発明を実施の形態に基づいて説明してきたが、本発明は、上述の実施の形態に限定されないのは勿論であり、以下のような変形例が考えられる。
(1)上記実施の形態では、各画素のRGB各色成分の値に加算する加算量Mを求める式として、「Lv」が「255」に、「Lmin」が「Lmin」になる一次関数の式を用いたが、これに限られず、例えばγ曲線等の非線形のものを用いることもできる。γ曲線を用いれば、例えば明度100を境にして、100以上の画素については、加算量を大きくし、100よりも下の画素については、小さくするといったこともでき、コントラストのさらなる向上を図ることも可能になる。また、段階的に加算量が増えていくように階段状とすることも可能である。
【0048】
さらに、上記実施の形態では、ヒストグラム210による最明部の明度「Lv」の値を求める際、強制的に白色の画素を除くようにしたが、そのような処理を行わずに変換式を作成するとしても良い。その場合、上記ヒストグラム210の例では、Lvが245程度(画素数が所定数に満たないものは対象外とするため)になる。
【0049】
(2)また、上記実施の形態では、明度変換式をヒストグラムから求めるようにしたが、例えばユーザが明度変換式を任意に変更可能に構成することもできる。例えば、一次関数の場合、直線の傾き等、γ曲線の場合、曲線の曲がり具合等を変更可能に構成することが考えられる。変換式を変更できるということは、加算量M、ひいては補正量を調整できることと同じであるため、ユーザは、裏写りの程度、コントラストの具合を見ながら希望する画像に補正することが可能になる。なお、このようにする場合、ユーザからの変更入力を受け付けるための、受け付け手段として機能する操作部を備え、受け付けた内容に基づいて変換式を変更するようにすれば良い。
【0050】
(3)さらに、明度変換式を用いることなく、各画素に対する加算量Mを一律に所定値とすることも可能である。すなわち、予め加算量(例えば、50)を示すデータを記憶させておき、裏写り補正処理時に当該データを読み出して各画素に一律に加算して、上記ステップS8以降の処理を行うものである。
このようにすると、ヒストグラムを作成する必要がなくなり、その分、処理を簡素化できると共に全体の処理に要する時間を短縮することが可能になる。なお、黒色等の明度が低い画素についても一律に同一の値がRGB各色成分に加算されることになるため、黒色等が多少くすむようになることは否めないが、カラーのグラフが大部分を占めるグラフ原稿等を対象にする場合には効果的である。例えば、上記実施の形態の処理と、当該変形例の処理をユーザが選択できるように構成することも可能である。さらに、当該変形例の処理を実行する場合、画像処理装置としては、RGB色成分補正部205とRGB色成分変換部206に加えて、上記固定値を記憶しておく記憶手段を備えれば良く、明度算出部202、明度ヒストグラム作成部203および明度変換式作成部204が不要になり、その分、全体の構成を簡素化できる。
【0051】
また、ユーザが上記所定値を変更可能(例えば、初期設定値が50になっており、0〜100の範囲で変更可能等)に構成すれば、ユーザは実質的に補正量を自身の希望する量に調整することが可能になる。
(4)上記実施の形態では、(Vmax+M)の値が255を越える場合には、一律にV′=V+(255−Vmax)としたが、所定の条件を満たす画素についてはこれを適用せず、次の処理を行うこともできる。
【0052】
すなわち、明度が極めて高く、彩度が極めて低い画素、具体的には白色もしくは白色に極めて近い色の画素のRGB各色成分の値が、スキャナでの読み取り時のノイズ等の影響を受けて、本来の値、例えばVr=240、Vg=240、Vb=240であるところVbだけが230になってしまったような場合には、実施の形態の例による裏写り補正処理を施すと、Vr′=255、Vg′=255、Vb′=245になり、元の色との間に大変微小ではあるが差が生じる恐れがある。そこで、所定の条件として、明度が所定値、例えば220以上であり、彩度が所定値、例えば20以下になる画素については、Vr′=Vr+M、Vg′=Vg+M、Vb′=Vb+Mとし、値が「255」を超える場合には一律に「255」とするものである。これは、明度、彩度の値に応じて補正量(255−Vmax)を色別に変更することと同じであり、その意味で補正量を修正する機能を有することになる。
【0053】
上記の画素(Vr=240、Vg=240、Vb=230)の例の場合、明度「238」、上記(式7)より彩度「8」になるので、上記所定の条件を満たすことになる。この場合、M=69、Vr′=255、Vg′=255、Vb′=255になり、当該画素はノイズの影響を排除され、結果的に白色相当の値に補正されることになる。上記所定値は、ノイズ等による影響を排除できるように実験等から求めることができる。
【0054】
また、(Vmax+M)の値が閾値255を越えた場合に、Vr+M、Vg+M、Vb+Mの各値から差し引く量を彩度の値に応じて変えるようにすることもできる。具体的には、Vr′=(Vr+M)−k(Vmax+M−255)、Vg′=(Vg+M)−k(Vmax+M−255)、Vb′=(Vb+M)−k(Vmax+M−255)、ただし0≦k≦1、係数kは彩度Sとの関係において、例えば図7に示す非線形の関数として現すことができる。
【0055】
ここで、k=1とすると上記実施の形態の構成になる。上記例の場合では、図7より彩度「8」に対し「k」がほぼ「0.25」になるので、Vr′=296、Vg′=296、Vb′=288になり、いずれも「255」を超えるので、Vr′=Vg′=Vb′=255になる。彩度Sと係数kの関係式は、図7に示すような非線形のものに限られず、例えば線形としても良く、要するに上記ノイズ等による影響を効率よく排除できるように実験等から最適な式を決めれば良い。
【0056】
(5)上記実施の形態では、閾値を一律に「255」としたが、画像に応じて閾値を変えるようにすることもできる。すなわち、上記実施の形態では、淡い黄色領域よりも明度が低い、例えば緑色領域にも裏写りが発生しているような場合に、その緑色領域の画素に裏写り補正処理を施しても(Vmax+M)の値が255を越えず、裏写りが残ってしまう場合も生じ得る。上記したように、明度が低い部分に裏写りが生じていても人の目には見え難いのであるが、そのような裏写りをも除去する方法として、ヒストグラムから明度が低い、例えば150程度の画素が多く存在することを検出すると、その部分について閾値を、例えば200に変えて補正処理を行うような構成にすれば、その部分の裏写りをも除去することが可能になる。どの明度の画素に対しどの閾値を用いるかを実験等から予め決めておけば実現できる。
【0057】
また、一枚の原稿の画像を複数の領域に分割し、各領域ごとに閾値を変える処理を行うようにすることもできる。その場合、例えば、領域毎に各画素の最大明度の値を閾値としたり、各画素のRGB各色成分の内の最大値を閾値とすることもできる。すなわち、領域毎に、各画素のRGB各色成分の値に基づいて、補正に用いるべき閾値を求め、求めた閾値を用いて上記の補正処理を実行すれば良い。なお、領域分割の方法としては、矩形に等分割しても良いし、色相や彩度が近い画素をまとめる方法等が考えられる。
【0058】
【発明の効果】
以上説明したように、本発明に係る画像処理装置は、カラー画像データを受信する受信手段と、受信したカラー画像データの画素ごとに、当該画素のR、G、B各色成分の値Vr、Vg、Vbの内の最大値Vmaxに所定値Mを加算した値が、所定の閾値Thを越える場合には、前記Vr、Vg、Vbの値を、Vr+(Th−Vmax)、Vg+(Th−Vmax)、Vb+(Th−Vmax)に補正する補正手段とを備えている。
【0059】
これにより、裏写りしている部分の画像の色合いを変化させることなく裏写りを除去することが可能になる。また、従来のような下地候補領域を仮定するといったことを行わないので、部分的なカラー画像領域内に生じる裏写りにも対応できる。
また、画素毎に、当該画素のR、G、B各色成分の値Vr、Vg、Vbに加算すべき加算量を算出する加算量算出手段を備え、各画素について、前記加算量算出手段により算出された加算量を前記所定値Mとして前記Vmaxに加算するようにしている。
【0060】
これにより、各画素について加算量が算出されるので、画像に応じた適切な裏写りの除去処理を実行できる。
さらに、画素毎に、当該画素のR、G、B各色成分の値Vr、Vg、Vbの大きさに基づいて明度を算出する明度算出手段と、算出された各画素の明度の値から明度分布を示すヒストグラムを生成するヒストグラム生成手段と、生成されたヒストグラムの明度分布に基づいて、各画素について、その明度の値LをL′に変換する明度変換手段と、を備え、前記明度変換手段は、前記LとL′との差分が、明度が第1の値の画素より、第1の値より大きい第2の値の画素の方が大きくなるように変換し、前記加算量算出手段は、画素ごとに、前記LとL′との差分を前記加算量としている。
【0061】
これにより、明度が高い部分については、加算量が多くなり、より明るくなるように補正されるため、例えば淡い黄色等の明度が高い領域に現れる裏写りを色合いを変化させることなく除去することが可能になる。また、明度が低い部分については、加算量を少なくなるようにしているので、全体のコントラストを向上させることができる。
【0062】
また、前記カラー画像データの画像を所定の領域に分割し、分割した領域毎に、当該領域内の各画素のR、G、B各色成分の値に基づいて補正に用いるべき閾値を求め、求めた閾値に基づいて各画素のR、G、B各色成分の値を補正するようにしている。
これにより、領域毎に裏写り補正を行うことができるので、例えば明暗の差が大きいような画像の場合、明度が高い部分と低い部分で別に処理を実行することが可能になり、明度が低い部分に生じている裏写りも効果的に除去できるようになる。
【0063】
また、明度が所定値以上および彩度が所定値以下の画素については、Vr、Vg、Vb値それぞれに加算すべき(Th−Vmax)の値を所定の条件に基づいて色別に変更するようにしている。
これにより、例えば、スキャナ等の読み取り時にノイズ等の影響を受けたため本来白色の画素であるところ微小ではあるが彩度成分が加わってしまったような場合でも、その影響を排除して例えば白色相当に補正することが可能になる。
【図面の簡単な説明】
【図1】画像処理装置200を含むシステムの構成を示す図である。
【図2】画像処理装置200の構成を示すブロック図である。
【図3】作成されたヒストグラム210の内容例を示す図である。
【図4】明度変換の例を示す図である。
【図5】画素A、Bに対する裏写り補正の内容を図解した模式図である。
【図6】画像処理装置200において実行される裏写り補正処理の内容を示すフローチャートである。
【図7】変形例の裏写り補正における係数kと彩度Sの関係を示す図である。
【符号の説明】
200 画像処理装置
201 受信部
202 明度算出部
203 明度ヒストグラム作成部
204 明度変換式作成部
205 RGB色成分補正部
206 RGB色成分変換部
210 ヒストグラム[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image processing apparatus, and more particularly to an improvement in a technique for removing a so-called show-through portion included in an image.
[0002]
[Prior art]
When image data is generated by reading images printed on magazines, catalogs, etc. with a scanner, if the paper thickness is thin, the image printed on the back side or the image of the next page will be transparent and will be mixed into the image on the front side That is, so-called show-through may occur.
When such show-through occurs, the image becomes difficult to see. Therefore, techniques for removing the show-through portion by image processing have been conventionally proposed.
[0003]
As a method of removing show-through, for example, show-through often appears lightly on the background (background of paper), so that the entire image is corrected to be brighter, specifically, R (red), G of each pixel. There is a method in which a predetermined value is added to the value of each color component of (green) and B (blue) to correct in a direction approaching white, thereby skipping a show-through image that appears faintly on the background.
Further, a brightness histogram of pixels is created, a brightness region having the largest number of pixels is detected from the created histogram, and a nearby region including the region is assumed to be a background candidate region including a show-through portion. A method has also been proposed in which the values of RGB components of all pixels are replaced with a background, for example, a value corresponding to white (see Patent Document 1).
[0004]
[Patent Document 1]
JP 2001-313832 A
[0005]
[Problems to be solved by the invention]
However, in the method of brightening the entire image as described above, for example, show-through occurs in the color area of the document including a graph or a graphic of a color such as a partially yellow background and white. In such a case, if the brightness is too high, the color becomes too close to white and the color is greatly changed. On the other hand, if the brightness is limited, show-through remains.
[0006]
Further, since the method of assuming the background candidate region is applied only to the region assumed as the background, even if show-through occurs in the partially existing color region such as yellow as described above, the background region is not affected. If not, show-through will not be resolved.
The present invention has been made in view of such a problem, and has as its object to provide an image processing apparatus capable of effectively removing show-through from a color image.
[0007]
[Means for Solving the Problems]
In order to achieve the above object, an image processing apparatus according to the present invention includes a receiving unit that receives color image data, and for each pixel of the received color image data, a value Vr of each of the R, G, and B color components of the pixel. If the value obtained by adding the predetermined value M to the maximum value Vmax of Vg and Vb exceeds a predetermined threshold value Th, the values of Vr, Vg and Vb are changed to Vr + (Th−Vmax) and Vg + (Th− Vmax) and Vb + (Th−Vmax).
[0008]
Here, "when the value obtained by adding the predetermined value M to the maximum value Vmax exceeds the predetermined threshold value Th, the values of Vr, Vg, and Vb are corrected by ~" means that "the maximum value Vmax is If the value exceeds a value obtained by subtracting a predetermined value M from a predetermined threshold value Th, the values of Vr, Vg, and Vb are corrected to "", and the concept includes this.
[0009]
The correction means includes, for each pixel, an addition amount calculation means for calculating an addition amount to be added to the values Vr, Vg, and Vb of the R, G, and B color components of the pixel. The addition amount calculated by the amount calculation means is added to the Vmax as the predetermined value M.
Further, the correcting means calculates, for each pixel, lightness based on the magnitudes of the values Vr, Vg, Vb of the R, G, B color components of the pixel, and the calculated lightness of each pixel. And a brightness conversion means for converting a brightness value L into L ′ for each pixel based on the brightness distribution of the generated histogram, The brightness conversion means converts the difference between L and L 'so that a pixel having a second value larger than the first value has a larger brightness than a pixel having the first value. The amount calculation means sets the difference between L and L 'for each pixel as the addition amount.
[0010]
Further, the correction means should divide the image of the color image data into predetermined regions, and use the divided regions for correction based on the R, G, and B color component values of each pixel in the region. It is characterized in that a threshold value is obtained, and the values of the R, G, and B color components of each pixel are corrected based on the obtained threshold value.
In addition, the correction means sets a value of (Th-Vmax) to be added to each of the Vr, Vg, and Vb values for a pixel whose lightness is equal to or more than a predetermined value and equals or less than a predetermined value based on a predetermined condition. It is characterized by being changed separately.
[0011]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a diagram showing a configuration of an image processing system including an
As shown in FIG. 1, the image processing system includes an
[0012]
The
The
[0013]
The
The
FIG. 2 is a block diagram illustrating a configuration of the
[0014]
As shown in the figure, the
[0015]
The
[0016]
Specifically, when the signal value of the R color component is “Vr”, the signal value of the G color component is “Vg”, and the signal value of the B color component is “Vb”, the lightness L = 0.3Vr + 0.59Vg + 0. 11Vb (Equation 1). This is described, for example, in the book "Practical Image Processing Learned in the C Language for Mac" (author Seiki Inoue, Nobuyuki Yagi, Hideki Sumiyoshi, publisher Ohmsha, published on June 25, 1994). As described in 111, Y = 0.3R + 0.59G + 0.11B (Equation 2) between the signals of the R, G, and B color components and the luminance signal Y and the color difference signals C1, C2. C1 = RY = 0.7R-0.59G-0.11B (Equation 3), C2 = BY = -0.3R-0.59G + 0.89B (Equation 4) In this case, “R” is “Vr”, “G” is “Vg”, “B” is “Vb”, L = Y (Equation 5), hue H = tan -1 (C1 / C2) (Equation 6), saturation S = (C1 Two + C2 Two ) 1/2 (Expression 7)
[0017]
From (Equation 1), when a change in lightness (L → L ′) when a certain value (for example, X) is added to each of Vr, Vg, and Vb, L ′ = 0.3 (Vr + X) +0 .59 (Vg + X) +0.11 (Vb + X) = L + X. That is, when a certain value X is added to each of Vr, Vg, and Vb of one pixel, the brightness of the one pixel increases by the added X. Further, it can be seen that H ′ = H from equation (6) and S ′ = S from equation (7) (that is, hue and saturation do not change even if X is added).
[0018]
The
The brightness
FIG. 3 is a diagram showing an example of the contents of the created
[0019]
The
[0020]
In addition, the non-show-through
[0021]
Returning to FIG. 2, the brightness
The brightness conversion
[0022]
The brightness conversion
[0023]
When “Lv” and “Lmin” are detected, an equation of a linear function in which “Lv” remains at “255” and “Lmin” remains at “Lmin” (does not change) is obtained. In the example shown in the drawing, since Lv = 200 and Lmin = 50, the conversion formula is f (L) = (41 * L−550) / 30 (Equation 8).
FIG. 4 is a diagram showing an example of brightness conversion by the expression (8).
[0024]
As shown in the drawing, a pixel having a brightness of 200 becomes 255 after conversion. Further, a pixel having a brightness of 50 remains at 50 even after the conversion. The other pixels are similarly converted according to (Equation 8).
As described later, in the present embodiment, the brightness of a pixel is increased in order to remove show-through, and this (Equation 8) is added to Vr, Vg, and Vb of each pixel to increase the brightness. This is used as an equation for calculating the amount to be added (addition amount) M. In such a case, show-through is likely to occur in a portion with high brightness, and conversely, show-through is unlikely to occur in a portion with low brightness (it is difficult for the human eye to notice the show-through in a portion close to black) , (Equation 8), the difference is provided in the addition amount between the high brightness pixel and the low brightness pixel. At this time, in order to effectively remove show-through of a color portion of relatively high brightness, such as pale yellow, here, “200”, the brightness of the pixel of
[0025]
Returning to FIG. 2, the brightness conversion
The RGB color
[0026]
For example, when the pixel of interest is the pixel A, Vr = 210, Vg = 230, Vb = 30, and lightness L = 200, so that f (200) = 255, L ′ = 255, L = 200, and the addition amount M Becomes (255-200) = 55 (corresponding to Ma in FIG. 4). On the other hand, when the target pixel is the pixel B, Vr = 190, Vg = 210, Vb = 10, and lightness L = 180, so that f (180) = 227, and the addition amount M becomes (227−180) = 47. (Corresponding to Mb in FIG. 4).
[0027]
The RGB color
[0028]
Hereinafter, the content of the processing when the target pixel is the pixels A and B will be described with reference to FIG. Here, FIG. 5A shows the values of Vr, Vg, and Vb in the pixels A and B before correction.
First, the RGB color
[0029]
Then, the addition amount M is added to the obtained Vmax. In the case of the pixel A, Vmax + Ma = 285. In the case of the pixel B, Vmax + Mb = 257.
Since each of them exceeds the threshold value “255”, for the pixel A, the values of the RGB components are set to Vr + Ma, Vg + Ma, and Vb + Ma (FIG. 5B). The amount exceeding “255” (corresponding to the hatched portion in FIG. 5C) is subtracted (FIG. 5D), and the values are used as corrected Vr ′, Vg ′, and Vb ′. That is, the portion indicated by the halftone dot in FIG. 5C corresponds to the correction amount.
[0030]
Specifically, Vr + Ma = 265, Vg + Ma = 285, and Vb + Ma = 85. Then, the amount by which the value of (Vmax + Ma) exceeds the threshold value "255" becomes 285-255 = 30, so that Vr '= 265-30 = 235, Vg' = 285-30 = 255, Vb '= 85- 30 = 55.
On the other hand, for the pixel B, similarly to the case of the pixel A, Vr + Mb, Vg + Mb, and Vb + Mb (FIG. 5B), and the amount of the value of (Vmax + Mb) exceeding the threshold “255” (FIG. 5C) Is subtracted (FIG. 5D).
[0031]
Specifically, Vr + Mb = 237, Vg + Mb = 257, and Vb + Mb = 57. Then, the amount by which the value of (Vmax + Mb) exceeds the threshold value "255" is 257-255 = 2, so that Vr '= 237-2 = 235, Vg' = 257-2 = 255, Vb '= 57- 2 = 55.
As shown in FIG. 5D, the values of the RGB color components after correction are the same for both the pixels A and B. This means that the lightness, hue, and saturation of the pixels in the unshown part and the pixels in the unshown part are the same, that is, the same color. Since there is almost no difference in color between the portions, the show-through is eliminated. It should be noted from the above (Equation 1) to (Equation 6) that when the same value is added to the values Vr, Vg, Vb of the respective RGB color components, the lightness increases, but the hue and saturation values do not change. It is. In addition, although the brightness of the part that is not shown off increases, if the hue does not change, the contrast appears to the contrary to the human eyes, and the image as a whole becomes easier to see.
[0032]
On the other hand, FIG. 5E is a diagram showing a conventional method, in which only the amount exceeding a threshold value “255”, which is the upper limit, is simply subtracted. It can be seen that the values are completely different, the color tone is changed more than before correction, and show-through is not eliminated.
As a result, the above processing can be expressed as Vr '= Vr + (255-Vmax), Vg' = Vg + (255-Vmax), Vb '= Vb + (255-Vmax) (Equation 9). .
[0033]
The RGB color
For example, as a pixel included in the white portion 213 (FIG. 3), when a pixel of Vr = “240”, Vg = “240”, and Vb = “240” (lightness = 240) is set as a target pixel, f ( 240) = 310, the addition amount M becomes (310-240) = 70, and the maximum value Vmax becomes “240”. The value of (Vmax + M) exceeds 255, and according to (Equation 9), Vr ′ = 255, Vg ′ = 255, and Vb ′ = 255. In this case, the pixel has a color closer to white.
[0034]
Also, assuming that pixels of Vr = “50”, Vg = “50”, and Vb = “50” (lightness = 50) are pixels of interest included in the
[0035]
The same can be said for the case where the pixel of Vr = “100”, Vg = “100”, and Vb = “100” (lightness = 100) is set as the target pixel, for example. In this case, f (100) = 118, the addition amount M becomes (118−100) = 18, and the maximum value Vmax becomes “100”. Since the value of (Vmax + M) does not exceed 255, from (Equation 10), Vr ′ = “118”, Vg ′ = “118”, and Vb ′ = “118”. The lightness is slightly increased by the correction, but does not significantly change. Note that the addition amount M is uniformly set to “0” for pixels with a brightness of 50 or less, so that Vr ′ = Vr, Vg ′ = Vg, and Vb ′ = Vb.
[0036]
In such high brightness areas, show-through is highly likely to occur.Therefore, increase the amount of addition to make the image brighter and correct the show-through, while reducing the show-through in low brightness areas. When the brightness of an image with low brightness, such as black, increases when the brightness of the image is low, it appears to be a dull color to the human eye, so the addition amount is reduced as the brightness decreases, so the contrast is improved. Can be done. The above equation (8) is based on the example where Lv = 200 and Lmin = 50, and if the values of Lv and Lmin change (that is, if the original image is different), the conversion equation naturally changes. Needless to say.
[0037]
Referring back to FIG. 2, the RGB color
The RGB color
[0038]
FIG. 6 is a flowchart illustrating the details of the show-through correction processing executed in the
First, when the
[0039]
A brightness histogram (FIG. 3) is generated based on the calculated brightness data of each pixel (step S3), and the brightest brightness “Lv” and the darkest brightness “Lmin” are detected from the generated brightness histogram (step S4). Then, a brightness conversion formula f (L) is generated based on the detected values of “Lv” and “Lmin” (step S5). Here, as described above, a primary conversion equation in which “Lv” is “255” and “Lmin” is the same value is obtained.
[0040]
Then, using one pixel as a target pixel, the brightness value L of the target pixel is converted into L ′ using the above brightness conversion formula (step S6), and a value M of the difference (L′−L) is obtained. After that (step S7), the maximum value Vmax of Vr, Vg, and Vb of the target pixel is obtained (step S8).
When it is determined that Vmax + M> 255 (“YES” in step S9), Vr ′, Vg ′, and Vb ′ are obtained using (Equation 9) (step S10), and the process proceeds to step S11.
[0041]
On the other hand, when it is determined in step S9 that Vmax + M> 255 is not satisfied, that is, Vmax + M ≦ 255 (“NO” in step S9), Vr ′, Vg ′, and Vb ′ are obtained by using the above (Equation 10) (step S9). S12), and proceed to step S11.
In step S11, the values Vr, Vg, and Vb of the RGB color components of the target pixel are converted into the calculated Vr ', Vg', and Vb ', and the flow advances to step S13.
[0042]
In step S13, it is determined whether the calculation of Vr ', Vg', Vb 'has been completed for all the pixels. If it is determined that calculation has not been completed ("NO" in step S13), the process returns to step S8. Then, the processing from steps S8 to S12 is executed with the uncorrected pixel as the target pixel.
In step S13, the above processing is repeatedly performed until it is determined that the processing for all the pixels has been completed. When it is determined that the processing for all the pixels has been completed ("YES" in step S13), the processing is completed. I do.
[0043]
As described above, the image processing apparatus according to the present invention maintains the difference between the RGB values before and after correction for each pixel, that is, Vr−Vg = Vr′−Vg ′, Vr−Vb = Vr'-Vb 'while maintaining the relationship of Vr'-Vb' while correcting the image of the high brightness portion where the show-through is highly likely to occur, so that the back surface appearing in the relatively high brightness region such as the yellow color is used. The image can be removed without changing the hue. In addition, since the low-light portion is a dark image in the first place, the show-through itself is unlikely to occur, and if the brightness of a low-brightness image such as black is excessively raised, the image appears to be a dull color to human eyes. Since the correction amount for the image is reduced as the image becomes lower, the contrast can be improved. Further, since it is not necessary to assume a background candidate region as in the related art, it is possible to cope with show-through occurring in a partial color image region.
[0044]
Note that the present invention is not limited to the image processing apparatus described above, but can be applied to the above-described show-through processing method and a program that implements the method by a computer.
The program includes, for example, “a reception process for receiving color image data, and for each pixel of the received color image data, the maximum value Vmax of the values Vr, Vg, and Vb of the R, G, and B color components of the pixel. If the value obtained by adding the predetermined value M to the threshold value exceeds the predetermined threshold value Th, the values of Vr, Vg, and Vb are changed to Vr + (Th−Vmax), Vg + (Th−Vmax), Vb + (Th−Vmax). And a program for causing a computer to execute the correction process for correcting the error.
[0045]
In addition, the program is, for example, a magnetic disk such as a magnetic tape or a flexible disk, an optical recording medium such as a DVD, a CD-ROM, a CD-R, an MO, a PD, or a flash memory recording medium such as a Smart Media (registered trademark). Can be recorded on various computer-readable recording media, and may be produced or transferred in the form of the recording medium, or may be various types of wired or wireless networks including the Internet in the form of programs, and broadcasts. May be transmitted and supplied via an electric communication line, satellite communication, or the like.
[0046]
In addition, the program does not need to include all the modules for causing the computer to execute the above-described processing, and may be separately installed in the information processing apparatus, such as a communication program or a program included in an operating system (OS). The various processes of the present invention may be executed by a computer by using various general-purpose programs that can be used. Therefore, it is not always necessary to record all the modules in the above-described recording medium, and it is not necessary to transmit all the modules.
[0047]
(Modification)
As described above, the present invention has been described based on the embodiments. However, the present invention is not limited to the above-described embodiments, and the following modified examples can be considered.
(1) In the above embodiment, as a formula for calculating the addition amount M to be added to the value of each RGB color component of each pixel, a linear function formula in which “Lv” is “255” and “Lmin” is “Lmin” However, the present invention is not limited to this, and a non-linear curve such as a γ curve may be used. By using a γ curve, for example, with a brightness of 100 as a boundary, it is possible to increase the amount of addition for
[0048]
Furthermore, in the above-described embodiment, when the value of the lightness “Lv” of the brightest part based on the
[0049]
(2) In the above-described embodiment, the brightness conversion formula is obtained from the histogram. However, for example, the user can arbitrarily change the brightness conversion formula. For example, in the case of a linear function, the inclination of a straight line may be changed, and in the case of a γ curve, the degree of curve may be changed. Being able to change the conversion formula is the same as being able to adjust the addition amount M and, consequently, the correction amount, so that the user can correct the desired image while checking the degree of show-through and the degree of contrast. . In this case, an operation unit that functions as a receiving unit for receiving a change input from the user may be provided, and the conversion formula may be changed based on the received content.
[0050]
(3) Further, the addition amount M for each pixel can be uniformly set to a predetermined value without using the brightness conversion formula. That is, data indicating the amount of addition (for example, 50) is stored in advance, and the data is read out during the show-through correction processing and uniformly added to each pixel, and the processing after step S8 is performed.
By doing so, it is not necessary to create a histogram, so that the processing can be simplified and the time required for the entire processing can be shortened. Note that the same value is uniformly added to each color component of RGB for pixels having low lightness such as black, so that it is undeniable that black and the like will be somewhat dull, but the color graph occupies the majority. This is effective when a graph document or the like is targeted. For example, it is also possible to configure so that the user can select the processing of the above embodiment and the processing of the modification. Further, when executing the processing of the modified example, the image processing apparatus may include a storage unit that stores the fixed value in addition to the RGB color
[0051]
Further, if the user can change the predetermined value (for example, the initial setting value is 50 and can be changed in the range of 0 to 100), the user substantially desires the correction amount. It is possible to adjust the amount.
(4) In the above embodiment, when the value of (Vmax + M) exceeds 255, V ′ = V + (255−Vmax) is set uniformly, but this is not applied to a pixel satisfying a predetermined condition. The following processing can also be performed.
[0052]
That is, the value of each RGB component of a pixel having extremely high brightness and extremely low saturation, specifically, a pixel of white or a color very close to white is affected by noise or the like at the time of reading by a scanner. For example, when Vr = 240, Vg = 240, and Vb = 240, and only Vb becomes 230, the show-through correction process according to the example of the embodiment is performed. 255, Vg '= 255, Vb' = 245, and there is a possibility that a very small difference may occur between the original color and the original color. Therefore, as a predetermined condition, for a pixel whose lightness is a predetermined value, for example, 220 or more, and whose saturation is a predetermined value, for example, 20 or less, Vr ′ = Vr + M, Vg ′ = Vg + M, Vb ′ = Vb + M, Is greater than "255", it is uniformly set to "255". This is the same as changing the correction amount (255-Vmax) for each color according to the values of brightness and saturation, and has a function of correcting the correction amount in that sense.
[0053]
In the case of the above-mentioned pixel (Vr = 240, Vg = 240, Vb = 230), since the brightness becomes “238” and the saturation becomes “8” from the above (Equation 7), the above predetermined condition is satisfied. . In this case, M = 69, Vr '= 255, Vg' = 255, Vb '= 255, and the effect of the pixel is eliminated, and as a result, the pixel is corrected to a value equivalent to white. The predetermined value can be obtained from an experiment or the like so as to eliminate the influence of noise or the like.
[0054]
Further, when the value of (Vmax + M) exceeds the
[0055]
Here, if k = 1, the configuration of the above embodiment is obtained. In the case of the above example, since “k” becomes almost “0.25” for the saturation “8” from FIG. 7, Vr ′ = 296, Vg ′ = 296, Vb ′ = 288, and “ 255 ", so that Vr '= Vg' = Vb '= 255. The relational expression between the saturation S and the coefficient k is not limited to a non-linear one as shown in FIG. 7, and may be, for example, a linear one. Just decide.
[0056]
(5) In the above embodiment, the threshold is uniformly set to “255”, but the threshold may be changed according to the image. That is, in the above embodiment, when show-through occurs in the lightness of a pixel in the green area, for example, where show-through has occurred in the green area, the show-through correction processing is performed (Vmax + M ) Does not exceed 255, and show-through may remain. As described above, even if show-through occurs in a part with low brightness, it is difficult for a human eye to see. However, as a method of removing such show-through, a method with a low brightness, for example, about 150 If it is detected that a large number of pixels are present, the threshold is changed to, for example, 200 for that part, and if the correction processing is performed, the show-through of that part can be removed. This can be realized by determining in advance which threshold is to be used for which brightness pixel from an experiment or the like.
[0057]
Further, it is also possible to divide an image of one document into a plurality of regions and to perform a process of changing a threshold value for each region. In that case, for example, the threshold value may be the maximum lightness value of each pixel for each area, or the maximum value of the RGB color components of each pixel. That is, a threshold to be used for correction may be obtained based on the values of the RGB color components of each pixel for each region, and the above-described correction processing may be performed using the obtained threshold. As a method of dividing the area, a method of equally dividing the area into rectangles, a method of grouping pixels having similar hues and saturations, and the like can be considered.
[0058]
【The invention's effect】
As described above, the image processing apparatus according to the present invention includes: a receiving unit that receives color image data; and, for each pixel of the received color image data, the values Vr and Vg of the R, G, and B color components of the pixel. , Vb, when the value obtained by adding the predetermined value M to the maximum value Vmax exceeds the predetermined threshold value Th, the values of Vr, Vg, Vb are changed to Vr + (Th−Vmax), Vg + (Th−Vmax). And Vb + (Th−Vmax).
[0059]
This makes it possible to remove show-through without changing the tint of the image of the show-through part. Further, since it is not necessary to assume a background candidate region as in the related art, it is possible to cope with show-through occurring in a partial color image region.
Further, for each pixel, there is provided an addition amount calculation means for calculating an addition amount to be added to the values Vr, Vg, Vb of the respective R, G, B color components of the pixel, and for each pixel, the addition amount calculation means calculates the addition amount. The obtained addition amount is added to the Vmax as the predetermined value M.
[0060]
Thus, the addition amount is calculated for each pixel, so that an appropriate show-through removal process according to the image can be executed.
Further, for each pixel, a brightness calculating means for calculating brightness based on the magnitudes of the values Vr, Vg, Vb of the R, G, B color components of the pixel, and a brightness distribution based on the calculated brightness value of each pixel. And a brightness conversion means for converting the brightness value L into L ′ for each pixel based on the brightness distribution of the generated histogram, wherein the brightness conversion means comprises: , The difference between L and L ′ is converted such that the brightness of a pixel having a second value larger than the first value is larger than that of the pixel having the first value. The difference between L and L 'for each pixel is defined as the addition amount.
[0061]
As a result, for a portion having a high brightness, the addition amount is increased and correction is performed so as to be brighter, so that show-through appearing in a high brightness region such as pale yellow can be removed without changing the hue. Will be possible. In addition, since the addition amount is reduced in the portion where the brightness is low, the overall contrast can be improved.
[0062]
Further, the image of the color image data is divided into predetermined regions, and for each of the divided regions, a threshold to be used for correction is obtained based on the values of R, G, and B color components of each pixel in the region. The values of the R, G, and B color components of each pixel are corrected based on the threshold value.
As a result, show-through correction can be performed for each region. For example, in the case of an image having a large difference in lightness and darkness, it is possible to separately perform processing on a portion having a high brightness and a portion having a low brightness, and thus perform a low brightness. The show-through occurring in the part can be effectively removed.
[0063]
Further, for a pixel whose brightness is equal to or more than a predetermined value and whose saturation is equal to or less than a predetermined value, a value of (Th-Vmax) to be added to each of the Vr, Vg, and Vb values is changed for each color based on a predetermined condition. ing.
Thereby, for example, even when a pixel is originally a white pixel due to the influence of noise or the like at the time of reading by a scanner or the like and a small but chroma component is added, the influence is removed and, for example, the white equivalent is removed. Can be corrected.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of a system including an
FIG. 2 is a block diagram illustrating a configuration of an
FIG. 3 is a diagram showing a content example of a created
FIG. 4 is a diagram illustrating an example of brightness conversion.
FIG. 5 is a schematic diagram illustrating the details of show-through correction for pixels A and B.
FIG. 6 is a flowchart showing details of show-through correction processing executed in the
FIG. 7 is a diagram illustrating a relationship between a coefficient k and saturation S in show-through correction according to a modification.
[Explanation of symbols]
200 Image processing device
201 Receiver
202 Lightness calculation unit
203 Lightness histogram creation unit
204 Lightness conversion formula creation unit
205 RGB color component correction unit
206 RGB color component conversion unit
210 Histogram
Claims (5)
受信したカラー画像データの画素ごとに、当該画素のR、G、B各色成分の値Vr、Vg、Vbの内の最大値Vmaxに所定値Mを加算した値が、所定の閾値Thを越える場合には、前記Vr、Vg、Vbの値を、Vr+(Th−Vmax)、Vg+(Th−Vmax)、Vb+(Th−Vmax)に補正する補正手段と、
を備えることを特徴とする画像処理装置。Receiving means for receiving color image data;
When a value obtained by adding a predetermined value M to the maximum value Vmax among the values Vr, Vg, and Vb of the R, G, and B color components of the pixel of the received color image data exceeds a predetermined threshold value Th Means for correcting the values of Vr, Vg, Vb to Vr + (Th−Vmax), Vg + (Th−Vmax), Vb + (Th−Vmax);
An image processing apparatus comprising:
画素毎に、当該画素のR、G、B各色成分の値Vr、Vg、Vbに加算すべき加算量を算出する加算量算出手段を備え、
各画素について、前記加算量算出手段により算出された加算量を前記所定値Mとして前記Vmaxに加算することを特徴とする請求項1に記載の画像処理装置。The correction means,
An addition amount calculation unit that calculates an addition amount to be added to the values Vr, Vg, and Vb of the R, G, and B color components of the pixel for each pixel;
2. The image processing apparatus according to claim 1, wherein the addition amount calculated by the addition amount calculation unit is added to the Vmax as the predetermined value M for each pixel. 3.
画素毎に、当該画素のR、G、B各色成分の値Vr、Vg、Vbの大きさに基づいて明度を算出する明度算出手段と、
算出された各画素の明度の値から明度分布を示すヒストグラムを生成するヒストグラム生成手段と、
生成されたヒストグラムの明度分布に基づいて、各画素について、その明度の値LをL′に変換する明度変換手段と、を備え、
前記明度変換手段は、前記LとL′との差分が、明度が第1の値の画素より、第1の値より大きい第2の値の画素の方が大きくなるように変換し、
前記加算量算出手段は、画素ごとに、前記LとL′との差分を前記加算量とすることを特徴とする請求項2に記載の画像処理装置。The correction means,
Brightness calculation means for calculating, for each pixel, the brightness based on the magnitudes of the values Vr, Vg, Vb of the R, G, B color components of the pixel;
Histogram generation means for generating a histogram indicating a brightness distribution from the calculated brightness value of each pixel;
Brightness conversion means for converting the brightness value L into L 'for each pixel based on the brightness distribution of the generated histogram;
The brightness conversion means converts the difference between L and L ′ such that the brightness of a pixel having a second value larger than the first value is larger than that of the pixel having the first value,
The image processing apparatus according to claim 2, wherein the addition amount calculation unit sets a difference between L and L ′ for each pixel as the addition amount.
前記カラー画像データの画像を所定の領域に分割し、分割した領域毎に、当該領域内の各画素のR、G、B各色成分の値に基づいて補正に用いるべき閾値を求め、求めた閾値に基づいて各画素のR、G、B各色成分の値を補正することを特徴とする請求項1乃至3のいずれかに記載の画像処理装置。The correction means,
The image of the color image data is divided into predetermined regions, and for each of the divided regions, a threshold to be used for correction is determined based on the values of R, G, and B color components of each pixel in the region, and the determined threshold is determined. 4. The image processing apparatus according to claim 1, wherein the values of the R, G, and B color components of each pixel are corrected based on the following.
明度が所定値以上および彩度が所定値以下の画素については、Vr、Vg、Vb値それぞれに加算すべき(Th−Vmax)の値を所定の条件に基づいて色別に変更することを特徴とする請求項1乃至4のいずれかに記載の画像処理装置。The correction means,
For a pixel whose brightness is equal to or more than a predetermined value and whose saturation is equal to or less than a predetermined value, a value of (Th-Vmax) to be added to each of the Vr, Vg, and Vb values is changed for each color based on a predetermined condition. The image processing device according to claim 1.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002370684A JP2004201245A (en) | 2002-12-20 | 2002-12-20 | Image processing apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002370684A JP2004201245A (en) | 2002-12-20 | 2002-12-20 | Image processing apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2004201245A true JP2004201245A (en) | 2004-07-15 |
Family
ID=32766535
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002370684A Pending JP2004201245A (en) | 2002-12-20 | 2002-12-20 | Image processing apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2004201245A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4857768B2 (en) * | 2003-06-19 | 2012-01-18 | 株式会社湯山製作所 | Drug inspection device |
-
2002
- 2002-12-20 JP JP2002370684A patent/JP2004201245A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4857768B2 (en) * | 2003-06-19 | 2012-01-18 | 株式会社湯山製作所 | Drug inspection device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4926568B2 (en) | Image processing apparatus, image processing method, and image processing program | |
| US8009905B2 (en) | System, medium, and method with noise reducing adaptive saturation adjustment | |
| US9055263B2 (en) | Apparatus, method and computer program for correcting an image using lookup tables generated by inputted image analysis | |
| US9025870B2 (en) | Image processing device correcting color of border region between object and background in image | |
| US7903872B2 (en) | Image-processing apparatus and method, computer program, and storage medium | |
| US8477324B2 (en) | Image processor and image processing method that uses s-shaped gamma curve | |
| JPH0372778A (en) | Area identification system for picture processing unit | |
| JP4262151B2 (en) | Image processing method, image processing apparatus, computer program, and storage medium | |
| JP4428742B2 (en) | Image processing apparatus and method | |
| JP4285127B2 (en) | Color reduction processing apparatus and color reduction processing method | |
| JP6271874B2 (en) | Image processing apparatus and image processing method | |
| JP2003219191A (en) | Image processing apparatus and image forming apparatus using the same | |
| JP2001189862A (en) | Image processing method and image processing apparatus | |
| JP3950551B2 (en) | Image processing method, apparatus, and recording medium | |
| JP4228466B2 (en) | Image processing apparatus, image processing method, and computer-readable storage medium storing image processing procedure | |
| JP4112413B2 (en) | Image processing apparatus, image forming apparatus, image processing method, image processing program, and computer-readable recording medium on which image processing program is recorded | |
| JP4545766B2 (en) | Image processing apparatus, image forming apparatus, image reading apparatus, image processing program, and recording medium | |
| JP2004201245A (en) | Image processing apparatus | |
| JP7266462B2 (en) | IMAGE PROCESSING APPARATUS, IMAGE FORMING APPARATUS, IMAGE PROCESSING METHOD AND PROGRAM | |
| JP4080252B2 (en) | Image processing apparatus, image forming apparatus, image processing method, program, and recording medium | |
| JP2000295469A (en) | Image forming device | |
| JP2005033527A (en) | Image processing apparatus, image processing method, program, and recording medium | |
| JP2003224718A (en) | Image processing method and image processing apparatus | |
| JP3944032B2 (en) | Image processing apparatus and method | |
| JP2005260404A (en) | Image processor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20050614 |