JP2008048188A - Image processing program, and image processing unit - Google Patents
Image processing program, and image processing unit Download PDFInfo
- Publication number
- JP2008048188A JP2008048188A JP2006222307A JP2006222307A JP2008048188A JP 2008048188 A JP2008048188 A JP 2008048188A JP 2006222307 A JP2006222307 A JP 2006222307A JP 2006222307 A JP2006222307 A JP 2006222307A JP 2008048188 A JP2008048188 A JP 2008048188A
- Authority
- JP
- Japan
- Prior art keywords
- image
- reduced
- value
- retinex
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012545 processing Methods 0.000 title claims abstract description 91
- 230000009467 reduction Effects 0.000 claims abstract description 10
- 238000000034 method Methods 0.000 claims description 70
- 238000010606 normalization Methods 0.000 claims description 62
- 238000012937 correction Methods 0.000 claims description 29
- 230000002093 peripheral effect Effects 0.000 claims description 14
- 238000005070 sampling Methods 0.000 claims description 11
- 238000003702 image correction Methods 0.000 claims description 2
- 238000002310 reflectometry Methods 0.000 claims 2
- 239000000284 extract Substances 0.000 claims 1
- 230000008569 process Effects 0.000 description 34
- 230000000694 effects Effects 0.000 description 22
- 238000007781 pre-processing Methods 0.000 description 7
- 239000003086 colorant Substances 0.000 description 3
- 238000012805 post-processing Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 2
- 239000000470 constituent Substances 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
- Editing Of Facsimile Originals (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
Description
本発明は、画像処理プログラムおよび画像処理装置に関し、特にレティネックス処理を高速で行うことができる画像処理プログラムおよび画像処理装置に関するものである。 The present invention relates to an image processing program and an image processing apparatus, and more particularly to an image processing program and an image processing apparatus capable of performing Retinex processing at high speed.
逆光条件下で被写体が撮像された場合、被写体部分の画像は、詳細な態様が判別困難となるほど明度やコントラストの低い不明瞭な逆光画像となる。かかる逆光画像のみならず、露光の過不足や、撮像時のぶれやぼけ、ノイズ、光量不足などによる劣悪な画像を、画像処理によって明度やコントラストを向上させて画質を改良することが行われている。かかる画像処理の1手法として、レティネックス処理(Retinex処理)が知られている。 When a subject is imaged under backlight conditions, the image of the subject portion becomes an unclear backlight image with low brightness and contrast as the detailed mode becomes difficult to distinguish. In addition to such backlit images, poor images due to overexposure or underexposure, blurring or blurring during shooting, noise, insufficient light quantity, etc. are being used to improve image quality by improving brightness and contrast through image processing. Yes. As one method of such image processing, Retinex processing (Retinex processing) is known.
レティネックス処理は、高画質部分については入力画像データを保持し、主に低画質部分の画質改良を行うものである。このレティネックス処理では、ガウスフィルタにより、元の画像の各画素データを周辺画素の画素データを反映させた値に補正し、その補正された画素データの自然対数から元の画像のリファレンス成分データを算出し、元画像の画素成分で元の画像の画素データを除してイルミナンス成分データを算出する。つまり、元の画像を、リファレンス成分とイルミナンス成分との2の構成成分に分けるのである。そして、イルミナンス成分に対してガンマ補正等の明度や階調(コントラスト)を補正する処理を行った後、その補正されたイルミナンス成分と、リファレンス成分とを合成することにより、元の画像に対し逆光画像部分などの低画質部分の画質が改良された画像データを生成することができる。リファレンス成分を求めるには、反射率R(x,y)の正規化を行う。 In the Retinex process, the input image data is held for the high-quality part, and the image quality is mainly improved for the low-quality part. In this Retinex processing, each pixel data of the original image is corrected to a value reflecting the pixel data of the surrounding pixels by a Gaussian filter, and the reference component data of the original image is obtained from the natural logarithm of the corrected pixel data. The illuminance component data is calculated by dividing the pixel data of the original image by the pixel component of the original image. That is, the original image is divided into two constituent components, a reference component and an illuminance component. Then, after performing processing for correcting the brightness and gradation (contrast) such as gamma correction for the illuminance component, the corrected illuminance component and the reference component are combined, and the original image is backlit. Image data in which the image quality of a low image quality portion such as an image portion is improved can be generated. In order to obtain the reference component, the reflectance R (x, y) is normalized.
ここで、図4を参照して、反射率R(x,y)の正規化について説明する。反射率R(x,y)は、次式により算出される。 Here, normalization of the reflectance R (x, y) will be described with reference to FIG. The reflectance R (x, y) is calculated by the following equation.
図4は、ある静止画像について、上式により求められた反射率R(x,y)の最小値を0、最大値を255とする0から255の範囲の整数値に正規化し、各整数の出現頻度を集計したヒストグラムである。 FIG. 4 shows the normalization of an integer value in the range of 0 to 255, where 0 is the minimum value of the reflectance R (x, y) obtained by the above equation and 255 is the maximum value. It is the histogram which totaled appearance frequency.
このヒストグラムからメディアン値Mを求め、メディアン値から大きい側へ45%の画素数を含む範囲の上限値をU、メディアン値から小さい側へ45%の画素数を含む範囲の下限値をDとする。 The median value M is obtained from this histogram, the upper limit value of the range including 45% of pixels from the median value to the larger side is U, and the lower limit value of the range including 45% of pixels from the median value to the smaller side is D. .
UおよびDの値に対応するR(x,y)の値を、UpR、DownRとし、正規化反射率(正規化レティネックス値)refle(x,y)は、R(x,y)の値がDownR以下の場合は、0.0とし、R(x,y)の値がUpR以上の場合は、1.0とし、R(x,y)の値がDownRより大きくUpRより小さい場合は、 The values of R (x, y) corresponding to the values of U and D are UpR and DownR, and the normalized reflectance (normalized Retinex value) refle (x, y) is the value of R (x, y). Is 0.0 when the value is equal to or less than DownR, 1.0 when the value of R (x, y) is equal to or greater than UpR, and when the value of R (x, y) is greater than DownR and smaller than UpR,
このように処理するとrefle(x,y)は、0.0から1.0の間の値を取るように正規化される。実験によれば、こうして得られた値に、0.3を加算し、refle(x,y)の値が0.3から1.3の値を取るようにするのがよいことが判明している。 When processed in this way, refle (x, y) is normalized to take a value between 0.0 and 1.0. Experiments have shown that it is better to add 0.3 to the value thus obtained so that the value of refle (x, y) takes a value from 0.3 to 1.3. Yes.
このようにしてrefle(x,y)が求められるので、クリップされる範囲(以下、クリップ範囲と称す:UpRとDownRとの間)を求めるため、R(x,y)を全画素分記憶しなければならない。尚かつ、R(x,y)は、対数演算により求まる数値であるので、小数点を用いて記録する必要があり、浮動小数点では、4バイト、倍精度実数の場合には8バイトで画素毎に記憶するため膨大な記憶容量が必要である。 Since refle (x, y) is obtained in this way, R (x, y) is stored for all pixels in order to obtain a clipped range (hereinafter referred to as clip range: between UpR and DownR). There must be. Moreover, R (x, y) is a numerical value obtained by logarithmic calculation, so it must be recorded using a decimal point. For floating point, it is 4 bytes, and for double precision real numbers, 8 bytes for each pixel. In order to memorize | store, a huge memory capacity is required.
特開2001−69525号公報(特許文献1)には、このレティネックス処理をRGBの各プレーンで独立に行った場合に、カラーバランスが崩れたり色ずれが発生するという問題点を解決するために、RGB値をYCbCrやYIQという輝度成分と色成分により構成される座標空間に変換し、輝度成分Yに対してのみレティネックス処理を施し、色成分を維持したまま、RGBに戻すという方法が開示されている。この方法を用いると輝度成分のみが調整され、色成分は調整されないのでカラーバランスが崩れたり色ずれが発生することがない。また、この方法では、輝度成分のみにレティネックス処理を行うので、RGBの各プレーンそれぞれにレティネックス処理を行う場合に比べ、計算量が少なく、高速で処理を実行することができとともに、R(x,y)を正規化するために、RGBそれぞれについて記憶する必要がなく、輝度のみについて記憶すればよいので、必要な記憶容量は少なくなる。 Japanese Patent Laid-Open No. 2001-69525 (Patent Document 1) discloses a solution to the problem that color balance is lost or color misregistration occurs when this Retinex process is performed independently for each of the RGB planes. Discloses a method of converting RGB values into a coordinate space composed of luminance components and color components such as YCbCr and YIQ, performing Retinex processing only on the luminance component Y, and returning to RGB while maintaining the color components. Has been. When this method is used, only the luminance component is adjusted, and the color component is not adjusted, so that the color balance is not lost and color shift does not occur. Further, in this method, since the Retinex process is performed only on the luminance component, the calculation amount is small and the process can be executed at a high speed as compared with the case where the Retinex process is performed on each of the RGB planes. In order to normalize x, y), it is not necessary to store each of RGB, and only the luminance needs to be stored, so that the necessary storage capacity is reduced.
また、特許3731577号(特許文献2)には、このレティネックス処理の処理速度を高速にする方法が開示されている。この方法は、元画像を平均画素法などの方法により縮小画像(解像度が低い)を形成し、その縮小画像の各画素について周辺平均輝度を求めた周辺平均輝度画像(ボケ画像)を形成し、そのボケ画像を拡大した画像と元画像からレティネックス処理画像を形成し、更に、そのレティネックス処理画像と元画像とから出力画像を形成している。
しかしながら、従来の文献に開示された処理では、反射率を記憶するメモリのサイズが依然として大きいという問題点と、処理された画像を出力する際に、処理を開始してから画像の出力開始までの時間が長いという問題点とがあった。 However, in the processing disclosed in the conventional literature, the problem is that the size of the memory for storing the reflectance is still large, and when the processed image is output, from the start of the processing to the start of image output. There was a problem that time was long.
本発明は、上記問題点を解決するためになされたものであり、レティネックス処理を高速で行うことができる画像処理プログラムおよび画像処理装置を提供することを目的としている。 The present invention has been made to solve the above problems, and an object thereof is to provide an image processing program and an image processing apparatus capable of performing Retinex processing at high speed.
この目的を達成するために、請求項1記載の画像処理プログラムは、画像の補正処理を行う画像処理装置により実行されるものであり、元画像を縮小した縮小画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求めることにより縮小レティネックス画像を形成する縮小レティネックス画像形成ステップと、その縮小レティネックス画像形成ステップにより形成された縮小レティネックス画像の画素値が取る値の全範囲における各画素値の頻度を集計し、正規化を行う際の上限値および下限値を設定する正規化パラメータ設定ステップと、前記元画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う補正ステップとを備えている。
In order to achieve this object, the image processing program according to
請求項2記載の画像処理プログラムは、請求項1記載の画像処理プログラムにおいて、前記縮小レティネックス画像形成ステップは、元画像から縮小画像を形成するために最近傍法により画素を抽出するサンプリングステップと、そのサンプリングステップにより抽出された画素の値とフィルタ係数との畳み込み演算を行う演算ステップとを備えている。
The image processing program according to
請求項3記載の画像処理プログラムは、請求項1記載の画像処理プログラムにおいて、前記縮小レティネックス画像形成ステップは、元画像を平均画素法により縮小する画像縮小ステップと、その縮小ステップにより縮小された画像の画素とフィルタ係数との畳み込み演算を行う演算ステップとを備えている。
The image processing program according to claim 3 is the image processing program according to
請求項4記載の画像処理プログラムは、請求項1から3のいずれかに記載の画像処理プログラムにおいて、前記縮小レティネックス画像形成ステップにより形成された縮小レティネックス画像を記憶する記憶手段を備え、前記正規化パラメータ設定ステップは、前記記憶手段に記憶された縮小レティネックス画像に基づいて正規化を行う際の上限値および下限値を設定する。
The image processing program according to
請求項5記載の画像処理プログラムは、請求項1から4のいずれかに記載の画像処理プログラムにおいて、前記縮小レティネックス画像形成ステップは、前記縮小画像から分離された輝度信号のみについて縮小レティネックス画像を形成し、前記補正ステップは、元画像から分離された輝度信号のみについて反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う。
The image processing program according to
請求項6記載の画像処理プログラムは、請求項1から5のいずれかに記載の画像処理プログラムにおいて、前記補正ステップにより補正された画素値を出力する出力ステップを備えている。 An image processing program according to a sixth aspect includes an output step of outputting the pixel value corrected by the correction step in the image processing program according to any one of the first to fifth aspects.
請求項7記載の画像処理プログラムは、請求項1から6のいずれかに記載の画像処理プログラムにおいて、前記正規化パラメータ設定ステップは、全画素が取る値の最大値から最小値の範囲の値のうち、全画素に対する所定の割合の画素を含むクリップ範囲の上限値と下限値とを正規化パラメータとして設定する。
The image processing program according to claim 7 is the image processing program according to any one of
請求項8記載の画像処理装置は、画像の補正を行うものであり、元画像を縮小した縮小画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求めることにより縮小レティネックス画像を形成する縮小レティネックス画像形成手段と、その縮小レティネックス画像形成手段により形成された縮小レティネックス画像の画素値が取る値の全範囲における各画素値の頻度を集計し、正規化を行う際の上限値および下限値を設定する正規化パラメータ設定手段と、前記元画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う補正手段とを備えている。 The image processing apparatus according to claim 8, which corrects an image, reduces each pixel of a reduced image obtained by reducing the original image by obtaining a reflectance from a pixel value and a peripheral average luminance of the pixel. Reduced Retinex image forming means for forming Retinex images and normalization by summing up the frequency of each pixel value in the whole range of values taken by the pixel values of the reduced Retinex image formed by the reduced Retinex image forming means Normalization parameter setting means for setting an upper limit value and a lower limit value when performing the process, and for each pixel of the original image, the reflectance is obtained from the pixel value and the peripheral average luminance of the pixel, and the reflectance is calculated as the normality A normalized Retinex value normalized based on the upper limit value and the lower limit value set in the normalization parameter setting step, and the normalized Retinex value; And a correcting means for correcting, based on the pixel values of the image.
請求項9記載の画像処理装置は、請求項8記載の画像処理装置において、前記縮小レティネックス画像形成手段は、元画像から縮小画像を形成するために最近傍法により画素を抽出するサンプリング手段と、そのサンプリング手段により抽出された画素の値とフィルタ係数との畳み込み演算を行う演算手段とを備えている。
The image processing apparatus according to
請求項10記載の画像処理装置は、請求項8記載の画像処理装置において、前記縮小レティネックス画像形成手段は、元画像を平均画素法により縮小する画像縮小手段と、その画像縮小手段により縮小された画像の画素とフィルタ係数との畳み込み演算を行う演算手段とを備えている。 The image processing apparatus according to claim 10 is the image processing apparatus according to claim 8, wherein the reduced Retinex image forming means is reduced by an image reducing means for reducing the original image by an average pixel method and the image reducing means. Arithmetic means for performing a convolution operation between the pixels of the image and the filter coefficient.
請求項11記載の画像処理装置は、請求項8から10のいずれかに記載の画像処理装置において、前記縮小レティネックス画像形成手段により形成された縮小レティネックス画像を記憶する記憶手段を備え、前記正規化パラメータ設定手段は、前記記憶手段に記憶された縮小レティネックス画像に基づいて正規化を行う際の上限値および下限値を取得するものである。
The image processing device according to
請求項12記載の画像処理装置は、請求項8から11のいずれかに記載の画像処理装置において、前記縮小レティネックス画像形成手段は、前記縮小画像から分離された輝度信号のみについて縮小レティネックス画像を形成し、前記補正手段は、元画像から分離された輝度信号のみについて反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う。
The image processing device according to
請求項13記載の画像処理装置は、請求項8から12のいずれかに記載の画像処理装置において、前記補正手段により補正された画素値を出力する出力手段を備えている。 An image processing apparatus according to a thirteenth aspect is the image processing apparatus according to any one of the eighth to twelfth aspects, further comprising an output unit that outputs a pixel value corrected by the correction unit.
請求項14記載の画像処理装置は、請求項8から13のいずれかに記載の画像処理装置において、前記正規化パラメータ設定手段は、全画素が取る値の最大値から最小値の範囲の値のうち、全画素に対する所定の割合の画素を含むクリップ範囲の上限値と下限値とを正規化パラメータとして設定する。 The image processing device according to claim 14 is the image processing device according to any one of claims 8 to 13, wherein the normalization parameter setting means has a value in a range from a maximum value to a minimum value of all the pixels. Among these, an upper limit value and a lower limit value of a clip range including a predetermined ratio of pixels with respect to all pixels are set as normalization parameters.
請求項1記載の画像処理プログラムによれば、元画像を縮小した縮小画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求めることにより縮小レティネックス画像を形成する縮小レティネックス画像形成ステップと、その縮小レティネックス画像形成ステップにより形成された縮小レティネックス画像の画素値が取る値の全範囲における各画素値の頻度を集計し、正規化を行う際の上限値および下限値(クリップ範囲)を設定する正規化パラメータ設定ステップと、元画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求め、その反射率を正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う補正ステップとを備えているので、周辺平均輝度を求める際に行う畳み込み演算における演算数が少なく、処理を高速で行うことができる。また、上限値および下限値の正規化パラメータを設定する際の対象となる画素数が少ないので高速で、クリップ範囲を決定することができる。
According to the image processing program of
請求項2記載の画像処理プログラムによれば、請求項1記載の画像処理プログラムの奏する効果に加え、縮小レティネックス画像形成ステップは、元画像から縮小画像を形成するために最近傍法により画素を抽出するサンプリングステップと、そのサンプリングステップにより抽出された画素の値とフィルタ係数との畳み込み演算を行う演算ステップとを備えているので、画像を縮小する演算を、平均画素法などに比べ高速で行うことができるという効果がある。 According to the image processing program of the second aspect, in addition to the effect produced by the image processing program of the first aspect, the reduced Retinex image forming step performs the pixel calculation by the nearest neighbor method in order to form a reduced image from the original image. Since it has a sampling step to extract and a calculation step to perform a convolution operation of the pixel value extracted by the sampling step and the filter coefficient, the image reduction operation is performed at a higher speed than the average pixel method or the like There is an effect that can be.
請求項3記載の画像処理プログラムによれば、請求項1記載の画像処理プログラムの奏する効果に加え、縮小レティネックス画像形成ステップは、元画像を平均画素法により縮小する画像縮小ステップと、その縮小ステップにより縮小された画像の画素とフィルタ係数との畳み込み演算を行う演算ステップとを備えているので、最近傍法などに比べ、縮小画像の画質が良好であり、正規化を行う際の上限値および下限値をより正確に決定することができるという効果がある。
According to the image processing program of claim 3, in addition to the effect of the image processing program of
請求項4記載の画像処理プログラムによれば、請求項1から3のいずれかに記載の画像処理プログラムの奏する効果に加え、縮小レティネックス画像形成ステップにより形成された縮小レティネックス画像を記憶する記憶手段を備え、正規化パラメータ設定ステップは、記憶手段に記憶された縮小レティネックス画像に基づいて正規化を行う際の上限値および下限値を設定する。 According to the image processing program of the fourth aspect, in addition to the effect produced by the image processing program according to any one of the first to third aspects, the storage for storing the reduced Retinex image formed by the reduced Retinex image forming step. And a normalization parameter setting step sets an upper limit value and a lower limit value for normalization based on the reduced Retinex image stored in the storage means.
元画像に基づいてレティネックス画像を形成して記憶する場合は、大きな記憶容量を必要とするが、縮小画像に基づく縮小レティネックス画像を記憶するので、記憶容量を小さくすることができるという効果がある。 When a Retinex image is formed and stored based on the original image, a large storage capacity is required. However, since the reduced Retinex image based on the reduced image is stored, the storage capacity can be reduced. is there.
請求項5記載の画像処理プログラムによれば、請求項1から4のいずれかに記載の画像処理プログラムの奏する効果に加え、縮小レティネックス画像形成ステップは、前記縮小画像から分離された輝度信号のみについて縮小レティネックス画像を形成し、前記補正ステップは、元画像から分離された輝度信号のみについて反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行うので、RGB値それぞれについてレティネックス処理を行う場合に比べ、色ずれの発生を防止することができるとともに、演算量が減るので高速で演算することができるという効果がある。 According to the image processing program of the fifth aspect, in addition to the effect produced by the image processing program according to any one of the first to fourth aspects, the reduced Retinex image forming step includes only a luminance signal separated from the reduced image. A reduced Retinex image is formed, and the correction step obtains the reflectance only for the luminance signal separated from the original image, and the reflectance is based on the upper limit value and the lower limit value set by the normalization parameter setting step. Normalized Retinex values obtained by normalization and correction is performed based on the normalized Retinex values and the pixel values of the original image. In addition to being able to prevent the occurrence, there is an effect that the calculation amount can be reduced because the calculation amount is reduced.
請求項6記載の画像処理プログラムによれば、請求項1から5のいずれかに記載の画像処理プログラムの奏する効果に加え、補正ステップにより補正された画素値を出力する出力ステップを備えているので、レティネックス処理を開始してから、出力ステップにより補正された画像の出力が開始されるまでの時間が短いという効果がある。 According to the image processing program of the sixth aspect, in addition to the effect produced by the image processing program according to any one of the first to fifth aspects, an output step for outputting the pixel value corrected by the correction step is provided. There is an effect that the time from the start of the Retinex process to the start of the output of the image corrected by the output step is short.
従来、元画像のレティネックス画像を形成し、そのレティネックス画像に基づいて正規化を行うための上限値と下限値を求める処理では、画素数が多いため、上限値と下限値を求めるのに時間がかかり、レティネックス処理を開始してから最初に画像が出力されるまでに時間を要していたが、本発明により、この時間を短縮することができる。 Conventionally, in the process of forming the Retinex image of the original image and obtaining the upper limit value and the lower limit value for normalization based on the Retinex image, since the number of pixels is large, the upper limit value and the lower limit value are obtained. Although time is required and it takes time from the start of Retinex processing to the first output of an image, the present invention can reduce this time.
請求項7記載の画像処理プログラムによれば、請求項1から6のいずれかに記載の画像処理プログラムの奏する効果に加え、正規化パラメータ設定ステップは、全画素が取る値の最大値から最小値の範囲の値のうち、全画素に対する所定の割合の画素を含むクリップ範囲の上限値と下限値とを正規化パラメータとして設定するので、決定される上限値および下限値は、元画像を用いて決定した上限値および下限値とほぼ同一の値を得ることができる。したがって、この上限値および下限値の精度を維持したままで高速で求めることができるという効果がある。なお、正規化パラメータとして上限値、下限値ではなく最大値、最小値を用いた場合は、元画像により求めた値と、縮小画像により求めた値とが大きく異なる場合がある。 According to the image processing program of the seventh aspect, in addition to the effect produced by the image processing program according to any one of the first to sixth aspects, the normalization parameter setting step includes: Since the upper limit value and lower limit value of the clip range including pixels in a predetermined ratio with respect to all pixels are set as normalization parameters, the upper limit value and lower limit value to be determined are determined using the original image. Almost the same value as the determined upper limit value and lower limit value can be obtained. Therefore, there is an effect that the upper limit value and the lower limit value can be obtained at a high speed while maintaining the accuracy. When the maximum value and the minimum value are used as normalization parameters instead of the upper limit value and the lower limit value, the value obtained from the original image and the value obtained from the reduced image may be greatly different.
請求項8記載の画像処理装置によれば、元画像を縮小した縮小画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求めることにより縮小レティネックス画像を形成する縮小レティネックス画像形成手段と、その縮小レティネックス画像形成手段により形成された縮小レティネックス画像の画素値が取る値の全範囲における各画素値の頻度を集計し、正規化を行う際の上限値および下限値を設定する正規化パラメータ設定手段と、前記元画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う補正手段とを備えているので、周辺平均輝度を求める際に行う畳み込み演算における演算数が少なく、処理を高速で行うことができる。また、上限値および下限値を設定する際の対象とする画素数が少ないので高速で設定することができる。 9. The image processing apparatus according to claim 8, wherein for each pixel of the reduced image obtained by reducing the original image, a reduced Retinex image is formed by obtaining a reflectance from the pixel value and the peripheral average luminance of the pixel. Retinex image forming means and the frequency of each pixel value in the entire range of values taken by the pixel values of the reduced Retinex image formed by the reduced Retinex image forming means are summed up, and an upper limit value for normalization and Normalization parameter setting means for setting a lower limit value, and for each pixel of the original image, the reflectance is obtained from the pixel value and the peripheral average luminance of the pixel, and the reflectance is set by the normalization parameter setting step. Normalized normalized Retinex values based on the upper and lower limits, and based on the normalized Retinex values and the pixel values of the original image. Because Te and a correcting means for correcting, small operand in convolution performed when obtaining the surrounding average luminance, it is possible to treat at a high speed. In addition, since the number of target pixels when setting the upper limit value and the lower limit value is small, it can be set at high speed.
請求項9記載の画像処理装置によれば、請求項8記載の画像処理装置の奏する効果に加え、縮小レティネックス画像形成手段は、元画像から縮小画像を形成するために最近傍法により画素を抽出するサンプリング手段と、そのサンプリング手段により抽出された画素の値とフィルタ係数との畳み込み演算を行う演算手段とを備えているので、画像を縮小する演算を高速で行うことができるという効果がある。 According to the image processing apparatus of the ninth aspect, in addition to the effect achieved by the image processing apparatus of the eighth aspect, the reduced Retinex image forming means generates pixels by the nearest neighbor method in order to form a reduced image from the original image. Since the sampling means for extraction and the calculation means for performing the convolution calculation of the pixel value extracted by the sampling means and the filter coefficient are provided, there is an effect that the calculation for reducing the image can be performed at high speed. .
請求項10記載の画像処理装置によれば、請求項8記載の画像処理装置の奏する効果に加え、縮小レティネックス画像形成手段は、元画像を平均画素法により縮小する画像縮小手段と、その画像縮小手段により縮小された画像の画素とフィルタ係数との畳み込み演算を行う演算手段とを備えているので、縮小画像の画質が良好であり、正規化を行う際の上限値および下限値をより正確に設定することができるという効果がある。 According to the image processing apparatus of the tenth aspect, in addition to the effect produced by the image processing apparatus according to the eighth aspect, the reduced Retinex image forming means includes an image reducing means for reducing the original image by an average pixel method, and the image Since it is provided with a calculation means for performing a convolution operation between the pixel of the image reduced by the reduction means and the filter coefficient, the image quality of the reduced image is good, and the upper limit value and the lower limit value for normalization are more accurate. There is an effect that can be set to.
請求項11記載の画像処理装置によれば、請求項8から10のいずれかに記載の画像処理装置の奏する効果に加え、縮小レティネックス画像形成手段により形成された縮小レティネックス画像を記憶する記憶手段を備え、正規化パラメータ設定手段は、記憶手段に記憶された縮小レティネックス画像に基づいて正規化を行う際の上限値および下限値を取得する。 According to the image processing apparatus of the eleventh aspect, in addition to the effect produced by the image processing apparatus according to any one of the eighth to tenth aspects, the storage for storing the reduced Retinex image formed by the reduced Retinex image forming means. And a normalization parameter setting unit obtains an upper limit value and a lower limit value for normalization based on the reduced Retinex image stored in the storage unit.
元画像に基づいてレティネックス画像を形成して記憶する場合は、大きな記憶容量を必要とするが、縮小画像に基づく縮小レティネックス画像を記憶するので、記憶容量を小さくすることができるという効果がある。 When a Retinex image is formed and stored based on the original image, a large storage capacity is required. However, since the reduced Retinex image based on the reduced image is stored, the storage capacity can be reduced. is there.
請求項12記載の画像処理装置によれば、請求項8から11のいずれかに記載の画像処理装置の奏する効果に加え、縮小レティネックス画像形成手段は、前記縮小画像から分離された輝度信号のみについて縮小レティネックス画像を形成し、前記補正手段は、元画像から分離された輝度信号のみについて反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行うので、RGB値それぞれについてレティネックス処理を行う場合に比べ、色ずれの発生を防止することができるとともに、演算量が減るので高速で演算することができるという効果がある。 According to the image processing device of the twelfth aspect, in addition to the effect produced by the image processing device according to any one of the eighth to eleventh aspects, the reduced Retinex image forming means only has a luminance signal separated from the reduced image. A reduced Retinex image is formed, and the correction means obtains the reflectance for only the luminance signal separated from the original image, and the reflectance is based on the upper limit value and the lower limit value set by the normalization parameter setting step. Normalized Retinex values obtained by normalization and correction is performed based on the normalized Retinex values and the pixel values of the original image. In addition to being able to prevent the occurrence, there is an effect that the calculation amount can be reduced because the calculation amount is reduced.
請求項13記載の画像処理装置によれば、請求項8から12のいずれかに記載の画像処理装置の奏する効果に加え、補正手段により補正された画素値を出力する出力手段を備えているので、レティネックス処理を開始してから、出力ステップにより補正された画像の出力が開始されるまでの時間が短いという効果がある。 According to the image processing device of the thirteenth aspect, in addition to the effect produced by the image processing device according to any one of the eighth to twelfth aspects, the image processing device includes an output unit that outputs the pixel value corrected by the correction unit. There is an effect that the time from the start of the Retinex process to the start of the output of the image corrected by the output step is short.
従来、元画像のレティネックス画像を形成し、そのレティネックス画像に基づいて正規化を行うための上限値と下限値を求める処理では、画素数が多いため、上限値と下限値を求めるのに時間がかかり、レティネックス処理を開始してから最初に画像が出力されるまでに時間を要していたが、本発明により、この時間を短縮することができる。 Conventionally, in the process of forming the Retinex image of the original image and obtaining the upper limit value and the lower limit value for normalization based on the Retinex image, since the number of pixels is large, the upper limit value and the lower limit value are obtained. Although time is required and it takes time from the start of Retinex processing to the first output of an image, the present invention can reduce this time.
請求項14記載の画像処理装置によれば、請求項8から13のいずれかに記載の画像処理装置の奏する効果に加え、正規化パラメータ設定手段は、全画素が取る値の最大値から最小値の範囲の値のうち、全画素に対する所定の割合の画素を含むクリップ範囲の上限値と下限値とを正規化パラメータとして設定するので、決定される上限値および下限値は、元画像を用いて決定した上限値および下限値とほぼ同一の値を得ることができる。したがって、この上限値および下限値の精度を維持したままで高速で求めることができるという効果がある。 According to the image processing device according to claim 14, in addition to the effect produced by the image processing device according to any of claims 8 to 13, the normalization parameter setting means has a minimum value from a maximum value of values taken by all pixels. Since the upper limit value and lower limit value of the clip range including pixels in a predetermined ratio with respect to all pixels are set as normalization parameters, the upper limit value and lower limit value to be determined are determined using the original image. Almost the same value as the determined upper limit value and lower limit value can be obtained. Therefore, there is an effect that the upper limit value and the lower limit value can be obtained at a high speed while maintaining the accuracy.
以下、本発明の好ましい実施形態について添付図面を参照して説明する。図1は、本実施形態の画像処理を行う機能を有するプリンタ1の電気的な構成を示したブロック図である。本実施形態においては、プリンタ1に搭載された画像処理プログラムは、パーソナルコンピュータ(以下「PC」と称する)2や、デジタルカメラ21や、外部メディア20から入力された画像データ(原画像データなど)に対しレティネックス処理(Retinex処理)およびヒストグラム処理を実行して、画像データの逆光画像部分などの低画質領域の補正を実行するように構成されている。
Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings. FIG. 1 is a block diagram illustrating an electrical configuration of a
図1に示すように、プリンタ1には、CPU11、ROM12、RAM13、印刷ヘッドなどから構成され、印刷媒体(例えば、紙媒体など)への印刷(出力)を行う印刷部15、出力画像サイズなどの入力値をユーザが入力可能なユーザ操作部(例えば、テンキーなど)を有する操作パネル16とを備えている。
As shown in FIG. 1, the
また、プリンタ1は、ケーブル5を介してPC2と接続可能なインターフェイス(以下「I/F」と称する)17と、ケーブル6を介してデジタルカメラ21と接続可能なI/F18と、外部メディア20(例えば、SDメモリカード、メモリスティックなどのフラッシュメモリにより構成される)を着脱自在に装着可能な外部メディアスロット19とを備えている。これらのI/F17、18により行われる通信方法としてUSB(Universal Serial Bus)が使用される。
The
よって、プリンタ1は、PC2に記憶されている画像データをケーブル5及びI/F17を介して入力することが可能であると共に、デジタルカメラ21によって撮影された画像データをケーブル6及びI/F18を介して入力することが可能である。さらに、外部メディアスロット19に装着された外部メディア20から、その外部メディア20に記憶されている画像データを入力することが可能である。
Therefore, the
CPU11は、プリンタ1全体を制御する演算処理装置である。ROM12は、CPU11により実行される各種制御プログラムやそのプログラムを実行する際に用いられる固定値などを記憶するものであり、レティネックス処理やヒストグラム処理などの画像の処理を行う画像処理プログラムを記憶する画像処理プログラムメモリ12aや、印刷を行うための印刷制御プログラムを記憶する印刷制御プログラムメモリ12b等が備えられている。
The
RAM13は、制御プログラムがCPU11により実行される際に必要な各種レジスタ群などが記憶されるワーキングエリアや、処理中のデータを一時的に格納するテンポラリエリア等を有しランダムにアクセスできる書き換え可能なメモリであり、元画像データを記憶する元画像メモリ13aと、元画像を縮小し、縮小した画像のレティネックス処理において求められる反射率を記憶する縮小レティネックス画像メモリ13bとクリップ範囲を求めるためのヒストグラムが形成されるヒストグラムメモリ13c等を備えている。
The
元画像データメモリ13aは、PC2、デジタルカメラ21、及び外部メディア20から、それぞれ、I/F17、I/F18、及び外部メディアスロット19を介して入力した画像データを記憶するものである。なお、本実施形態では、元画像データ及び出力画像データはいずれも、RGB値から構成され、これらの各RGB値は、「0」〜「255」の範囲の値である。
The original
RGB値は、光の3原色である赤を表すR値と、緑を表すG値と、青を示すB値とを構成成分とする値である。光の3原色の混色により各種の色は生成されるので、入力画像の各画素の色は、R値とG値とB値との組合せ(RGB値)により1の色(色相や階調など)が示される。このRGB値の値が大きいほど、輝度(明度)は高くなる。 The RGB value is a value having as constituent components an R value representing red, which is the three primary colors of light, a G value representing green, and a B value representing blue. Since various colors are generated by mixing the three primary colors of light, the color of each pixel of the input image is one color (hue, gradation, etc.) by a combination of R value, G value, and B value (RGB value). ) Is displayed. The luminance (lightness) increases as the RGB value increases.
縮小レティネックス画像メモリ13bは、元画像を縮小し、その縮小した画像の輝度信号のみについてレティネックス処理において求められる反射率Rs(x,y)を記憶するメモリである。元画像を縮小する方法としては、縮小する画像の画素に対応する元画像の位置に最も近い画素の値をサンプリングし、そのサンプリングした画素の値をそのまま用いる最近傍(Nearest Neighbor)法や、縮小する画像の画素に対応する元画像の位置の周囲の画素を用いて補間演算を行うバイキュービック法や、平均画素法などが知られている。画質より処理速度を優先する場合は、最近傍法が用いられ、処理速度より画質を優先する場合は、バイキュービック法や、平均画素法が用いられる。
The reduced
これらいずれかの方法により元画像が縮小され、その縮小された画像の各画素(ピクセル)について反射率が上述の数式1を用いて演算され、この縮小レティネックス画像メモリ13bに記憶される。
The original image is reduced by any one of these methods, and the reflectance is calculated for each pixel (pixel) of the reduced
ヒストグラムメモリ13cは、反射率R(x,y)を正規化する際に、クリップ範囲を設定するためにヒストグラムを形成するが、そのヒストグラムの集計を行うためのメモリである。 The histogram memory 13c forms a histogram for setting the clip range when normalizing the reflectance R (x, y), and is a memory for summing up the histogram.
次に、図2および図3を参照して、CPU11により実行される画像処理について説明する。図2および図3は、画像処理を示すフローチャートである。図2に示す処理は、いわゆる前処理と呼ばれる処理であり、この処理では、反射率Rの正規化を行うためのクリップ範囲が設定される。なお、この前処理が行われている間は、画像の出力が行われない。
Next, image processing executed by the
この前処理では、まず、元画像データをPC2やデジタルカメラ21から読み込み、RAM13の元画像メモリ13aに記憶する(S1)。次に、元画像を縮小して縮小画像を形成し、その縮小画像の各画素について輝度信号Yと色信号Cb,Crに変換する(S2)。
In this preprocessing, first, original image data is read from the
縮小画像を形成する方法としては、最近傍法や平均画素法が用いられ、輝度信号Yおよび色信号Cb,Crは、次式により演算される。 As a method of forming a reduced image, a nearest neighbor method or an average pixel method is used, and the luminance signal Y and the color signals Cb and Cr are calculated by the following equations.
次に、上式により演算された輝度信号Yについて、反射率Rs(x,y)を算出する。なお、「s」は、縮小画像についての接尾辞であり、元画像については、接尾辞を付さないものとする。反射率Rsは、縮小画像の各画素の輝度値をIs(x,y)、縮小画像用のフィルタをFs(x,y)として、次式により演算される。 Next, the reflectance Rs (x, y) is calculated for the luminance signal Y calculated by the above equation. Note that “s” is a suffix for the reduced image, and no suffix is added to the original image. The reflectance Rs is calculated by the following equation, assuming that the luminance value of each pixel of the reduced image is Is (x, y) and the filter for the reduced image is Fs (x, y).
次に、上記演算により求められた反射率Rs(x,y)をRAM13の縮小レティネックス画像メモリ13bに記憶する(S4)。
Next, the reflectance Rs (x, y) obtained by the above calculation is stored in the reduced
次に、Rs(x,y)を最大値および最小値と比較する(S5)。詳細には、最初の座標について求めた反射率Rs(x,y)を最大値および最小値とし、そのつぎから求めた反射率Rs(x,y)と最大値および最小値とをそれぞれ比較し、今回求めた反射率Rs(x,y)が、最大値より大きい場合は、今回求めた反射率Rs(x,y)を新たな最大値とし、今回求めた反射率Rs(x,y)が、最小値より小さい場合は、今回求めた反射率Rs(x,y)を新たな最小値とし、今回求めた反射率Rs(x,y)が、最大値より小さく、最小値より大きい場合は、最大値、最小値を変更しないという処理である。 Next, Rs (x, y) is compared with the maximum value and the minimum value (S5). Specifically, the reflectance Rs (x, y) obtained for the first coordinate is set as the maximum value and the minimum value, and the reflectance Rs (x, y) obtained from the next is compared with the maximum value and the minimum value, respectively. When the reflectance Rs (x, y) obtained this time is larger than the maximum value, the reflectance Rs (x, y) obtained this time is set as a new maximum value, and the reflectance Rs (x, y) obtained this time is obtained. Is smaller than the minimum value, the reflectance Rs (x, y) obtained this time is set as a new minimum value, and the reflectance Rs (x, y) obtained this time is smaller than the maximum value and larger than the minimum value. Is a process of not changing the maximum value and the minimum value.
次に、縮小画像の全ての座標についてS3〜S5の処理を行ったか否かを判断し(S6)、まだ、未処理の座標がある場合は(S6:No)、S3の処理に戻り、全ての座標についての処理を終了した場合は(S6:Yes)、S5の処理により求めた最大値と最小値に基づいて、反射率Rs(x,y)を正規化し、ヒストグラムを形成する(S7)。このヒストグラムは、算出された最大値と最小値との間の各値をとる画素値の数を集計したもので、この集計されたヒストグラムは、ヒストグラムメモリ13cに形成される。 Next, it is determined whether or not the processing of S3 to S5 has been performed for all the coordinates of the reduced image (S6). If there are still unprocessed coordinates (S6: No), the processing returns to S3 and all of them are performed. When the process for the coordinates of (5) is completed (S6: Yes), the reflectance Rs (x, y) is normalized based on the maximum value and the minimum value obtained by the process of S5, and a histogram is formed (S7). . This histogram is obtained by summing up the number of pixel values taking each value between the calculated maximum value and minimum value, and this summed histogram is formed in the histogram memory 13c.
次に、その形成されたヒストグラムからメディアン値を求め(S8)、そのメディアン値とヒストグラムとから反射率Rs(x,y)のクリップ範囲を定める(S9)。このクリップ範囲は、例えば、メディアン値より大きい値で、全標本の45%の標本が含まれる上限値をクリップ範囲の上限値とし、メディアン値より小さい値で、全標本の45%が含まれる下限値をクリップ範囲の下限値とするものである。 Next, a median value is obtained from the formed histogram (S8), and a clip range of the reflectance Rs (x, y) is determined from the median value and the histogram (S9). This clip range is, for example, a value larger than the median value, and an upper limit value that includes 45% of all samples is the upper limit value of the clip range, and a lower value that is less than the median value and includes 45% of all samples. The value is the lower limit value of the clip range.
以上の前処理により、元画像を縮小した縮小画像の反射率により構成される縮小レティネックス画像を形成し、その縮小レティネックス画像から、元画像の反射率を正規化する際のクリップ範囲が求められる。このことにより、クリップ範囲を求めるための演算の回数が、元画像について求める演算の回数より非常に少なくすることができ、処理速度が速くなる。また、縮小された画像のレティネックス画像を記憶するので、元画像のレティネックス画像を記憶する場合に比べ、少ない記憶容量で処理することができるという利点がある。また、縮小画像を用いて求めたクリップ範囲と、元画像を用いて求めたクリップ範囲とは、大差がない。次表は、縮小画像により求めたクリップ範囲(上限値と下限値)と元画像により求めたクリップ範囲との差異を示すものである。 Through the above pre-processing, a reduced Retinex image composed of the reduced image reflectance obtained by reducing the original image is formed, and the clip range for normalizing the reflectance of the original image is obtained from the reduced Retinex image. It is done. As a result, the number of calculations for obtaining the clip range can be made much smaller than the number of calculations for the original image, and the processing speed is increased. Further, since the Retinex image of the reduced image is stored, there is an advantage that the processing can be performed with a small storage capacity compared with the case of storing the Retinex image of the original image. Further, there is no large difference between the clip range obtained using the reduced image and the clip range obtained using the original image. The following table shows the difference between the clip range (upper limit and lower limit) obtained from the reduced image and the clip range obtained from the original image.
一方、元画像により求めたクリップ範囲の上限値は、0.825、下限値は、−0.822であり、縮小画像により求めた上限値は、0.742、下限値は、−0.755である。よって、元画像により求めた上限値と縮小画像により求めた上限値との差は、0.083であり、元画像により求めた下限値と縮小画像により求めた下限値との差は、0.067であって、これらの差が小さいことが分かる。 On the other hand, the upper limit value of the clip range obtained from the original image is 0.825, the lower limit value is −0.822, the upper limit value obtained from the reduced image is 0.742, and the lower limit value is −0.755. It is. Therefore, the difference between the upper limit value obtained from the original image and the upper limit value obtained from the reduced image is 0.083, and the difference between the lower limit value obtained from the original image and the lower limit value obtained from the reduced image is 0. 0. 067, and it can be seen that these differences are small.
次に、図2に示す処理により求められたクリップ範囲に基づいて行う後処理である元画像のレティネックス処理について説明する。図3は、元画像のレティネックス処理を示すフローチャートである。なお、この後処理では、元画像の各画素について処理が行われ、処理された画素値は、順次印刷部15に出力される。
Next, the Retinex process of the original image, which is a post process performed based on the clip range obtained by the process shown in FIG. 2, will be described. FIG. 3 is a flowchart showing the original image Retinex processing. In this post-processing, each pixel of the original image is processed, and the processed pixel value is sequentially output to the
まず、元画像について、反射率R(x,y)を算出する(S11)。次に、縮小画像を用いて求めたクリップ範囲に基づいて、R(x,y)を正規化し、正規化反射率(正規化レティネックス値)refle(x,y)を得る(S12)。 First, the reflectance R (x, y) is calculated for the original image (S11). Next, based on the clip range obtained using the reduced image, R (x, y) is normalized to obtain a normalized reflectance (normalized Retinex value) refle (x, y) (S12).
次に、このrefle(x,y)を用いて、次式により輝度についてレティネックス処理を行った画素の値Out(x,y)を得る(S13)。なお、γは、定数である。 Next, using this refle (x, y), a pixel value Out (x, y) subjected to Retinex processing for luminance is obtained by the following equation (S13). Note that γ is a constant.
次に、元画像の全画素について処理を終了したか否かを判断し(S16)、まだ処理を終了していない画素がある場合は(S16:No)、S11の処理に戻り、全ての画素について処理を終了した場合は(S16:Yes)、この後処理を終了する。 Next, it is determined whether or not the process has been completed for all the pixels of the original image (S16). If there is a pixel that has not been processed yet (S16: No), the process returns to S11 and all the pixels are processed. When the process is finished for (S16: Yes), the process is finished.
以上、実施形態について説明したように、元画像を縮小した縮小画像の輝度信号についてレティネックス処理を行い、その縮小されたレティネックス画像からクリップ範囲を求めて、そのクリップ範囲に基づいて、元画像についてレティネックス処理を行うので、レティネックス画像を記憶するメモリの記憶容量を小さくすることができるとともに、クリップ範囲を求める処理を高速で行うことができる。また、前処理において、クリップ範囲が求められ、後処理においては、前処理において求められたクリップ範囲に基づいて、順次元画像の画素についてレティネックス処理を行い、出力することができるので、処理を開始してから出力が開始されるまでの時間を短縮することができる。 As described above, the Retinex process is performed on the luminance signal of the reduced image obtained by reducing the original image, the clip range is obtained from the reduced Retinex image, and the original image is obtained based on the clip range. Since the Retinex process is performed on the memory, the storage capacity of the memory for storing the Retinex image can be reduced, and the process for obtaining the clip range can be performed at a high speed. In addition, the clip range is obtained in the pre-processing, and in the post-processing, the Retinex process can be performed on the pixels of the forward dimension image based on the clip range obtained in the pre-processing, and the processing can be performed. The time from the start to the start of output can be shortened.
なお、請求項に記載の縮小レティネックス画像形成ステップおよび縮小レティネックス画像形成ステップは、図2に示すフローチャートのS3の処理が該当し、正規化パラメータ設定ステップおよび正規化パラメータ設定手段は、図2に示すフローチャートのS7〜S9の処理が該当し、補正ステップおよび補正手段は、図3に示すフローチャートの処理が該当する。 Note that the reduced Retinex image forming step and the reduced Retinex image forming step described in the claims correspond to the processing of S3 in the flowchart shown in FIG. 2, and the normalization parameter setting step and the normalization parameter setting means are the same as those in FIG. 3 corresponds to the processing shown in the flowchart, and the correction step and the correction means correspond to the processing of the flowchart shown in FIG.
以上、実施形態に基づいて本発明を説明したが、本発明は上記各実施形態に何ら限定されるものでなく、本発明の趣旨を逸脱しない範囲内で種々の改良変形が可能であることは容易に推察できるものである。 As described above, the present invention has been described based on the embodiments. However, the present invention is not limited to the above embodiments, and various improvements and modifications can be made without departing from the spirit of the present invention. It can be easily guessed.
例えば、上記実施形態では、色表現系はRGB形式としたが、RGB形式以外の他の色表現系、例えば、CMY形式などに本発明を適用してもよい。 For example, in the above embodiment, the color expression system is the RGB format, but the present invention may be applied to other color expression systems other than the RGB format, for example, the CMY format.
また、上記実施形態では、本発明の画像処理プログラムは、プリンタ1に組み込まれたCPU11により実行されるものとしたが、パーソナルコンピュータにアプリケーションとして供給され、パーソナルコンピュータに組み込まれたCPUなどにより実行されるようにしてもよい。
In the above embodiment, the image processing program of the present invention is executed by the
また、レティネックス処理は、SSR(シングルスケール法)であってもMSR(マルチスケール法)であってもよい。 The Retinex process may be SSR (single scale method) or MSR (multiscale method).
また、上記実施形態の画像処理では、CPU11によりレティネックス処理などを行うものとしたが、DSP(Digital Signal
Processor)により行ってもよい。DSPを用いると、より高速に積和演算などの処理を実行することができる。
In the image processing of the above embodiment, the Retinex processing is performed by the
Processor). When a DSP is used, processing such as product-sum operation can be executed at higher speed.
1 プリンタ
2 パーソナルコンピュータ
11 CPU
12 ROM
12a 画像処理プログラムメモリ
13 RAM
13a 元画像メモリ
13b レティネックス画像メモリ(記憶手段)
1
12 ROM
12a Image
13a
Claims (14)
元画像を縮小した縮小画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求めることにより縮小レティネックス画像を形成する縮小レティネックス画像形成ステップと、
その縮小レティネックス画像形成ステップにより形成された縮小レティネックス画像の画素値が取る値の全範囲における各画素値の頻度を集計し、正規化を行う際の上限値および下限値を設定する正規化パラメータ設定ステップと、
前記元画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う補正ステップとを備えていることを特徴とする画像処理プログラム。 In an image processing program executed by an image processing apparatus that performs image correction processing,
For each pixel of the reduced image obtained by reducing the original image, a reduced Retinex image forming step for forming a reduced Retinex image by obtaining a reflectance from the pixel value and the peripheral average luminance of the pixel;
Normalization that counts the frequency of each pixel value in the entire range of values taken by the pixel values of the reduced Retinex image formed by the reduced Retinex image forming step and sets the upper and lower limits for normalization A parameter setting step;
For each pixel of the original image, a reflectance is obtained from the pixel value and the peripheral average luminance of the pixel, and the reflectance is normalized based on the upper limit value and the lower limit value set by the normalization parameter setting step. An image processing program comprising: a correction step of obtaining a normalized Retinex value and performing correction based on the normalized Retinex value and a pixel value of the original image.
前記正規化パラメータ設定ステップは、前記記憶手段に記憶された縮小レティネックス画像に基づいて正規化を行う際の上限値および下限値を設定することを特徴とする請求項1から3のいずれかに記載の画像処理プログラム。 Storage means for storing the reduced Retinex image formed by the reduced Retinex image forming step;
4. The normalization parameter setting step sets an upper limit value and a lower limit value for normalization based on a reduced Retinex image stored in the storage means. The image processing program described.
前記補正ステップは、元画像から分離された輝度信号のみについて反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行うことを特徴とする請求項1から4のいずれかに記載の画像処理プログラム。 The reduced Retinex image forming step forms a reduced Retinex image for only the luminance signal separated from the reduced image,
The correction step obtains the reflectivity only for the luminance signal separated from the original image, and normalizes the reflectivity based on the upper limit value and the lower limit value set by the normalization parameter setting step. 5. The image processing program according to claim 1, wherein correction is performed based on the normalized Retinex value and the pixel value of the original image.
元画像を縮小した縮小画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求めることにより縮小レティネックス画像を形成する縮小レティネックス画像形成手段と、
その縮小レティネックス画像形成手段により形成された縮小レティネックス画像の画素値が取る値の全範囲における各画素値の頻度を集計し、正規化を行う際の上限値および下限値を設定する正規化パラメータ設定手段と、
前記元画像の各画素について、画素の値とその画素の周辺平均輝度とから反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行う補正手段とを備えていることを特徴とする画像処理装置。 In an image processing apparatus that corrects an image,
For each pixel of the reduced image obtained by reducing the original image, a reduced Retinex image forming unit that forms a reduced Retinex image by obtaining a reflectance from the pixel value and the peripheral average luminance of the pixel;
Normalization that aggregates the frequency of each pixel value in the entire range of values taken by the pixel values of the reduced Retinex image formed by the reduced Retinex image forming means and sets the upper and lower limits for normalization Parameter setting means;
For each pixel of the original image, a reflectance is obtained from the pixel value and the peripheral average luminance of the pixel, and the reflectance is normalized based on the upper limit value and the lower limit value set by the normalization parameter setting step. An image processing apparatus comprising: a correction unit that obtains a normalized Retinex value and performs correction based on the normalized Retinex value and a pixel value of the original image.
前記正規化パラメータ設定手段は、前記記憶手段に記憶された縮小レティネックス画像に基づいて正規化を行う際の上限値および下限値を設定するものであることを特徴とする請求項8から10のいずれかに記載の画像処理装置。 Storage means for storing the reduced Retinex image formed by the reduced Retinex image forming means,
11. The normalization parameter setting means is for setting an upper limit value and a lower limit value for normalization based on a reduced Retinex image stored in the storage means. The image processing apparatus according to any one of the above.
前記補正手段は、元画像から分離された輝度信号のみについて反射率を求め、その反射率を前記正規化パラメータ設定ステップにより設定された上限値および下限値に基づいて正規化した正規化レティネックス値を求め、その正規化レティネックス値と、元画像の画素値とに基づいて補正を行うことを特徴とする請求項8から11のいずれかに記載の画像処理装置。 The reduced Retinex image forming means forms a reduced Retinex image for only the luminance signal separated from the reduced image,
The correction means obtains the reflectance only for the luminance signal separated from the original image, and normalizes the retinex value obtained by normalizing the reflectance based on the upper limit value and the lower limit value set by the normalization parameter setting step. 12. The image processing apparatus according to claim 8, wherein correction is performed based on the normalized Retinex value and the pixel value of the original image.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006222307A JP4793166B2 (en) | 2006-08-17 | 2006-08-17 | Image processing program and image processing apparatus |
US11/837,817 US7920752B2 (en) | 2006-08-17 | 2007-08-13 | Image processing device that quickly performs retinex process |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006222307A JP4793166B2 (en) | 2006-08-17 | 2006-08-17 | Image processing program and image processing apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008048188A true JP2008048188A (en) | 2008-02-28 |
JP4793166B2 JP4793166B2 (en) | 2011-10-12 |
Family
ID=39181494
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006222307A Expired - Fee Related JP4793166B2 (en) | 2006-08-17 | 2006-08-17 | Image processing program and image processing apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4793166B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102006462A (en) * | 2010-11-27 | 2011-04-06 | 南京理工大学 | Rapid monitoring video enhancement method by using motion information and implementation device thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003333331A (en) * | 2002-05-10 | 2003-11-21 | Matsushita Electric Ind Co Ltd | Image processing method and image processing apparatus |
JP2005039458A (en) * | 2003-07-18 | 2005-02-10 | Canon Inc | Image processing apparatus and method |
WO2005036870A1 (en) * | 2003-10-02 | 2005-04-21 | Hewlett-Packard Development Company L.P. | A method to speed-up retinex-type algorithms |
JP2005515515A (en) * | 2001-04-30 | 2005-05-26 | ヒューレット・パッカード・カンパニー | System and method for image enhancement, dynamic range compensation, and illumination correction |
-
2006
- 2006-08-17 JP JP2006222307A patent/JP4793166B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005515515A (en) * | 2001-04-30 | 2005-05-26 | ヒューレット・パッカード・カンパニー | System and method for image enhancement, dynamic range compensation, and illumination correction |
JP2003333331A (en) * | 2002-05-10 | 2003-11-21 | Matsushita Electric Ind Co Ltd | Image processing method and image processing apparatus |
JP2005039458A (en) * | 2003-07-18 | 2005-02-10 | Canon Inc | Image processing apparatus and method |
WO2005036870A1 (en) * | 2003-10-02 | 2005-04-21 | Hewlett-Packard Development Company L.P. | A method to speed-up retinex-type algorithms |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102006462A (en) * | 2010-11-27 | 2011-04-06 | 南京理工大学 | Rapid monitoring video enhancement method by using motion information and implementation device thereof |
Also Published As
Publication number | Publication date |
---|---|
JP4793166B2 (en) | 2011-10-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4867529B2 (en) | Image processing program and image processing apparatus | |
JP4389976B2 (en) | Image processing apparatus and image processing program | |
US8081831B2 (en) | Image processor performing a high precision retinex process | |
US8472711B2 (en) | Image processing device for processing images according to the available storage capacity | |
US7920752B2 (en) | Image processing device that quickly performs retinex process | |
JP4862554B2 (en) | Image processing program and image processing apparatus | |
JP4997846B2 (en) | Image processing program and image processing apparatus | |
US7689065B2 (en) | Image processing method and apparatus for suppressing positional shift image degradation | |
JP4353233B2 (en) | Image processing program and image processing apparatus | |
JP4687667B2 (en) | Image processing program and image processing apparatus | |
JP4793166B2 (en) | Image processing program and image processing apparatus | |
JP4793175B2 (en) | Image processing program and image processing apparatus | |
JP7365206B2 (en) | Image processing device, image processing method, and program | |
JP4765667B2 (en) | Image processing program and image processing apparatus | |
US8031973B2 (en) | Data processing device capable of executing retinex processing at high speed | |
JP4345027B2 (en) | Image processing program and image processing apparatus | |
JP4353234B2 (en) | Image processing program and image processing apparatus | |
JP4661754B2 (en) | Image processing apparatus and image processing program | |
JP4710761B2 (en) | Image processing program and image processing apparatus | |
JP2021082211A (en) | Image processing system, image processing method, and program | |
JP2008059307A (en) | Image processor and image processing program | |
JP4735499B2 (en) | Image processing program and image processing apparatus | |
JP2008060944A (en) | Image processor | |
JP2008060914A (en) | Image processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090330 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20091105 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100902 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100914 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101115 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110329 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110530 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110628 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110711 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4793166 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140805 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |