JP2006237657A - Image processing apparatus, image correction program, and recording medium - Google Patents

Image processing apparatus, image correction program, and recording medium Download PDF

Info

Publication number
JP2006237657A
JP2006237657A JP2003180684A JP2003180684A JP2006237657A JP 2006237657 A JP2006237657 A JP 2006237657A JP 2003180684 A JP2003180684 A JP 2003180684A JP 2003180684 A JP2003180684 A JP 2003180684A JP 2006237657 A JP2006237657 A JP 2006237657A
Authority
JP
Japan
Prior art keywords
histogram
gradation
saturation
brightness
lightness
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
Application number
JP2003180684A
Other languages
Japanese (ja)
Inventor
Toru Ochiai
透 落合
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nikon Corp
Original Assignee
Nikon Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nikon Corp filed Critical Nikon Corp
Priority to JP2003180684A priority Critical patent/JP2006237657A/en
Priority to PCT/JP2004/008809 priority patent/WO2005002205A1/en
Publication of JP2006237657A publication Critical patent/JP2006237657A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/46Colour picture communication systems
    • H04N1/56Processing of colour picture signals
    • H04N1/60Colour correction or control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Picture Signal Circuits (AREA)
  • Processing Of Color Television Signals (AREA)
  • Color Image Communication Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To effectively enhance the attractiveness of an image by correcting the lightness and the color saturation of the image. <P>SOLUTION: Image data are acquired from an input device 1 and an RGB value of the image data is converted into an HSV value in a CPU 3. A histogram is created for each of the lightness and the color saturation of the image data and the width of the gradation having a number-of-pixels ratio not grater than a threshold value is compressed. Thus, by enlarging the entire gradation width of the histogram in which part of the gradation width is compressed, the lightness and the color saturation are corrected, respectively. Moreover, in the histogram before compression of the gradation width, when the minimum gradation value and the maximum gradation value whose number-of-pixels ratio is other than 0 are respectively other than 0 and a full scale value, in the histogram with an enlarged gradation width, the minimum gradation value and the maximum gradation value whose number-of-pixels ratio is other than 0 are set to values other than 0 and the full scale value. Thus, the lightness and the color saturation are corrected. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、カラー画像の見映えを向上する画像補正処理に関する。
【0002】
【従来の技術】
スキャナやデジタルカメラなどの装置では、原稿や被写体からの光をCCDなどの撮像素子で光量に対応した電圧信号に変換し、その電圧信号の強度をデジタルデータに変換して、画像データを得る。ところが、電圧信号の強度を変換したデジタルデータのままでは、明度や彩度のコントラストが少なく、その画像は見た目にメリハリの少ない地味な画像となることがある。これを解決して画像の見映えを向上するため、従来さまざまな画像補正の方法が提案されている。たとえば、明度階調に対して頻度分布や累積頻度分布を作成し、その分布に基づいて明度階調の補正を行うもの(特許文献1、2)や、画像データを色相、彩度および明度に変換し、明度の頻度分布を用いて明度のダイナミックレンジを補正するとともに、その明度の補正結果に応じた値を彩度に加えて、彩度を補正するもの(特許文献3)がある。
【0003】
【特許文献1】
特開2000−306088号公報
【特許文献2】
特開平5−80193号公報
【特許文献3】
特開平8−32827号公報
【0004】
【発明が解決しようとする課題】
しかし、これらの画像補正方法を用いても、必ずしも効果的に画像の見映えを向上できるわけではない。たとえば、特許文献1または2に記載の方法では、明度階調のみに対して補正を行っているため、彩度のコントラストを改善できない。したがって、彩度による影響が大きい色の華やかさを補正できず、見映えの向上には効果的でないことがある。
【0005】
本発明は、彩度および明度のコントラストを改善して効果的に画像の見映えを向上する画像処理装置および画像補正プログラムを提供するものである。
【0006】
【課題を解決するための手段】
請求項1の発明による画像処理装置は、カラー画像データを入力する入力手段と、カラー画像データを色相、彩度および明度に変換する変換手段と、彩度および明度について総画素数に対する各階調ごとの画素数比率をそれぞれ計算し、彩度ヒストグラムと明度ヒストグラムを作成するヒストグラム作成手段とを備え、彩度ヒストグラムおよび明度ヒストグラムに基づいて彩度および明度をそれぞれ補正することにより、彩度および明度のコントラストを改善するものである。
請求項2の発明は、請求項1の画像処理装置において適用され、彩度ヒストグラムおよび明度ヒストグラムの階調の幅をその階調における画素数比率に基づいて変更することにより、彩度および明度をそれぞれ補正するものである。
請求項3の発明は、請求項2の画像処理装置において適用され、彩度ヒストグラムおよび明度ヒストグラムの各階調における画素数比率に対してそれぞれしきい値を設定し、しきい値未満である場合はその階調の幅を圧縮するヒストグラム圧縮手段と、ヒストグラム圧縮手段により階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大するヒストグラム拡大手段とをさらに備え、ヒストグラム圧縮手段およびヒストグラム拡大手段により彩度および明度をそれぞれ補正することを特徴とする画像処理装置。請求項4の発明は、請求項3の画像処理装置において適用され、ヒストグラム拡大手段は、ヒストグラム圧縮手段により階調の幅を圧縮される前の彩度ヒストグラムおよび明度ヒストグラムにおける前記画素数比率が0でない最小と最大の階調値に基づいて、ヒストグラム拡大手段により階調全体の幅を拡大された彩度ヒストグラムおよび明度ヒストグラムにおける画素数比率が0でない最小と最大の階調値を決定し、階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける最小の階調値が0でないときは、その階調値を0以外の値に決定し、階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける最大の階調値がフルスケール値でないときは、その階調値をフルスケール値以外の値に決定し、決定された最小および最大の階調値に基づいて、ヒストグラム圧縮手段により階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大するものである。
請求項5の発明は、請求項3または4の画像処理装置において適用され、ヒストグラム圧縮手段は、彩度ヒストグラムまたは明度ヒストグラムにおいてしきい値未満となる画素数比率がそのヒストグラム全体の所定割合となるように、しきい値を設定するものである。
請求項6の発明によるカラー画像の画像補正プログラムは、画像データを入力する入力ステップと、画像データを色相、彩度および明度に変換する変換ステップと、彩度および明度について総画素数に対する各階調ごとの画素数比率をそれぞれ計算し、彩度ヒストグラムと明度ヒストグラムを作成するヒストグラム作成ステップと、彩度ヒストグラムおよび明度ヒストグラムに基づいて彩度および明度をそれぞれ補正することにより、彩度および明度のコントラストを改善する補正ステップとをコンピュータに実行させるものである。
請求項7の発明は、請求項6の画像補正プログラムにおいて適用され、補正ステップでは、彩度ヒストグラムおよび明度ヒストグラムの階調の幅をその階調における画素数比率に基づいて変更することにより、彩度および明度をそれぞれ補正するものである。
請求項8の発明は、請求項7の画像補正プログラムにおいて適用され、補正ステップは、彩度ヒストグラムおよび明度ヒストグラムの各階調における画素数比率に対してそれぞれしきい値を設定し、しきい値未満である場合はその階調の幅を圧縮するヒストグラム圧縮ステップと、ヒストグラム圧縮ステップにより階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大するヒストグラム拡大ステップとからなり、ヒストグラム圧縮ステップおよびヒストグラム拡大ステップにより彩度および明度をそれぞれ補正するものである。
請求項9の発明は、請求項8の画像補正プログラムにおいて適用され、ヒストグラム拡大ステップは、ヒストグラム圧縮ステップにより階調の幅を圧縮される前の彩度ヒストグラムおよび明度ヒストグラムにおける画素数比率が0でない最小と最大の階調値に基づいて、ヒストグラム拡大ステップにより階調全体の幅を拡大された彩度ヒストグラムおよび明度ヒストグラムにおける画素数比率が0でない最小と最大の階調値を決定し、階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける最小の階調値が0でないときは、その階調値を0以外の値に決定し、階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける最大の階調値がフルスケール値でないときは、その階調値をフルスケール値以外の値に決定し、決定された最小および最大の階調値に基づいて、ヒストグラム圧縮ステップにより階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大するものである。
請求項10の発明は、請求項8または9の画像補正プログラムにおいて適用され、ヒストグラム圧縮ステップは、彩度ヒストグラムまたは明度ヒストグラムにおいてしきい値未満となる画素数比率がそのヒストグラム全体の所定割合となるように、しきい値を設定するものである。
【0007】
【発明の実施の形態】
本発明による画像処理装置の一実施形態を図1に示す。図1の画像処理装置は、撮像された画像などのカラー画像データを入力し、この画像データの彩度と明度の両方をそれぞれのヒストグラムに基づいて補正することにより、画像の見映えを向上する装置である。この画像処理装置は、入力装置1、インタフェース2、CPU3、記憶装置4およびモニタ5を有し、これらはバスライン6により互いに接続される。
【0008】
入力装置1は、この画像処理装置に入力する画像データを供給する装置である。入力装置1には、たとえばスキャナ、デジタルカメラ、CD−ROMやメモリカードなどの記憶デバイスのドライブ装置、などが用いられる。入力装置1より供給された画像データは、インタフェース2を介してCPU3に入力される。
【0009】
CPU3は、記憶装置4に記憶された画像補正処理プログラムを実行し、入力された画像データの補正処理を行うプロセッサである。記憶装置4は、画像補正処理プログラムを記憶するとともに、入力装置1よりCPU3に入力された画像データや、CPU3により補正処理された画像データを記憶する装置であり、たとえばHDDなどが用いられる。これらの画像データによる画像は、モニタ5に表示される。
【0010】
CPU3において実行される画像補正処理プログラムによるフローチャートを図2に示す。CPU3に画像データが入力されると、ステップS1のRGB/HSV変換を行う。RGB/HSV変換では、入力された画像データのR(赤)、G(緑)、B(青)の値を、H(色相)、S(彩度)、V(明度)の値に変換する。このときの変換方法には、周知の方法が用いられる。
【0011】
ステップS2の明度ヒストグラム作成では、ステップS1のRGB/HSV変換により変換された画像データの明度について、ヒストグラムを作成する。ここでは、たとえば図4に示すヒストグラムが作成されたとする。この明度ヒストグラムは、横軸は0〜255までの明度階調(iとする)を表し、縦軸はその明度階調iにおける画素数比率(Fiとする)を表す。なお、画素数比率とは、その明度階調の画素数の、画像の全画素数に対する比率である。
【0012】
ステップS3の明度ヒストグラム圧縮では、ステップS2の明度ヒストグラム作成により作成された明度ヒストグラムについて、明度階調iごとに画素数比率Fiがしきい値以上であるか否かを判定し、しきい値未満である部分の明度階調の幅を圧縮する。これは、図3にフローチャートを示すサブルーチン処理により次のようにして行われる。
【0013】
図3のステップS31において、一時メモリの変数TEMPをリセットしてゼロにし、ステップS32へ進む。ステップS32において、明度階調i、jを、i=0、かつj=0に設定する。ここで明度階調iは、明度階調幅の圧縮前、すなわち、図2のステップS2の明度ヒストグラム作成において作成された、元のヒストグラムの明度階調を示す。また、明度階調jは、明度階調幅の圧縮後、すなわち図3のフローチャートの処理によって明度階調の幅を圧縮された後の、明度ヒストグラムの明度階調を示す。ステップS33では、フラグFLAGを初期値であるFALSEに設定する。
【0014】
その後、ステップS34において、画素数比率Fiを演算されたしきい値Sと比較する。このしきい値Sは、あらかじめユーザにより行われるしきい値の指定入力(ステップS320)に基づいて演算されている。このとき、たとえばしきい値を定数とするか、明度階調に応じたしきい値とするかを指定することができる。定数ならば、ユーザにより入力された値をしきい値Sとする。一方、明度階調に応じたしきい値とする場合、ユーザはしきい値Sを明度階調iの関数S(i)として指定する。この関数S(i)により、明度階調に応じてしきい値が演算される。さらに、ユーザがこのようなしきい値を入力または指定せずに、画像に応じて自動的に設定されるようにしてもよい。たとえば、しきい値未満となる画素数比率Fiの合計が、ヒストグラム全体の10%などの所定割合となるように、しきい値Sが設定される。
【0015】
ステップS34において、画素数比率Fiがしきい値S未満なら、ステップS35において、フラグFLAGをTRUEに設定し、さらに、ステップS36において、一時メモリの変数TEMPに現在の明度階調iの画素数比率Fiを加える。その後、ステップS37において、変数TEMPとしきい値Sとを比較する。ステップS37をはじめて実行するとき、その判定結果は必ずNOとなる。
【0016】
ステップS37が否定判定されるとステップS37Aで変数Gjに変数TEMPを格納してステップS38へ進む。ステップS38において、明度階調iに1を加え、ステップS39において、明度階調iが255以上であるか否か判定する。ステップS39が否定されると、ステップS34に戻る。このとき、ステップS34が否定判定されると、ステップS35、S36、S37、S38、S39を繰り返す。
【0017】
ステップS37が肯定されると、ステップS310において、変数TEMPの値を変数Gjに格納する。つまり、連続する複数の明度階調の画素数比率Fiがともにしきい値S未満であるときは、ステップS36でそれらの画素数比率Fiが積分される。この積分値がしきい値S以上になると、ステップS310でこの積分値を補正後のヒストグラムの明度階調jにおける画素数比率Gjとする。
【0018】
ステップS310からステップS311に進むと、変数TEMPをリセットしてゼロにし、ステップS312で、明度階調jに1を加える。次に、ステップS319において、フラグFLAGをFALSEに設定する。その後、ステップS38、S39を経由して、ステップS34へ戻る。ステップS34が否定された場合は、以上説明したようにして動作する。
【0019】
一方、ステップS34が肯定された場合、すなわち現在の明度階調iに対する画素数比率Fiがしきい値S以上ならば、ステップS313において、フラグFLAGがTRUEであるか否か判定する。このステップS313は、前回の処理サイクル、すなわち現在の明度階調iよりも1小さい明度階調のときの画素数比率Fiが、しきい値S以上であったか否かにより、その後の処理手順を変更するために設けられている。前回の処理サイクルにおける画素数比率Fiがしきい値S以上であれば、ステップS313が否定判定され、ステップS314において、現在の明度階調iの画素数比率Fiを変数Gjに格納し、ステップS312において、明度階調jに1を加える。その後、ステップS319、S38、S39を経由して、ステップS34へ戻る。ステップS313が否定判定された場合は、以上説明したようにして動作する。
【0020】
前回の処理サイクルにおける画素数比率Fiがしきい値S未満であれば、ステップS313が肯定判定され、ステップS315において、変数TEMPの値を変数Gjに格納する。次に、ステップS316に進み、画素数比率Fiの値を変数Gj+1に格納する。さらに、ステップS317で、変数TEMPをリセットしてゼロにし、ステップS318で明度階調jに2を加える。その後、ステップS319においてフラグFLAGをFALSEに設定し、ステップS38、S39を経由して、ステップS34へ戻る。ステップS313が肯定判定された場合は、以上説明したようにして動作する。
【0021】
このようにして全ての明度階調iに対して処理を行い、最後にステップS39が肯定判定されて、図3に示す処理フローが終了する。以上説明した処理において、ステップS36でしきい値Sを越えていない画素数比率Fiが積分され、ステップS37A、S310またはS315で変数Gjに格納される。明度階調jに対してこの変数Gjによる画素数比率Gjのヒストグラムを作成することにより、処理前の明度階調iに対する画素数比率Fiのヒストグラムにおいて、画素数比率Fiがしきい値未満である部分の明度階調の幅が圧縮される。
【0022】
以上説明した図3のフローチャートの処理によって、図4の明度ヒストグラムの階調幅を圧縮したものを図5に示す。図5のヒストグラムにおいて、横軸は明度階調j、縦軸は変数Gjによる画素数比率Gjをそれぞれ表す。なお、図5のαおよびβに示す明度階調は、画素数比率Gjが0でない明度階調jの最小値および最大値であり、以降に説明するステップS4の処理において用いられる。
【0023】
図2のステップS4の明度ヒストグラム拡大では、ステップS3の明度ヒストグラム圧縮において圧縮された明度ヒストグラムの階調幅を拡大する。これは次のようにして行われる。はじめに、図4の明度ヒストグラム、すなわち階調幅の圧縮前の明度ヒストグラムにおいて、画素数比率Fiが0でない明度階調iの最小値と最大値を求める。ここでは、たとえば図4に示す最小値A0および最大値B0が求められたとする。
【0024】
次に、求められた最小値A0と最大値B0に基づいて、圧縮された階調幅を拡大するときの明度階調iの下限値Aと上限値Bを決定する。この下限値Aと上限値Bは、元のヒストグラムにおいて明度階調iの最小値A0が0でないときや最大値B0がフルスケール値でないとき、すなわち元の画像に黒や白が存在しない場合に、画像補正処理後においても黒や白が存在せず、かつ画像の見映えが良くなるように、実験的または統計的に求められた関係により決定される。その関係は、たとえば図7に示すような曲線70によって表すことができる。この関係によって、横軸上に示す元のヒストグラムにおける明度階調の最小値A0と最大値B0に基づいて、縦軸上に示す階調幅拡大時の明度階調の下限値Aと上限値Bが決定される。このようにして、元の画像に黒や白が存在しない場合には、補正処理後の画像においても黒や白が存在しないようにする。これにより、特許文献1に記載の方法において頻度分布の明度階調幅をゼロからフルスケール値になるよう拡大することによって、本来黒や白のない画像においても黒や白が生成され、画像の見た目が大きく変化してしまうのを防ぐことができる。
【0025】
このようにして決定された下限値Aと上限値Bに基づいて、図2ステップS3において圧縮されたヒストグラムの明度階調幅を、下記の変換式(1)を用いて拡大する。このとき、明度階調jの値を式(1)により変換し、その明度階調jにおける画素数比率Gjの値はそのままとすることで、明度階調の幅を拡大することができる。なお、式(1)のαおよびβは、図5における画素数比率Gjが0でない明度階調jの最小値αおよび最大値βである。
【数1】
C(j)=(j−α)・{(B−A)/(β−α)}+A ・・・・(1)
ただし
C(j):変換後の明度階調
【0026】
以上説明したようにして、圧縮された明度ヒストグラムの階調幅が拡大される。この処理により、図5のヒストグラムの階調幅を拡大したものを図6に示す。このように階調幅を拡大することで、画像のコントラストを強調して見映えの良い画像とすることができる。
【0027】
このようにして、ステップS2の明度ヒストグラム作成、ステップS3の明度ヒストグラム圧縮、およびステップS4の明度ヒストグラム拡大において、補正された明度による明度ヒストグラムを作成する。また、彩度についても同様の処理を、ステップS5の彩度ヒストグラム作成、ステップS6の彩度ヒストグラム圧縮、およびステップS7の彩度ヒストグラム拡大において行い、補正された彩度による彩度ヒストグラムを作成する。このように、明度と彩度をそれぞれのヒストグラムにより補正することで、特許文献3に記載の方法における明度の補正結果により決まる値を彩度に加えることにより、本来彩度が低い部分に対しても彩度を強調しすぎてしまうのを防ぐことができる。ステップS8のHSV/RGB変換では、この補正された明度および彩度ヒストグラムによる画像データを、HSV値からRGB値に変換する。変換した画像データはCPU3より出力され、記憶装置4に記憶したり、その画像をモニタ5に表示したりする。
【0028】
以上説明した画像処理装置によれば、次の作用効果を奏する。
(1)彩度ヒストグラムおよび明度ヒストグラムに基づいて彩度および明度をそれぞれ補正することにより、彩度および明度のコントラストを改善して、効果的に画像の見映えを向上できる。
(2)彩度ヒストグラムおよび明度ヒストグラムの階調の幅をその階調における画素数比率に基づいて変更することにより、彩度および明度をそれぞれ補正する。このとき、ヒストグラムの各階調における画素数比率が設定したしきい値未満である場合はその階調幅を圧縮し、これにより階調幅の一部が圧縮されたヒストグラムの階調全体の幅を拡大して、彩度および明度をそれぞれ補正する。このようにしたので、彩度と明度をそのヒストグラムの各階調における画素数比率に応じて補正することができるため、彩度と明度のコントラストを画像に応じて適切に改善できる。
(3)階調幅の圧縮前のヒストグラムにおいて画素数比率が0でない最小と最大の階調値に基づいて、階調幅を拡大したときのヒストグラムにおいて画素数比率が0でない最小と最大の階調値を決定し、前者の階調値のそれぞれが0またはフルスケール値でないときは、後者の階調値のそれぞれを0またはフルスケール値以外の値とする。このようにしたので、元の画像に黒や白が存在しない場合に、画像補正処理後においても黒や白が存在せず、かつ画像の見映えを向上することができる。
(4)ヒストグラムにおいてしきい値未満となる画素数比率がそのヒストグラム全体の所定割合となるようにしきい値を設定することとしたため、ユーザが面倒な操作を行うことなく、画像補正処理を簡単に実行できる。
【0029】
なお、以上説明した実施の形態では、本発明を実現するために実行される画像補正処理プログラムは記憶装置4の記録媒体に記録されており、CPU3においてこの画像補正処理プログラムを実行する例について説明したが、本発明はこの内容に限定されない。たとえば、以上説明したような画像補正処理プログラムが入力装置1に記憶されて実行されることとしてもよい。また、この画像補正処理プログラムを、記録媒体を用いてパソコンや入力装置に取り込んでもよい。あるいは、この画像補正処理プログラムを、インターネットなどの電気通信回線を通じてパソコンや入力装置に取り込んでもよい。
【0030】
以上説明した実施の形態では、入力手段を入力装置1により実現し、変換手段、ヒストグラム作成手段、ヒストグラム圧縮手段、およびヒストグラム拡大手段をCPU3により実現している。しかし、これらはあくまで一例であり、本発明の特徴が損なわれない限り、各構成要素は上述の実施の形態に限定されない。
【0031】
【発明の効果】
本発明によれば、以上説明したように構成しているので、効果的にカラー画像の見映えを向上することができる。
【図面の簡単な説明】
【図1】本発明による画像処理装置の一実施形態を示す図
【図2】画像補正処理プログラムのフローチャートを示す図
【図3】明度ヒストグラム圧縮におけるサブルーチン処理のフローチャートを示す図
【図4】作成された明度ヒストグラムの例を示す図
【図5】階調幅を圧縮された明度ヒストグラムの例を示す図
【図6】圧縮された階調幅を拡大した明度ヒストグラムの例を示す図
【図7】元の明度ヒストグラムにおける画素数比率が0でない明度階調の最小値および最大値と、圧縮された階調幅を拡大するときの明度階調の最小値および最大値との関係の例を示す図
【符号の説明】
1:入力装置 2:インタフェース 3:CPU
4:記憶装置 5:モニタ 6:バスライン
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image correction process for improving the appearance of a color image.
[0002]
[Prior art]
In an apparatus such as a scanner or a digital camera, light from an original or a subject is converted into a voltage signal corresponding to the amount of light by an image sensor such as a CCD, and the intensity of the voltage signal is converted into digital data to obtain image data. However, with the digital data obtained by converting the intensity of the voltage signal, the contrast of brightness and saturation is small, and the image may be a plain image with little sharpness. In order to solve this problem and improve the appearance of the image, various image correction methods have been proposed. For example, a frequency distribution or a cumulative frequency distribution is created for the lightness gradation, and the lightness gradation is corrected based on the distribution (Patent Documents 1 and 2), or image data is converted to hue, saturation, and lightness. There is a technique that corrects the dynamic range of lightness using the frequency distribution of lightness and corrects the saturation by adding a value corresponding to the correction result of the lightness to the saturation (Patent Document 3).
[0003]
[Patent Document 1]
JP 2000-306088 A [Patent Document 2]
JP-A-5-80193 [Patent Document 3]
Japanese Patent Laid-Open No. 8-32827
[Problems to be solved by the invention]
However, even if these image correction methods are used, it is not always possible to effectively improve the appearance of the image. For example, in the method described in Patent Document 1 or 2, since only lightness gradation is corrected, saturation contrast cannot be improved. Therefore, it is not possible to correct the gorgeousness of the color that is greatly affected by the saturation, which is not effective for improving the appearance.
[0005]
The present invention provides an image processing apparatus and an image correction program that improve the appearance of an image effectively by improving the contrast of saturation and lightness.
[0006]
[Means for Solving the Problems]
An image processing apparatus according to a first aspect of the present invention includes an input means for inputting color image data, a conversion means for converting color image data into hue, saturation and brightness, and for each gradation with respect to the total number of pixels with respect to saturation and brightness. And a histogram creation means for creating a saturation histogram and a brightness histogram, respectively, and correcting the saturation and the brightness based on the saturation histogram and the brightness histogram, respectively. Contrast is improved.
The invention according to claim 2 is applied to the image processing apparatus according to claim 1, and changes the gradation width of the saturation histogram and the brightness histogram based on the ratio of the number of pixels in the gradation, thereby adjusting the saturation and brightness. Each is to be corrected.
The invention according to claim 3 is applied to the image processing apparatus according to claim 2, and sets a threshold value for each ratio of the number of pixels in each gradation of the saturation histogram and the brightness histogram, and when the threshold value is less than the threshold value, A histogram compression unit that compresses the width of the gradation, and a histogram expansion unit that expands the width of the entire gradation of the saturation histogram and the lightness histogram in which a part of the gradation width is compressed by the histogram compression unit. An image processing apparatus, further comprising: correcting the saturation and the brightness by a histogram compression unit and a histogram expansion unit, respectively. The invention according to claim 4 is applied to the image processing apparatus according to claim 3, wherein the histogram enlargement means has a ratio of the number of pixels of 0 in the saturation histogram and the brightness histogram before the gradation width is compressed by the histogram compression means. Based on the minimum and maximum gradation values that are not, the minimum and maximum gradation values in which the ratio of the number of pixels in the saturation histogram and the lightness histogram in which the width of the entire gradation is expanded by the histogram expansion means are not zero are determined, When the minimum gradation value in the saturation histogram or lightness histogram before compression of the tone width is not 0, the gradation value is determined to be a value other than 0, and the gradation width before compression is compressed. If the maximum gradation value in the saturation histogram or brightness histogram is not the full scale value, determine the gradation value to a value other than the full scale value, and On the basis of the minimum and maximum grayscale values for saturation histogram and brightness histogram compressed part of the width of the gradation by the histogram compression means, and expands the width of the entire gradations.
The invention according to claim 5 is applied to the image processing apparatus according to claim 3 or 4, and the histogram compression means is such that the ratio of the number of pixels that is less than the threshold value in the saturation histogram or the brightness histogram is a predetermined ratio of the entire histogram. Thus, a threshold value is set.
According to a sixth aspect of the present invention, there is provided a color image correction program comprising: an input step for inputting image data; a conversion step for converting image data into hue, saturation and brightness; and each gradation for saturation and brightness relative to the total number of pixels. Saturation and brightness contrast by calculating the pixel ratio for each and creating a saturation histogram and brightness histogram, and correcting saturation and brightness respectively based on the saturation histogram and brightness histogram And a correction step for improving the computer.
The invention according to claim 7 is applied in the image correction program according to claim 6, and in the correction step, the gradation width of the saturation histogram and the brightness histogram is changed based on the ratio of the number of pixels in the gradation. This corrects the brightness and brightness respectively.
The invention of claim 8 is applied to the image correction program of claim 7, and the correction step sets a threshold value for the ratio of the number of pixels in each gradation of the saturation histogram and the brightness histogram, and is less than the threshold value. A histogram compression step that compresses the width of the gradation, and a saturation histogram and a lightness histogram in which a part of the gradation width is compressed by the histogram compression step, the histogram that expands the width of the entire gradation It comprises an enlargement step, and the saturation and lightness are corrected by the histogram compression step and the histogram enlargement step, respectively.
The invention according to claim 9 is applied to the image correction program according to claim 8, and in the histogram expansion step, the pixel number ratio in the saturation histogram and the brightness histogram before the gradation width is compressed by the histogram compression step is not zero. Based on the minimum and maximum gradation values, the minimum and maximum gradation values in which the ratio of the number of pixels in the saturation histogram and the brightness histogram in which the width of the entire gradation is expanded by the histogram expansion step is not 0 are determined, If the minimum gradation value in the saturation histogram or lightness histogram before compression of the width is not 0, the gradation value is determined to be a value other than 0, and the gradation before compression of the gradation width is determined. If the maximum gradation value in the brightness histogram or lightness histogram is not a full scale value, the gradation value is not a full scale value. In accordance with the determined minimum and maximum gradation values, the entire width of the gradation is expanded with respect to the saturation histogram and the lightness histogram in which a part of the gradation width is compressed by the histogram compression step. Is.
The invention according to claim 10 is applied to the image correction program according to claim 8 or 9, and in the histogram compression step, the ratio of the number of pixels that is less than the threshold value in the saturation histogram or the brightness histogram is a predetermined ratio of the entire histogram. Thus, a threshold value is set.
[0007]
DETAILED DESCRIPTION OF THE INVENTION
An embodiment of an image processing apparatus according to the present invention is shown in FIG. The image processing apparatus in FIG. 1 receives color image data such as a captured image and corrects both the saturation and lightness of the image data based on the respective histograms, thereby improving the appearance of the image. Device. The image processing apparatus includes an input device 1, an interface 2, a CPU 3, a storage device 4, and a monitor 5, which are connected to each other by a bus line 6.
[0008]
The input device 1 is a device that supplies image data to be input to the image processing device. As the input device 1, for example, a scanner, a digital camera, a drive device of a storage device such as a CD-ROM or a memory card, or the like is used. Image data supplied from the input device 1 is input to the CPU 3 via the interface 2.
[0009]
The CPU 3 is a processor that executes an image correction processing program stored in the storage device 4 and corrects input image data. The storage device 4 stores an image correction processing program and also stores image data input to the CPU 3 from the input device 1 and image data corrected by the CPU 3. For example, an HDD or the like is used. Images based on these image data are displayed on the monitor 5.
[0010]
A flowchart of the image correction processing program executed in the CPU 3 is shown in FIG. When image data is input to the CPU 3, RGB / HSV conversion in step S1 is performed. In RGB / HSV conversion, R (red), G (green), and B (blue) values of input image data are converted to H (hue), S (saturation), and V (lightness) values. . A known method is used as the conversion method at this time.
[0011]
In the brightness histogram creation in step S2, a histogram is created for the brightness of the image data converted by the RGB / HSV conversion in step S1. Here, for example, it is assumed that the histogram shown in FIG. 4 is created. In this lightness histogram, the horizontal axis represents the lightness gradation (i) from 0 to 255, and the vertical axis represents the pixel number ratio (fi) in the lightness gradation i. The pixel number ratio is the ratio of the number of pixels of the lightness gradation to the total number of pixels of the image.
[0012]
In the lightness histogram compression in step S3, for the lightness histogram created by creating the lightness histogram in step S2, it is determined whether or not the pixel number ratio Fi is greater than or equal to the threshold value for each lightness gradation i, and less than the threshold value. The width of the lightness gradation of the part which is is compressed. This is performed as follows by the subroutine processing shown in the flowchart of FIG.
[0013]
In step S31 of FIG. 3, the temporary memory variable TEMP is reset to zero, and the process proceeds to step S32. In step S32, the lightness gradations i and j are set to i = 0 and j = 0. Here, the lightness gradation i indicates the lightness gradation of the original histogram created before the lightness gradation width is compressed, that is, in the lightness histogram creation in step S2 of FIG. The lightness gradation j indicates the lightness gradation of the lightness histogram after the lightness gradation width is compressed, that is, after the lightness gradation width is compressed by the processing of the flowchart of FIG. In step S33, the flag FLAG is set to the initial value FALSE.
[0014]
Thereafter, in step S34, the pixel number ratio Fi is compared with the calculated threshold value S. This threshold value S is calculated based on a threshold designation input (step S320) performed in advance by the user. At this time, for example, it can be specified whether the threshold value is a constant or a threshold value corresponding to the lightness gradation. If it is a constant, the value input by the user is set as the threshold value S. On the other hand, when setting the threshold value according to the lightness gradation, the user designates the threshold value S as a function S (i) of the lightness gradation i. By this function S (i), the threshold value is calculated according to the lightness gradation. Furthermore, the user may be automatically set according to the image without inputting or specifying such a threshold value. For example, the threshold value S is set so that the total of the pixel number ratio Fi that is less than the threshold value becomes a predetermined ratio such as 10% of the entire histogram.
[0015]
If the pixel number ratio Fi is less than the threshold value S in step S34, the flag FLAG is set to TRUE in step S35. Further, in step S36, the pixel number ratio of the current lightness gradation i to the variable TEMP in the temporary memory. Add Fi. Thereafter, in step S37, the variable TEMP is compared with the threshold value S. When step S37 is executed for the first time, the determination result is always NO.
[0016]
If a negative determination is made in step S37, the variable TEMP is stored in the variable Gj in step S37A, and the process proceeds to step S38. In step S38, 1 is added to the lightness gradation i. In step S39, it is determined whether the lightness gradation i is 255 or more. If step S39 is negative, the process returns to step S34. At this time, if a negative determination is made in step S34, steps S35, S36, S37, S38, and S39 are repeated.
[0017]
If step S37 is positive, in step S310, the value of variable TEMP is stored in variable Gj. That is, when the pixel number ratios Fi of a plurality of continuous lightness gradations are both less than the threshold value S, those pixel number ratios Fi are integrated in step S36. When the integral value is equal to or greater than the threshold value S, the integral value is set as the pixel number ratio Gj in the lightness gradation j of the corrected histogram in step S310.
[0018]
When the process proceeds from step S310 to step S311, the variable TEMP is reset to zero, and 1 is added to the lightness gradation j in step S312. Next, in step S319, the flag FLAG is set to FALSE. Thereafter, the process returns to step S34 via steps S38 and S39. When step S34 is negative, the operation is performed as described above.
[0019]
On the other hand, if step S34 is affirmed, that is, if the pixel number ratio Fi for the current lightness gradation i is equal to or greater than the threshold value S, it is determined in step S313 whether the flag FLAG is TRUE. This step S313 changes the subsequent processing procedure depending on whether or not the pixel number ratio Fi at the previous processing cycle, that is, the lightness gradation 1 smaller than the current lightness gradation i is equal to or greater than the threshold value S. Is provided to do. If the pixel number ratio Fi in the previous processing cycle is greater than or equal to the threshold value S, a negative determination is made in step S313, and in step S314, the pixel number ratio Fi of the current lightness gradation i is stored in the variable Gj, and step S312 is performed. 1 is added to the lightness gradation j. Thereafter, the process returns to step S34 via steps S319, S38, and S39. When a negative determination is made in step S313, the operation is performed as described above.
[0020]
If the pixel number ratio Fi in the previous processing cycle is less than the threshold value S, an affirmative determination is made in step S313, and in step S315, the value of the variable TEMP is stored in the variable Gj. In step S316, the pixel number ratio Fi is stored in the variable Gj + 1. Further, in step S317, the variable TEMP is reset to zero, and 2 is added to the lightness gradation j in step S318. Thereafter, the flag FLAG is set to FALSE in step S319, and the process returns to step S34 via steps S38 and S39. When step S313 is affirmed, the operation is performed as described above.
[0021]
In this way, the process is performed for all the lightness gradations i. Finally, an affirmative determination is made in step S39, and the process flow shown in FIG. 3 ends. In the processing described above, the pixel number ratio Fi that does not exceed the threshold value S is integrated in step S36, and stored in the variable Gj in step S37A, S310, or S315. By creating a histogram of the pixel number ratio Gj by the variable Gj for the lightness gradation j, the pixel number ratio Fi is less than the threshold in the histogram of the pixel number ratio Fi for the lightness gradation i before processing. The brightness gradation width of the portion is compressed.
[0022]
FIG. 5 shows a result obtained by compressing the gradation width of the brightness histogram of FIG. 4 by the processing of the flowchart of FIG. 3 described above. In the histogram of FIG. 5, the horizontal axis represents the lightness gradation j, and the vertical axis represents the pixel number ratio Gj by the variable Gj. Note that the lightness gradations indicated by α and β in FIG. 5 are the minimum value and the maximum value of the lightness gradation j whose pixel number ratio Gj is not 0, and are used in the process of step S4 described below.
[0023]
In the brightness histogram expansion in step S4 in FIG. 2, the gradation width of the brightness histogram compressed in the brightness histogram compression in step S3 is expanded. This is done as follows. First, in the lightness histogram of FIG. 4, that is, the lightness histogram before gradation width compression, the minimum value and the maximum value of the lightness gradation i whose pixel number ratio Fi is not 0 are obtained. Here, for example, it is assumed that the minimum value A 0 and the maximum value B 0 shown in FIG. 4 are obtained.
[0024]
Next, based on the obtained minimum value A 0 and maximum value B 0 , the lower limit value A and the upper limit value B of the lightness gradation i for expanding the compressed gradation width are determined. The lower limit A and the upper limit B are used when the minimum value A 0 of the lightness gradation i is not 0 in the original histogram or when the maximum value B 0 is not a full scale value, that is, there is no black or white in the original image. In this case, it is determined by a relationship obtained experimentally or statistically so that black and white do not exist even after the image correction process and the appearance of the image is improved. The relationship can be represented by a curve 70 as shown in FIG. Based on this relationship, based on the minimum value A 0 and the maximum value B 0 of the lightness gradation in the original histogram shown on the horizontal axis, the lower limit value A and the upper limit value of the lightness gradation when the gradation width is expanded shown on the vertical axis. B is determined. In this way, when black or white does not exist in the original image, black or white is prevented from existing in the corrected image. Thus, by expanding the brightness gradation width of the frequency distribution from zero to a full scale value in the method described in Patent Document 1, black and white are generated even in an image that originally does not have black or white, and the appearance of the image Can be prevented from changing greatly.
[0025]
Based on the lower limit value A and the upper limit value B determined in this way, the lightness gradation width of the histogram compressed in step S3 in FIG. 2 is expanded using the following conversion equation (1). At this time, the value of the lightness gradation j is converted by the equation (1), and the value of the pixel number ratio Gj in the lightness gradation j is left as it is, so that the width of the lightness gradation can be expanded. Note that α and β in Expression (1) are the minimum value α and the maximum value β of the lightness gradation j where the pixel number ratio Gj in FIG.
[Expression 1]
C (j) = (j−α) · {(B−A) / (β−α)} + A (1)
Where C (j): lightness gradation after conversion
As described above, the gradation width of the compressed brightness histogram is expanded. FIG. 6 shows an enlargement of the gradation width of the histogram of FIG. 5 by this processing. By enlarging the gradation width in this way, it is possible to enhance the contrast of the image and obtain a good-looking image.
[0027]
In this manner, a lightness histogram with lightness corrected in the lightness histogram creation in step S2, lightness histogram compression in step S3, and lightness histogram expansion in step S4 is created. The same processing is also performed for the saturation in the creation of the saturation histogram in step S5, the saturation histogram compression in step S6, and the expansion of the saturation histogram in step S7, thereby creating a saturation histogram with the corrected saturation. . In this way, by correcting the lightness and the saturation with the respective histograms, by adding the value determined by the lightness correction result in the method described in Patent Document 3 to the saturation, it is possible to reduce the originally low saturation portion. Can prevent over-saturation. In the HSV / RGB conversion in step S8, the corrected image data based on the brightness and saturation histograms are converted from HSV values to RGB values. The converted image data is output from the CPU 3 and stored in the storage device 4 or the image is displayed on the monitor 5.
[0028]
The image processing apparatus described above has the following operational effects.
(1) By correcting the saturation and the brightness based on the saturation histogram and the brightness histogram, respectively, it is possible to improve the contrast of the saturation and the brightness and effectively improve the appearance of the image.
(2) The saturation and brightness are corrected by changing the gradation width of the saturation histogram and the brightness histogram based on the ratio of the number of pixels in the gradation. At this time, if the ratio of the number of pixels in each gradation of the histogram is less than the set threshold value, the gradation width is compressed, thereby expanding the entire gradation width of the histogram in which a part of the gradation width is compressed. To correct the saturation and brightness respectively. Since it did in this way, since saturation and lightness can be correct | amended according to the pixel number ratio in each gradation of the histogram, the contrast of saturation and lightness can be improved appropriately according to an image.
(3) Minimum and maximum gradation values in which the pixel number ratio is not 0 in the histogram when the gradation width is expanded based on the minimum and maximum gradation values in which the pixel number ratio is not 0 in the histogram before gradation width compression If the former gradation value is not 0 or a full scale value, the latter gradation value is set to 0 or a value other than the full scale value. Since it did in this way, when black and white do not exist in an original image, black and white do not exist after an image correction process, and the appearance of an image can be improved.
(4) Since the threshold value is set so that the ratio of the number of pixels that is less than the threshold value in the histogram becomes a predetermined ratio of the entire histogram, the image correction process can be easily performed without a troublesome operation by the user. Can be executed.
[0029]
In the embodiment described above, the image correction processing program executed to realize the present invention is recorded on the recording medium of the storage device 4, and an example in which the CPU 3 executes this image correction processing program will be described. However, the present invention is not limited to this content. For example, the image correction processing program as described above may be stored in the input device 1 and executed. Further, this image correction processing program may be taken into a personal computer or an input device using a recording medium. Alternatively, the image correction processing program may be taken into a personal computer or an input device through an electric communication line such as the Internet.
[0030]
In the embodiment described above, the input unit is realized by the input device 1, and the conversion unit, the histogram creation unit, the histogram compression unit, and the histogram enlargement unit are realized by the CPU 3. However, these are merely examples, and each component is not limited to the above-described embodiment as long as the characteristics of the present invention are not impaired.
[0031]
【The invention's effect】
According to the present invention, since it is configured as described above, it is possible to effectively improve the appearance of a color image.
[Brief description of the drawings]
FIG. 1 is a diagram showing an embodiment of an image processing apparatus according to the present invention. FIG. 2 is a diagram showing a flowchart of an image correction processing program. FIG. 3 is a diagram showing a subroutine processing flowchart in lightness histogram compression. FIG. 5 is a diagram showing an example of a brightness histogram with a compressed gradation width. FIG. 6 is a diagram showing an example of a brightness histogram with an expanded compressed gradation width. The figure which shows the example of the relationship between the minimum value and the maximum value of the lightness gradation when the pixel number ratio in the lightness histogram is 0, and the minimum value and the maximum value of the lightness gradation when expanding the compressed gradation width Explanation of]
1: Input device 2: Interface 3: CPU
4: Storage device 5: Monitor 6: Bus line

Claims (10)

カラー画像データを入力する入力手段と、
前記カラー画像データを色相、彩度および明度に変換する変換手段と、
前記彩度および明度について総画素数に対する各階調ごとの画素数比率をそれぞれ計算し、彩度ヒストグラムと明度ヒストグラムを作成するヒストグラム作成手段とを備え、
前記彩度ヒストグラムおよび明度ヒストグラムに基づいて前記彩度および明度をそれぞれ補正することにより、前記彩度および明度のコントラストを改善することを特徴とする画像処理装置。
Input means for inputting color image data;
Conversion means for converting the color image data into hue, saturation and brightness;
Histogram creation means for calculating a ratio of the number of pixels for each gradation with respect to the total number of pixels for the saturation and brightness, and creating a saturation histogram and a brightness histogram,
An image processing apparatus, wherein the saturation and brightness contrast are improved by correcting the saturation and brightness based on the saturation histogram and the brightness histogram, respectively.
請求項1の画像処理装置において、
前記彩度ヒストグラムおよび明度ヒストグラムの階調の幅をその階調における画素数比率に基づいて変更することにより、前記彩度および明度をそれぞれ補正することを特徴とする画像処理装置。
The image processing apparatus according to claim 1.
An image processing apparatus, wherein the saturation and brightness are respectively corrected by changing a gradation width of the saturation histogram and the brightness histogram based on a pixel number ratio in the gradation.
請求項2の画像処理装置において、
前記彩度ヒストグラムおよび明度ヒストグラムの各階調における画素数比率に対してそれぞれしきい値を設定し、しきい値未満である場合はその階調の幅を圧縮するヒストグラム圧縮手段と、
前記ヒストグラム圧縮手段により階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大するヒストグラム拡大手段とをさらに備え、
前記ヒストグラム圧縮手段およびヒストグラム拡大手段により前記彩度および明度をそれぞれ補正することを特徴とする画像処理装置。
The image processing apparatus according to claim 2.
Histogram compression means for setting a threshold value for the ratio of the number of pixels in each gradation of the saturation histogram and the lightness histogram, and compressing the gradation width when it is less than the threshold value;
A histogram expansion unit that expands a width of the entire gradation with respect to the saturation histogram and the lightness histogram in which a part of the gradation width is compressed by the histogram compression unit, and
An image processing apparatus, wherein the saturation and lightness are corrected by the histogram compression means and histogram enlargement means, respectively.
請求項3の画像処理装置において、
前記ヒストグラム拡大手段は、前記ヒストグラム圧縮手段により階調の幅を圧縮される前の彩度ヒストグラムおよび明度ヒストグラムにおける前記画素数比率が0でない最小と最大の階調値に基づいて、前記ヒストグラム拡大手段により階調全体の幅を拡大された彩度ヒストグラムおよび明度ヒストグラムにおける前記画素数比率が0でない最小と最大の階調値を決定し、
前記階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける前記最小の階調値が0でないときは、その階調値を0以外の値に決定し、
前記階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける前記最大の階調値がフルスケール値でないときは、その階調値をフルスケール値以外の値に決定し、
前記決定された最小および最大の階調値に基づいて、前記ヒストグラム圧縮手段により階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大することを特徴とする画像処理装置。
The image processing apparatus according to claim 3.
The histogram enlargement means is based on the minimum and maximum gradation values in which the pixel number ratio is not 0 in the saturation histogram and the brightness histogram before the gradation width is compressed by the histogram compression means. Determining the minimum and maximum gradation values in which the ratio of the number of pixels in the saturation histogram and the lightness histogram in which the width of the entire gradation is expanded is not 0,
When the minimum gradation value in the saturation histogram or lightness histogram before compression of the gradation width is not 0, the gradation value is determined to a value other than 0,
When the maximum gradation value in the saturation histogram or lightness histogram before compression of the gradation width is not a full scale value, the gradation value is determined to a value other than the full scale value,
Based on the determined minimum and maximum gradation values, with respect to the saturation histogram and lightness histogram in which a part of the gradation width is compressed by the histogram compression means, the width of the entire gradation is expanded. A featured image processing apparatus.
請求項3または4の画像処理装置において、
前記ヒストグラム圧縮手段は、前記彩度ヒストグラムまたは明度ヒストグラムにおいて前記しきい値未満となる画素数比率がそのヒストグラム全体の所定割合となるように、前記しきい値を設定することを特徴とする画像処理装置。
The image processing apparatus according to claim 3 or 4,
The histogram compression means sets the threshold value such that a ratio of the number of pixels that is less than the threshold value in the saturation histogram or brightness histogram is a predetermined ratio of the entire histogram. apparatus.
画像データを入力する入力ステップと、
前記画像データを色相、彩度および明度に変換する変換ステップと、
前記彩度および明度について総画素数に対する各階調ごとの画素数比率をそれぞれ計算し、彩度ヒストグラムと明度ヒストグラムを作成するヒストグラム作成ステップと、
前記彩度ヒストグラムおよび明度ヒストグラムに基づいて前記彩度および明度をそれぞれ補正することにより、前記彩度および明度のコントラストを改善する補正ステップとをコンピュータで実行するためのカラー画像の画像補正プログラム。
An input step for inputting image data;
A conversion step of converting the image data into hue, saturation and brightness;
A histogram creation step of calculating a ratio of the number of pixels for each gradation with respect to the total number of pixels for the saturation and brightness, and creating a saturation histogram and a brightness histogram;
An image correction program for a color image for executing, by a computer, a correction step for improving the saturation and brightness contrast by correcting the saturation and brightness based on the saturation histogram and brightness histogram, respectively.
請求項6の画像補正プログラムにおいて、
前記補正ステップでは、前記彩度ヒストグラムおよび明度ヒストグラムの階調の幅をその階調における画素数比率に基づいて変更することにより、前記彩度および明度をそれぞれ補正することを特徴とするカラー画像の画像補正プログラム。
In the image correction program of claim 6,
In the correction step, the saturation and the brightness are corrected by changing the gradation width of the saturation histogram and the brightness histogram based on the pixel number ratio in the gradation, respectively. Image correction program.
請求項7の画像補正プログラムにおいて、
前記補正ステップは、前記彩度ヒストグラムおよび明度ヒストグラムの各階調における画素数比率に対してそれぞれしきい値を設定し、しきい値未満である場合はその階調の幅を圧縮するヒストグラム圧縮ステップと、
前記ヒストグラム圧縮ステップにより階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大するヒストグラム拡大ステップとからなり、
前記ヒストグラム圧縮ステップおよびヒストグラム拡大ステップにより前記彩度および明度をそれぞれ補正することを特徴とするカラー画像の画像補正プログラム。
In the image correction program of claim 7,
The correction step sets a threshold value for the ratio of the number of pixels in each gradation of the saturation histogram and the lightness histogram, and compresses the width of the gradation when it is less than the threshold value; ,
A saturation histogram and a lightness histogram in which a part of the gradation width is compressed by the histogram compression step, and a histogram expansion step for expanding the entire gradation width,
An image correction program for a color image, wherein the saturation and brightness are corrected by the histogram compression step and the histogram expansion step, respectively.
請求項8の画像補正プログラムにおいて、
前記ヒストグラム拡大ステップは、前記ヒストグラム圧縮ステップにより階調の幅を圧縮される前の彩度ヒストグラムおよび明度ヒストグラムにおける前記画素数比率が0でない最小と最大の階調値に基づいて、前記ヒストグラム拡大ステップにより階調全体の幅を拡大された彩度ヒストグラムおよび明度ヒストグラムにおける前記画素数比率が0でない最小と最大の階調値を決定し、
前記階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける前記最小の階調値が0でないときは、その階調値を0以外の値に決定し、
前記階調の幅を圧縮される前の彩度ヒストグラムまたは明度ヒストグラムにおける前記最大の階調値がフルスケール値でないときは、その階調値をフルスケール値以外の値に決定し、
前記決定された最小および最大の階調値に基づいて、前記ヒストグラム圧縮ステップにより階調の幅の一部を圧縮された彩度ヒストグラムおよび明度ヒストグラムについて、その階調全体の幅を拡大することを特徴とするカラー画像の画像補正プログラム。
The image correction program according to claim 8, wherein
The histogram expansion step is based on the minimum and maximum gradation values in which the pixel number ratio is not 0 in the saturation histogram and the brightness histogram before the gradation width is compressed by the histogram compression step. Determining the minimum and maximum gradation values in which the ratio of the number of pixels in the saturation histogram and the lightness histogram in which the width of the entire gradation is expanded is not 0,
When the minimum gradation value in the saturation histogram or lightness histogram before compression of the gradation width is not 0, the gradation value is determined to a value other than 0,
When the maximum gradation value in the saturation histogram or lightness histogram before compression of the gradation width is not a full scale value, the gradation value is determined to a value other than the full scale value,
Based on the determined minimum and maximum gradation values, for the saturation histogram and lightness histogram in which a part of the gradation width is compressed by the histogram compression step, the width of the entire gradation is expanded. An image correction program for featured color images.
請求項8または9の画像補正プログラムにおいて、
前記ヒストグラム圧縮ステップは、前記彩度ヒストグラムまたは明度ヒストグラムにおいて前記しきい値未満となる画素数比率がそのヒストグラム全体の所定割合となるように、前記しきい値を設定することを特徴とするカラー画像の画像補正プログラム。
The image correction program according to claim 8 or 9,
The histogram compression step sets the threshold value such that a ratio of the number of pixels that is less than the threshold value in the saturation histogram or the brightness histogram is a predetermined ratio of the entire histogram. Image correction program.
JP2003180684A 2003-06-25 2003-06-25 Image processing apparatus, image correction program, and recording medium Pending JP2006237657A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2003180684A JP2006237657A (en) 2003-06-25 2003-06-25 Image processing apparatus, image correction program, and recording medium
PCT/JP2004/008809 WO2005002205A1 (en) 2003-06-25 2004-06-23 Image processing device and image correction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003180684A JP2006237657A (en) 2003-06-25 2003-06-25 Image processing apparatus, image correction program, and recording medium

Publications (1)

Publication Number Publication Date
JP2006237657A true JP2006237657A (en) 2006-09-07

Family

ID=33549506

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003180684A Pending JP2006237657A (en) 2003-06-25 2003-06-25 Image processing apparatus, image correction program, and recording medium

Country Status (2)

Country Link
JP (1) JP2006237657A (en)
WO (1) WO2005002205A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008099288A (en) * 2006-10-12 2008-04-24 Samsung Electronics Co Ltd Apparatus and method for calibrating gray data
JP2011077775A (en) * 2009-09-30 2011-04-14 Seiko Epson Corp Image processing apparatus, image output device, image processing method and program
US8558927B2 (en) 2007-03-26 2013-10-15 Nikon Corporation Image processing apparatus having a gradation conversion unit that executes gradation conversion processing, and image processing method for the same
CN111787181A (en) * 2016-02-05 2020-10-16 Nec平台株式会社 Image data conversion device, image data conversion method, image data conversion program, POS terminal device, and server
CN113160087A (en) * 2021-04-29 2021-07-23 平安科技(深圳)有限公司 Image enhancement method and device, computer equipment and storage medium

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1750143A3 (en) * 2005-07-27 2009-09-09 Medison Co., Ltd. Ultrasound diagnostic system and method of automatically controlling brightness and contrast of a three-dimensional ultrasound image
DE102007022888B3 (en) * 2007-05-14 2008-11-27 Olympus Winter & Ibe Gmbh Method and device for image processing of endoscope images
CN104268548B (en) * 2014-09-01 2017-10-24 西南交通大学 A kind of accumulated snow detection method based on road image
CN105118029A (en) * 2015-08-11 2015-12-02 曲阜裕隆生物科技有限公司 Medical image enhancement method based on human eye visual characteristic
CN116017171B (en) * 2023-02-01 2023-06-20 北京小米移动软件有限公司 Image processing method and device, electronic equipment, chip and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1023279A (en) * 1996-06-28 1998-01-23 Fuji Xerox Co Ltd Image-processing unit
JP4069333B2 (en) * 1996-11-13 2008-04-02 セイコーエプソン株式会社 Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP3985109B2 (en) * 1996-11-21 2007-10-03 セイコーエプソン株式会社 Image processing apparatus, image processing method, and medium on which image processing program is recorded
JP3502828B2 (en) * 1999-11-16 2004-03-02 株式会社日本ソフトウエアプロダクツ Computer image processing system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008099288A (en) * 2006-10-12 2008-04-24 Samsung Electronics Co Ltd Apparatus and method for calibrating gray data
US8705152B2 (en) 2006-10-12 2014-04-22 Samsung Electronics Co., Ltd. System, medium, and method calibrating gray data
US8558927B2 (en) 2007-03-26 2013-10-15 Nikon Corporation Image processing apparatus having a gradation conversion unit that executes gradation conversion processing, and image processing method for the same
JP2011077775A (en) * 2009-09-30 2011-04-14 Seiko Epson Corp Image processing apparatus, image output device, image processing method and program
CN111787181A (en) * 2016-02-05 2020-10-16 Nec平台株式会社 Image data conversion device, image data conversion method, image data conversion program, POS terminal device, and server
CN111787181B (en) * 2016-02-05 2022-06-10 Nec平台株式会社 Image data conversion device, image data conversion method, image data conversion program, POS terminal device, and server
CN113160087A (en) * 2021-04-29 2021-07-23 平安科技(深圳)有限公司 Image enhancement method and device, computer equipment and storage medium
CN113160087B (en) * 2021-04-29 2024-03-19 平安科技(深圳)有限公司 Image enhancement method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
WO2005002205A1 (en) 2005-01-06

Similar Documents

Publication Publication Date Title
JP3759761B2 (en) Method and apparatus for changing sharpness
EP3280138B1 (en) Image processing apparatus, image projection apparatus, and image processing method
JP4814217B2 (en) System and computer program for converting image from low dynamic range to high dynamic range
JP4167097B2 (en) Image processing method and image processing apparatus
US7580566B2 (en) Image processing device, image processing method, storage medium, and program
TW520601B (en) Method and system of local color correction using background luminance masking
US8050514B2 (en) Image processing apparatus and image processing method
JP2003179756A (en) Method for processing data from digital image and program product
JP3959909B2 (en) White balance adjustment method and adjustment device
JP4262151B2 (en) Image processing method, image processing apparatus, computer program, and storage medium
US8957991B2 (en) Imaging apparatus, image processing method and computer program for smoothing dynamic range of luminance of an image signal, color conversion process
JP2005039460A (en) Image processing method and apparatus
JP2006237657A (en) Image processing apparatus, image correction program, and recording medium
US5978106A (en) Picture image processing method
JP2008072551A (en) Image processing method, image processing apparatus, program and recording medium
JP4289225B2 (en) Image processing apparatus and image processing method
JP2002288650A (en) Image processing device, digital camera, image processing method and recording medium
JP2005348159A (en) Image processing method and apparatus, program, and storage medium
JP4219577B2 (en) Image processing apparatus, image output apparatus, image processing method, and storage medium
JP2000092337A (en) Image processing method, its device and recording medium
JP4507338B2 (en) Image correction apparatus and recording medium on which image correction program is recorded
JP2002094810A (en) Picture processor, picture processing method and memory medium having stored programs for the method
JP2000032287A (en) Image processor and image processing method
JP4237555B2 (en) Image correction method and image correction apparatus
JP2004328534A (en) Image forming method, image processing apparatus and image recording apparatus