JP4557090B2 - Image processing apparatus, image processing method, and image processing program - Google Patents

Image processing apparatus, image processing method, and image processing program Download PDF

Info

Publication number
JP4557090B2
JP4557090B2 JP2009256829A JP2009256829A JP4557090B2 JP 4557090 B2 JP4557090 B2 JP 4557090B2 JP 2009256829 A JP2009256829 A JP 2009256829A JP 2009256829 A JP2009256829 A JP 2009256829A JP 4557090 B2 JP4557090 B2 JP 4557090B2
Authority
JP
Japan
Prior art keywords
value
class
range
image data
accumulated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2009256829A
Other languages
Japanese (ja)
Other versions
JP2010086548A (en
Inventor
清昭 村井
賢次 森
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2009256829A priority Critical patent/JP4557090B2/en
Publication of JP2010086548A publication Critical patent/JP2010086548A/en
Application granted granted Critical
Publication of JP4557090B2 publication Critical patent/JP4557090B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

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

Description

本発明は、画像データに画像補正を施す画像処理装置、画像処理方法及び画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, and an image processing program that perform image correction on image data.

画像処理では、1画面の画像の性質を統計的に解析して、解析結果に応じた画像補正処理を画像データに施すことがある。統計的な解析手法として、階調の頻度分布(ヒストグラム)を求め、ヒストグラムから補正パラメータを算出する手法が知られている。   In image processing, the characteristics of an image on one screen may be statistically analyzed, and image correction processing according to the analysis result may be performed on the image data. As a statistical analysis method, a method of obtaining a frequency distribution (histogram) of gradations and calculating a correction parameter from the histogram is known.

特許文献1には、静止画であるネガフィルム等の画像を対象とする画像処理方法が開示されている。この画像処理方法は、第1に、画像データの全ての階調に対して所定の度数までカウントした頻度分布を作成し、第2に画像データの基準最小値を、頻度分布の階調の小さい方からカウントした累積度数が総点数に対する所定の割合を超えた点を検出することにより算出し、第3に、画像データの基準最大値を、頻度分布の階調の大きい方からカウントした累積度数が総点数に対する所定の割合を超えた点を検出することにより算出し、第4に算出された基準最大値及び基準最小値に基づいて画像処理を実行するものである。   Patent Document 1 discloses an image processing method for an image such as a negative film that is a still image. In this image processing method, first, a frequency distribution is counted up to a predetermined frequency for all the gradations of the image data, and second, the reference minimum value of the image data is set to have a small gradation of the frequency distribution. Calculated by detecting a point where the cumulative frequency counted from one exceeds a predetermined ratio with respect to the total score, and thirdly, the cumulative maximum counted from the one with the larger gradation of the frequency distribution as the reference maximum value of the image data Is calculated by detecting a point exceeding a predetermined ratio with respect to the total number of points, and image processing is executed based on the fourth reference maximum value and reference minimum value.

特開平8−32808号公報JP-A-8-32808

しかしながら、従来の技術においては、画面を構成する全ての画素についてヒストグラムを作成し、その後、ヒストグラムの度数を最小値側と最大値側の双方から累算して累算ヒストグラムを各々生成していため、処理に時間がかかるといった不都合があった。特に、動画ではリアルタイム処理が要求されるが、上述した2段階の処理で累算ヒストグラムを生成すると、処理が間に合わないといった問題があった。   However, in the conventional technique, histograms are created for all the pixels constituting the screen, and then the histogram frequencies are accumulated from both the minimum value side and the maximum value side to generate an accumulated histogram. There is a disadvantage that processing takes time. In particular, real-time processing is required for a moving image, but when an accumulated histogram is generated by the above-described two-stage processing, there is a problem that processing is not in time.

本発明は、上述した事情に鑑みてなされたものであり、高速に統計値演算を実行することが可能な画像処理装置、画像処理方法及び画像処理プログラムを提供することを解決課題とする。   The present invention has been made in view of the above-described circumstances, and an object of the present invention is to provide an image processing apparatus, an image processing method, and an image processing program capable of executing statistical value calculation at high speed.

上記課題を解決するために、本発明に係る画像処理装置は、画面を構成する各画素に表示すべき階調を示す画像データに統計処理を施して統計値を生成し、前記統計値に基づいて前記画像データに補正処理を施す画像処理装置において、画素単位で画像データを取り込み、取り込んだ前記画像データの階調値が最小値から第1階調値までの第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第1階調値への方向へ累算した累積度数を階級毎に示す第1範囲における累積ヒストグラムを生成する共に、取り込んだ画像データの階調値が最大値から前記第1諧調値より大きい第2階調値までの第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第2階調値への方向へ累算した累積度数を階級毎に示す第2範囲における累積ヒストグラムを生成する累算ヒストグラム生成手段と、前記累積ヒストグラムの累積度数を予め定められた基準値と各々比較する比較手段と、前記比較手段の比較結果を参照して、前記基準値を超えた前記第1範囲における累積ヒストグラムの階級を基準最小値として生成すると共に、前記基準値を超えた前記第2範囲における累積ヒストグラムの階級を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として出力する統計値生成手段と、前記統計値に基づいて前記画像データに補正処理を施す補正手段とを備え、前記第1階調値は、前記第2階調値よりも小さい値であり、前記累算ヒストグラム生成手段は、取り込んだ前記画像データが前記第1範囲又は前記第2範囲にある場合にデコードして、属する階級毎に階級信号を各々出力するデコード手段と、前記第1範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第1範囲の各階級毎に下位の階級からの累算値を各々生成し、前記第1範囲の最上位の階級の累算値を前記第1累算値として出力する第1計数手段と、前記第2範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第2範囲の各階級毎に上位の階級からの累算値を各々生成し、前記第2範囲の最下位の階級の累算値を前記第2累算値として出力する第2計数手段とを備え、前記統計値生成手段は、前記基準最小値及び基準最大値が得られると、前記統計値の生成を終了することを特徴とする。 In order to solve the above problems, an image processing apparatus according to the present invention generates a statistical value by performing statistical processing on image data indicating a gradation to be displayed on each pixel constituting a screen, and based on the statistical value In the image processing apparatus that performs correction processing on the image data, when the image data is captured in units of pixels and the gradation value of the captured image data is in the first range from the minimum value to the first gradation value, First class which identifies which class the image data belongs to among a plurality of classes divided into the first range and accumulated in the direction from the identified class to the first gradation value is shown for each class. When the cumulative histogram in the range is generated and the gradation value of the captured image data is in the second range from the maximum value to the second gradation value larger than the first gradation value, the image data is in the second range. Divided multiple An accumulated histogram generating means for specifying which class of the class belongs and generating a cumulative histogram in a second range indicating the cumulative frequency accumulated in the direction from the specified class to the second gradation value for each class Comparing means for comparing the cumulative frequency of the cumulative histogram with a predetermined reference value, and referring to the comparison result of the comparing means, the rank of the cumulative histogram in the first range exceeding the reference value Generating a reference minimum value, generating a cumulative histogram class in the second range that exceeds the reference value as a reference maximum value, and outputting the reference minimum value and the reference maximum value as the statistics value e Bei means, and correction means for performing correction processing on the image data based on the statistical value, said first gradation value is the value smaller than the second gradation value, The accumulated histogram generating means decodes when the captured image data is in the first range or the second range, and outputs a class signal for each class to which the image data belongs, Each time a class signal is output, an accumulated value from a lower class is generated for each class in the first range based on the class signal, and an accumulation of the highest class in the first range is performed. First counting means for outputting a value as the first accumulated value; and whenever a class signal in the second range is output, an upper class for each class in the second range based on the class signal And a second counting means for outputting the accumulated value of the lowest class of the second range as the second accumulated value, and the statistical value generating means comprises the reference value When the minimum value and the reference maximum value are obtained, the generation of the statistical value is terminated. It is characterized in.

この発明によれば、画素単位で画像データを取り込む度に、各階級の頻度を累算して累算値を生成するので、1画面分の画像データを取り込んでヒストグラムを生成した後、累積ヒストグラムを生成するといった2段階の処理により累算値を生成するのではなく、ヒストグラムの生成を省略して、直接、累算値を生成することができる。そして、累算値が基準値に達した時点で統計値の生成が完了するので、処理を高速化でき、リアルタイムで画像を処理することが可能となる。特に、動画像をリアルタイムに補正する画像処理に好適である。   According to the present invention, every time image data is captured in units of pixels, the frequency of each class is accumulated to generate an accumulated value. Therefore, after the image data for one screen is captured and a histogram is generated, the cumulative histogram Instead of generating an accumulated value by a two-stage process such as generating an accumulated value, an accumulated value can be directly generated without generating a histogram. Since the generation of the statistical value is completed when the accumulated value reaches the reference value, the processing can be speeded up and the image can be processed in real time. Particularly, it is suitable for image processing for correcting a moving image in real time.

ここで、前記観測範囲は、最小値から第1階調値までの第1範囲と最大値から第2階調値までの第2範囲とを含み、前記累算値生成手段は、画素単位で前記画像データを取り込み、取り込んだ前記画像データの階調値が前記第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、各階級の頻度を最小値側から累算した第1累算値を生成する共に、取り込んだ画像データの階調値が前記第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、各階級の頻度を最大値側から累算した第2累算値を生成し、前記比較手段は、前記第1累算値及び前記第2累算値を前記基準値と各々比較し、前記統計値生成手段は、前記比較手段の比較結果を参照して、前記第1累算値が前記基準値に達したときの階調値を基準最小値として生成すると共に、前記第2累算値が前記基準値に達したときの階調値を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として出力することが好ましい。   Here, the observation range includes a first range from the minimum value to the first gradation value and a second range from the maximum value to the second gradation value, and the accumulated value generating means is in pixel units. The image data is captured, and when the gradation value of the captured image data is in the first range, the image data is specified to belong to a plurality of classes divided into the first range, A first accumulated value obtained by accumulating the frequency of the class from the minimum value side is generated, and when the gradation value of the captured image data is in the second range, the image data is divided into the second range. And a second accumulated value is generated by accumulating the frequency of each class from the maximum value side, and the comparing means includes the first accumulated value and the second accumulated value. Each of the calculated values is compared with the reference value, and the statistical value generating means is compared with the comparing means. Referring to the result, the gradation value when the first accumulated value reaches the reference value is generated as the reference minimum value, and the gradation when the second accumulated value reaches the reference value Preferably, a value is generated as a reference maximum value, and the reference minimum value and the reference maximum value are output as the statistical value.

この発明によれば、画素単位で画像データが取り込まれる度に、最小値側からの累積ヒストグラムと最大値側からの累積ヒストグラムを更新できるから、基準最小値と基準最大値とを高速に求めることができる。なお、第2階調値は第1階調値よりも大きいことが好ましい。   According to the present invention, since the cumulative histogram from the minimum value side and the cumulative histogram from the maximum value side can be updated each time image data is captured in pixel units, the reference minimum value and the reference maximum value can be obtained at high speed. Can do. Note that the second gradation value is preferably larger than the first gradation value.

また、前記累算値生成手段は、前記比較手段の比較結果を参照して、前記第1累算値が前記基準値に達したとき前記第1累算値の生成を停止すると共に前記第2累算値が前記基準値に達したとき前記第2累算値の生成を停止することが好ましい。この場合には、第1累算値又は第2累算値が基準値に達した時点で、累算値の生成を停止すことができるので、処理の高速化及び処理負荷の軽減を図ることができる。   The accumulated value generating means refers to the comparison result of the comparing means, and stops generating the first accumulated value when the first accumulated value reaches the reference value, and the second accumulated value. Preferably, the generation of the second accumulated value is stopped when the accumulated value reaches the reference value. In this case, since the generation of the accumulated value can be stopped when the first accumulated value or the second accumulated value reaches the reference value, the processing speed and the processing load can be reduced. Can do.

また、前記累算値生成手段は、画素単位で取り込んだ画素データが前記第1範囲又は前記第2範囲のどの階級に属するかを判別して、属する階級毎に階級信号を各々出力するデコード手段と、前記階級信号に基づいて、前記第1範囲の各階級毎に下位の階級からの累算値を各々計数し、最上位の階級の累算値を前記第1累算値として出力する第1計数手段と、前記階級信号に基づいて、前記第2範囲の各階級毎に上位の階級からの累算値を各々計数し、最下位の階級の累算値を前記第2累算値として出力する第2計数手段とを備えることが好ましい。この場合には、各階級の累積ヒストグラムを画素単位で更新し、第1範囲における最上位の階級の累算値を第1累算値、第2範囲における最下位の階級の累算値を第2累算値として生成できる。   Further, the accumulated value generating means determines which class of the first range or the second range the pixel data captured in units of pixels belongs, and outputs a class signal for each class to which it belongs. And, based on the class signal, for each class in the first range, the accumulated value from the lower class is counted, and the accumulated value of the highest class is output as the first accumulated value. 1 counting means and, based on the class signal, count the accumulated value from the upper class for each class in the second range, and use the accumulated value of the lowest class as the second accumulated value. It is preferable to provide the 2nd counting means to output. In this case, the cumulative histogram of each class is updated on a pixel basis, the accumulated value of the highest class in the first range is the first accumulated value, and the accumulated value of the lowest class in the second range is the first. It can be generated as two accumulated values.

より具体的には、前記第1計数手段は、ある階級信号を入力すると当該階級信号に対応する階級以上の総ての階級信号を出力する第1論理演算手段と、前記第1範囲の複数の階級毎に設けられ、画素単位で前記画像データが取り込まれる度に、前記階級信号の数を計数する複数のカウンタとを備え、前記複数のカウンタのうち、最上位の階級に対応するカウンタの計数値を前記第1累算値として出力し、前記第2計数手段は、ある階級信号を入力すると当該階級信号に対応する階級以下の総ての階級信号を出力する第2論理演算手段と、前記第2範囲の複数の階級毎に設けられ、画素単位で前記画像データが取り込まれる度に、前記階級信号の数を計数する複数のカウンタとを備え、前記複数のカウンタのうち、最下位の階級に対応するカウンタの計数値を前記第2累算値として出力することが好ましい。   More specifically, the first counting means, when a certain class signal is inputted, outputs all class signals equal to or higher than the class corresponding to the class signal, and a plurality of the first range. A plurality of counters that are provided for each class and count the number of class signals each time the image data is captured in units of pixels, and the total of the counters corresponding to the highest class among the plurality of counters Numerical value is output as the first accumulated value, and the second counting means, when a certain class signal is inputted, outputs second class operation means that outputs all class signals below the class corresponding to the class signal; A plurality of counters which are provided for each of a plurality of classes in the second range and count the number of the class signals each time the image data is captured in units of pixels, and the lowest class among the plurality of counters Corresponding to It is preferable to output a count value of data as the second accumulated value.

デコード手段からは、画像データの階調値が第1範囲内にあるとき、どの階級に属するかを示す階級信号が出力されるが、第1論理演算手段は、ある階級信号を入力すると当該階級信号に対応する階級以上の総ての階級信号を出力するから、各カウンタは、階級信号を計数することによって、下位の階級からの累算値を計数することが可能となる。このため、下位のヒストグラムを順次加算して累積ヒストグラムを算出する必要がなくなる。このことは、第2論理演算部についても同様である。   When the gradation value of the image data is within the first range, the decoding means outputs a class signal indicating which class the image data belongs to. When the first logic operation means inputs a certain class signal, the class signal is output. Since all class signals corresponding to the signal are output, the counters can count the accumulated values from the lower classes by counting the class signals. This eliminates the need to calculate the cumulative histogram by sequentially adding the lower histograms. The same applies to the second logical operation unit.

また、前記第1論理演算手段は、最下位から2番目の階級から最上位の階級に各々対応する複数の論理和回路を備え、各論理和回路は、下位の階級に対応するカウンタへ入力される信号と、当該階級に対応する階級信号との論理和を演算して前記複数のカウンタに出力信号を各々出力し、前記第2論理演算手段は、最上位から2番目の階級から最下位の階級に各々対応する複数の論理和回路を備え、各論理和回路は、上位の階級に対応するカウンタへ入力される信号と、当該階級に対応する階級信号との論理和を演算して前記複数のカウンタに出力信号を各々出力することが好ましい。   The first logical operation means includes a plurality of OR circuits corresponding to the second to lowest classes from the lowest level, and each of the OR circuits is input to a counter corresponding to the lower level. And the output signal is output to each of the plurality of counters, and the second logical operation means has the second to the lowest order from the highest order. A plurality of OR circuits each corresponding to a class, and each OR circuit calculates a logical sum of a signal input to a counter corresponding to an upper class and a class signal corresponding to the class, and It is preferable to output output signals to the counters.

また、前記各カウンタは計数値が前記基準値に達すると、計数を停止することが好ましい。カウンタに上限を設けることによって、カウンタの回路規模を削減するともに、必要な範囲内でのみカウンタを動作させることにより消費電力を削減できる。   The counters preferably stop counting when the count value reaches the reference value. By providing an upper limit for the counter, the circuit scale of the counter can be reduced, and power consumption can be reduced by operating the counter only within a necessary range.

さらに、前記階級には複数の階調値が含まれてもよい。画像補正処理の種類によっては、階級の幅が広くても適切な補正を実行できるものもある。そのような場合には、複数の階調を1つの階級に含ませることによって、より一層処理を高速化することができる。また、カウンタを削減できるので、構成を簡略化できると共に消費電力を削減できる。   Further, the class may include a plurality of gradation values. Some types of image correction processing can execute appropriate correction even if the class is wide. In such a case, the processing can be further speeded up by including a plurality of gradations in one class. In addition, since the number of counters can be reduced, the configuration can be simplified and power consumption can be reduced.

くわえて、前記各階級は、前記観測範囲の各階調値のうち予め定められた階調値を含まないことが好ましい。文字データ等は最小値と最大値とを取ることが多いが、このような特異点を含めて統計値を演算するのは、適切な画像補正の観点から好ましくない。そこで、予め特異点が分かっている場合には、所定の階調値を階級から除くことによって、特異点を排除した統計値を得ることが可能となる。   In addition, it is preferable that each of the classes does not include a predetermined gradation value among the gradation values of the observation range. Character data often takes a minimum value and a maximum value, but it is not preferable to calculate a statistical value including such a singular point from the viewpoint of appropriate image correction. Therefore, when a singular point is known in advance, a statistical value excluding the singular point can be obtained by removing a predetermined gradation value from the class.

ついに、本発明に係る画像処理方法は、画面を構成する各画素に表示すべき階調を示す画像データに統計処理を施して統計値を生成し、前記統計値に基づいて前記画像データに補正処理を施す画像処理方法であって、画素単位で画像データを取り込み、取り込んだ前記画像データの階調値が最小値から第1階調値までの第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第1階調値への方向へ累算した累積度数を階級毎に示す第1範囲における累積ヒストグラムを生成する共に、取り込んだ画像データの階調値が最大値から前記第1諧調値より大きい第2階調値までの第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第2階調値への方向へ累算した累積度数を階級毎に示す第2範囲における累積ヒストグラムを生成する第1ステップと、前記累積ヒストグラムの累積度数予め定められた基準値と各々比較する第2ステップと、前記第2ステップによる比較結果を参照して、前記基準値を超えた前記第1範囲における累積ヒストグラムの階級を基準最小値として生成すると共に、前記基準値を超えた前記第2範囲における累積ヒストグラムの階級を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として生成する第3ステップと、前記統計値に基づいて前記画像データに補正処理を施す第4ステップとを備え、 前記第1階調値は、前記第2階調値よりも小さい値であり、前記第1ステップは、取り込んだ前記画像データが前記第1範囲又は前記第2範囲にある場合にデコードして、属する階級毎に階級信号を各々出力するステップと、前記第1範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第1範囲の各階級毎に下位の階級からの累算値を各々生成し、前記第1範囲の最上位の階級の累算値を前記第1累算値として出力するステップと、前記第2範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第2範囲の各階級毎に上位の階級からの累算値を各々生成し、前記第2範囲の最下位の階級の累算値を前記第2累算値として出力するステップとを備え、前記第3ステップは、前記基準最小値及び基準最大値が得られると、前記統計値の生成を終了するを備えることを特徴とする。 Finally, the image processing method according to the present invention generates a statistical value by performing statistical processing on the image data indicating the gradation to be displayed on each pixel constituting the screen, and corrects the image data based on the statistical value. An image processing method for performing processing, wherein image data is captured in units of pixels, and when the gradation value of the captured image data is in a first range from a minimum value to a first gradation value, the image data is Cumulative histogram in the first range that identifies which class among a plurality of classes into which the first range is divided, and shows the cumulative frequency accumulated in the direction from the identified class to the first gradation value for each class When the gradation value of the captured image data is in the second range from the maximum value to the second gradation value larger than the first gradation value, the image data is divided into the plurality of the second range. Which rank of the class A first step of generating a cumulative histogram in a second range indicating for each class the cumulative frequency accumulated in the direction from the identified class to the second gradation value, and the cumulative frequency of the cumulative histogram A second step of comparing each with a predetermined reference value, and referring to a comparison result of the second step, and generating a cumulative histogram class in the first range exceeding the reference value as a reference minimum value A third step of generating a cumulative histogram class in the second range exceeding the reference value as a reference maximum value, and generating the reference minimum value and the reference maximum value as the statistical value; and based on the statistical value e Bei a fourth step of performing correction processing on the image data Te, the first gradation value, the a value smaller than the second gradation value, wherein the first step is Decoding when the captured image data is in the first range or the second range and outputting a class signal for each class to which the image data belongs; and whenever a class signal in the first range is output , Generating an accumulated value from a lower class for each class of the first range based on the class signal, and obtaining an accumulated value of the highest class of the first range as the first accumulated value. And each time the class signal of the second range is output, based on the class signal, generate an accumulated value from a higher class for each class of the second range, Outputting the accumulated value of the lowest class of the second range as the second accumulated value, and the third step includes obtaining the reference minimum value and the reference maximum value when the reference minimum value and the reference maximum value are obtained. Completing the generation is provided.

この発明によれば、画素単位で画像データを取り込む度に、各階級の頻度を累算して累算値を生成するので、1画面分の画像データを取り込んでヒストグラムを生成した後、累積ヒストグラムを生成するといった2段階の処理により累算値を生成するのではなく、ヒストグラムの生成を省略して、直接、累算値を生成することができる。そして、累算値が基準値に達した時点で統計値の生成が完了するので、処理を高速化でき、リアルタイムで画像を処理することが可能となる。特に、動画像をリアルタイムに補正する画像処理に好適である。   According to the present invention, every time image data is captured in units of pixels, the frequency of each class is accumulated to generate an accumulated value. Therefore, after the image data for one screen is captured and a histogram is generated, the cumulative histogram Instead of generating an accumulated value by a two-stage process such as generating an accumulated value, an accumulated value can be directly generated without generating a histogram. Since the generation of the statistical value is completed when the accumulated value reaches the reference value, the processing can be speeded up and the image can be processed in real time. Particularly, it is suitable for image processing for correcting a moving image in real time.

ここで、前記観測範囲は、最小値から第1階調値までの第1範囲と最大値から第2階調値までの第2範囲とを含み、前記第1ステップは、画素単位で前記画像データを取り込み、取り込んだ前記画像データの階調値が前記第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、各階級の頻度を最小値側から累算した第1累算値を生成する共に、取り込んだ画像データの階調値が前記第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、各階級の頻度を最大値側から累算した第2累算値を生成し、前記第2ステップは、前記第1累算値及び前記第2累算値を前記基準値と各々比較し、前記第3ステップは、前記比較結果を参照して、前記第1累算値が前記基準値に達したときの階調値を基準最小値として生成すると共に、前記第2累算値が前記基準値に達したときの階調値を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として出力することが好ましい。   Here, the observation range includes a first range from a minimum value to a first gradation value and a second range from a maximum value to a second gradation value, and the first step includes the image in units of pixels. When the gradation value of the captured image data is in the first range, the image data is specified to which of a plurality of classes into which the first range is divided, and A first accumulated value obtained by accumulating the frequency from the minimum value side is generated, and a plurality of classes in which the image data is divided into the second range when the gradation value of the captured image data is in the second range. And a second accumulated value is generated by accumulating the frequency of each class from the maximum value side, and the second step includes the first accumulated value and the second accumulated value. Each value is compared with the reference value, and the third step refers to the comparison result. The gradation value when the first accumulated value reaches the reference value is generated as a reference minimum value, and the gradation value when the second accumulated value reaches the reference value is determined as a reference maximum. Preferably, it is generated as a value, and the reference minimum value and the reference maximum value are output as the statistical value.

この発明によれば、画素単位で画像データが取り込まれる度に、最小値側からの累積ヒストグラムと最大値側からの累積ヒストグラムを更新できるから、基準最小値と基準最大値とを高速に求めることができる。   According to the present invention, since the cumulative histogram from the minimum value side and the cumulative histogram from the maximum value side can be updated each time image data is captured in pixel units, the reference minimum value and the reference maximum value can be obtained at high speed. Can do.

また、前記第1ステップにおいて、前記第1累算値が前記基準値に達したとき前記第1累算値の生成を停止すると共に前記第2累算値が前記基準値に達したとき前記第2累算値の生成を停止することが好ましい。この場合には、第1累算値又は第2累算値が基準値に達した時点で、累算値の生成を停止すことができるので、処理の高速化及び処理負荷の軽減を図ることができる。   In the first step, when the first accumulated value reaches the reference value, the generation of the first accumulated value is stopped, and when the second accumulated value reaches the reference value, the first accumulated value is stopped. It is preferable to stop generating the two accumulated values. In this case, since the generation of the accumulated value can be stopped when the first accumulated value or the second accumulated value reaches the reference value, the processing speed and the processing load can be reduced. Can do.

さらに、前記階級には複数の階調値が含まれてもよい。くわえて、前記各階級は、前記観測範囲の各階調値のうち予め定められた階調値を含まないことが好ましい。   Further, the class may include a plurality of gradation values. In addition, it is preferable that each of the classes does not include a predetermined gradation value among the gradation values of the observation range.

次に、本発明に係る画像処理プログラムは、画面を構成する各画素に表示すべき階調を示す画像データに統計処理を施して統計値を生成し、前記統計値に基づいて前記画像データに補正処理を施す画像処理プログラムにおいて、コンピュータを、画素単位で画像データを取り込み、取り込んだ前記画像データの階調値が最小値から第1階調値までの第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第1階調値への方向へ累算した累積度数を階級毎に示す第1範囲における累積ヒストグラムを生成する共に、取り込んだ画像データの階調値が最大値から前記第1諧調値より大きい第2階調値までの第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第2階調値への方向へ累算した累積度数を階級毎に示す第2範囲における累積ヒストグラムを生成する累算ヒストグラム生成手段と、前記累積ヒストグラムの累積度数を予め定められた基準値と各々比較する比較手段と、前記比較手段の比較結果を参照して、前記基準値を超えた前記第1範囲における累積ヒストグラムの階級を基準最小値として生成すると共に、前記基準値を超えた前記第2範囲における累積ヒストグラムの階級を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として出力する統計値生成手段と、前記統計値に基づいて前記画像データに補正処理を施す補正手段として機能させ、前記第1階調値は、前記第2階調値よりも小さい値であり、前記累算ヒストグラム生成手段は、取り込んだ前記画像データが前記第1範囲又は前記第2範囲にある場合にデコードして、属する階級毎に階級信号を各々出力し、前記第1範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第1範囲の各階級毎に下位の階級からの累算値を各々生成し、前記第1範囲の最上位の階級の累算値を前記第1累算値として出力し、前記第2範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第2範囲の各階級毎に上位の階級からの累算値を各々生成し、前記第2範囲の最下位の階級の累算値を前記第2累算値として出力し、前記統計値生成手段は、前記基準最小値及び基準最大値が得られると、前記統計値の生成を終了することを特徴とする。
Next, the image processing program according to the present invention generates a statistical value by performing statistical processing on image data indicating a gradation to be displayed on each pixel constituting the screen, and generates the statistical data based on the statistical value. In the image processing program for performing the correction process, the computer captures the image data in units of pixels, and when the gradation value of the captured image data is in the first range from the minimum value to the first gradation value, the image data In the first range, the cumulative frequency accumulated in the direction from the specified class to the first gradation value is specified for each class. When the cumulative histogram is generated and the gradation value of the captured image data is in the second range from the maximum value to the second gradation value larger than the first gradation value, the image data divides the second range. Shi An accumulated histogram that identifies a class among a plurality of classes and generates a cumulative histogram in a second range indicating the cumulative frequency accumulated in the direction from the identified class to the second gradation value for each class. Generating means, comparing means for comparing the cumulative frequency of the cumulative histogram with a predetermined reference value, and referring to the comparison result of the comparing means, the cumulative histogram in the first range exceeding the reference value A statistic that generates a class as a reference minimum value, generates a class of a cumulative histogram in the second range that exceeds the reference value as a reference maximum value, and outputs the reference minimum value and the reference maximum value as the statistic value Functioning as value generation means and correction means for performing correction processing on the image data based on the statistical value , wherein the first gradation value is smaller than the second gradation value. The accumulated histogram generating means decodes the captured image data when the captured image data is in the first range or the second range, and outputs a class signal for each class to which the first histogram belongs. Each time a range class signal is output, an accumulated value from a lower class is generated for each class of the first range based on the class signal, and the highest level class of the first range is generated. An accumulated value is output as the first accumulated value, and each time a class signal in the second range is output, an accumulation from an upper class is performed for each class in the second range based on the class signal. Each of the calculated values is generated, and the accumulated value of the lowest class in the second range is output as the second accumulated value. When the statistical value generating means obtains the reference minimum value and the reference maximum value, The generation of the statistical value is terminated .

本発明の第1実施形態に係る画像処理装置の構成を示すブロック図である。1 is a block diagram illustrating a configuration of an image processing apparatus according to a first embodiment of the present invention. 統計演算処理の概要を説明するための説明図である。It is explanatory drawing for demonstrating the outline | summary of a statistical calculation process. 基準最小値Rminの算出処理を説明するための説明図である。It is explanatory drawing for demonstrating the calculation process of reference | standard minimum value Rmin. 基準最大値Rmaxの算出処理を説明するための説明図である。It is explanatory drawing for demonstrating the calculation process of reference | standard maximum value Rmax. 統計値データ10Aに基づく画像補正処理を説明するための説明図である。It is explanatory drawing for demonstrating the image correction process based on the statistical value data 10A. 同実施形態のLUTの記憶内容の一例を示すグラフである。It is a graph which shows an example of the memory content of LUT of the embodiment. 本発明の第2実施形態に用いる統計値演算部の構成を示すブロック図である。It is a block diagram which shows the structure of the statistical value calculating part used for 2nd Embodiment of this invention. 同実施形態の累積ヒストグラムHG1及びHG2の一例を示す説明図である。It is explanatory drawing which shows an example of the accumulation histograms HG1 and HG2 of the embodiment. 同実施形態のLUTの記憶内容の一例を示すグラフである。It is a graph which shows an example of the memory content of LUT of the embodiment.

以下、図面を参照しつつ本発明に係る画像処理装置の一実施形態を説明する。図1は、第1実施形態に係わる画像処理装置の構成を示すブロック図である。画像処理装置100には、入力画像データGDinが供給される。入力画像データGDinは、1画面を構成する各画素に表示すべき階調値を示す。また、この例の入力画像データGDinは、1画素当たり8ビットの動画像データである。従って、入力画像データGDinは256階調を示すものであり、その最小値は「0」、最大値は「255」となる。画像処理装置100は、入力画像データGDinに統計処理を施して統計値を生成し、さらに、統計値を利用して入力画像データGDinに補正処理を施して出力画像データGDoutを生成する。   Hereinafter, an embodiment of an image processing apparatus according to the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing the configuration of the image processing apparatus according to the first embodiment. The image processing apparatus 100 is supplied with input image data GDin. The input image data GDin indicates a gradation value to be displayed on each pixel constituting one screen. The input image data GDin in this example is 8 bits of moving image data per pixel. Therefore, the input image data GDin indicates 256 gradations, the minimum value is “0”, and the maximum value is “255”. The image processing apparatus 100 performs statistical processing on the input image data GDin to generate a statistical value, and further uses the statistical value to perform correction processing on the input image data GDin to generate output image data GDout.

画像処理装置100は、統計値演算部10、補正パラメータ演算部20、及び画像補正部30を備える。まず、統計値演算部10は、入力画像データGDinに所定の統計演算処理を施して、統計値データ10Aを生成する。図2を参照して、統計演算処理の概要を説明する。統計演算処理では、最小値(0)から第1階調値D1までの第1範囲T1、及び最大値(255)から第2階調値D2までの第2範囲T2について、双方向に累積ヒストグラムHG1及びHG2を直接生成し、生成された累積ヒストグラムHG1及びHG2の度数が予め定められた基準値REFに達した点を基準最小値Rmin及び基準最大値Rmaxとして特定し、これらを示す統計値データ10Aを生成する。なお、第2階調値D2は第1階調値D1よりも大きい。   The image processing apparatus 100 includes a statistical value calculation unit 10, a correction parameter calculation unit 20, and an image correction unit 30. First, the statistical value calculation unit 10 performs predetermined statistical calculation processing on the input image data GDin to generate statistical value data 10A. The outline of the statistical calculation process will be described with reference to FIG. In the statistical calculation processing, a cumulative histogram is bidirectionally accumulated for the first range T1 from the minimum value (0) to the first gradation value D1 and the second range T2 from the maximum value (255) to the second gradation value D2. Statistical data that directly generates HG1 and HG2, specifies the points at which the frequencies of the generated cumulative histograms HG1 and HG2 have reached a predetermined reference value REF as the reference minimum value Rmin and the reference maximum value Rmax, and indicate these 10A is generated. Note that the second gradation value D2 is larger than the first gradation value D1.

累積ヒストグラムは、ヒストグラムの度数を一定の方向(最小値から最大値への方向、又は、最大値から最小値への方向)へ累算した度数を各階級毎に示す。階級の幅は、任意に設定することができるが、この例の階級の幅は1階調である。また、この例では、2種類の累積ヒストグラムを同時に生成する。即ち、最小値から第1階調値D1へ向けた累積ヒストグラムHG1と、最大値から第2階調値D2へ向けた累積ヒストグラムHG2とが生成される。   The cumulative histogram indicates the frequency obtained by accumulating the frequency of the histogram in a certain direction (the direction from the minimum value to the maximum value or the direction from the maximum value to the minimum value) for each class. The width of the class can be set arbitrarily, but the width of the class in this example is one gradation. In this example, two types of cumulative histograms are generated simultaneously. That is, a cumulative histogram HG1 from the minimum value toward the first gradation value D1 and a cumulative histogram HG2 from the maximum value toward the second gradation value D2 are generated.

次に、補正パラメータ演算部20は、統計値データ10Aに基づいてルックアップテーブル(以下、LUTと称する。)を生成する。LUTには、入力画像データGDinの各階調値と補正後の各階調値とを対応付けて記憶され、その記憶内容は統計値データ10Aに基づいて更新される。画像補正部30は、LUTを参照して、出力画像データGDoutを生成する。具体的には、入力画像データGDinの階調値を読み出しアドレスとしてLUTにアクセスし、LUTから読み出した階調値を出力画像データGDoutとして出力する。   Next, the correction parameter calculation unit 20 generates a lookup table (hereinafter referred to as LUT) based on the statistical value data 10A. In the LUT, each gradation value of the input image data GDin and each corrected gradation value are stored in association with each other, and the stored contents are updated based on the statistical value data 10A. The image correction unit 30 generates output image data GDout with reference to the LUT. Specifically, the LUT is accessed using the gradation value of the input image data GDin as a read address, and the gradation value read from the LUT is output as output image data GDout.

次に、統計値演算部10の詳細を説明する。統計値演算部10は、デコーダ11と、第1論理演算部12、第2論理演算部13、カウンタCNT0〜CNT15及びCNT240〜CNT255、第1比較回路COP1、第2比較回路COP2、基準最小値生成回路14、並びに基準最大値生成回路15を備える。   Next, details of the statistical value calculation unit 10 will be described. The statistical value calculation unit 10 includes a decoder 11, a first logical calculation unit 12, a second logical calculation unit 13, counters CNT0 to CNT15 and CNT240 to CNT255, a first comparison circuit COP1, a second comparison circuit COP2, and a reference minimum value generation. A circuit 14 and a reference maximum value generation circuit 15 are provided.

デコーダ11は、画素単位で取り込んだ入力画像データGDinをデコードして、第1範囲T1に対応する階級信号H0〜H15と第2範囲T2に対応する階級信号H240〜H255とを生成する。階級信号H0〜H15及びH240〜H255は、入力画像データGDinの属する階級を各々指示する。上述したようにこの例における階級の幅は1階調であるから、入力画像データGDinの階調値が「0」〜「15」において各階級信号H0〜H15は各々ハイレベルとなり、その階調値が「240」〜「255」において各階級信号H240〜H255は各々ハイレベルとなる。また、デコーダ11は、第1範囲T1及び第2範囲T2にある入力画像データGDinのみをデコードし、他の範囲についてはデコードしない。これによりデコーダ11を簡易に構成することができ、さらに処理速度が向上する。   The decoder 11 decodes the input image data GDin captured in units of pixels to generate class signals H0 to H15 corresponding to the first range T1 and class signals H240 to H255 corresponding to the second range T2. Class signals H0 to H15 and H240 to H255 indicate the class to which the input image data GDin belongs, respectively. As described above, since the class width in this example is one gradation, when the gradation value of the input image data GDin is “0” to “15”, each of the class signals H0 to H15 is at a high level. When the values are “240” to “255”, each of the class signals H240 to H255 is at a high level. The decoder 11 decodes only the input image data GDin in the first range T1 and the second range T2, and does not decode other ranges. As a result, the decoder 11 can be configured easily, and the processing speed is further improved.

第1論理演算部12は、オア回路OR1〜OR15を備える。オア回路OR1〜OR15は、最下位から2番目の階級から第1範囲T1の最上位の階級(階調値15)に各々対応して設けられている。各オア回路OR1〜OR15は、下位の階級に対応するカウンタへ入力される信号と、当該階級に対応する階級信号H0〜H15との論理和を演算する。例えば、オア回路OR2は、第3番目の階級(階調値2)に対応しており、階級信号H2と第2番目の階級に対応するカウンタCNT1に入力されるオア回路OR1の出力信号との論理和を演算して、演算結果をカウンタCNT2に出力する。   The first logic operation unit 12 includes OR circuits OR1 to OR15. The OR circuits OR1 to OR15 are provided corresponding to the second class from the lowest level to the highest level (gradation value 15) in the first range T1. Each of the OR circuits OR1 to OR15 calculates a logical sum of the signal input to the counter corresponding to the lower class and the class signals H0 to H15 corresponding to the class. For example, the OR circuit OR2 corresponds to the third class (gradation value 2), and the class signal H2 and the output signal of the OR circuit OR1 input to the counter CNT1 corresponding to the second class The logical sum is calculated and the calculation result is output to the counter CNT2.

第2論理演算部13は、オア回路OR240〜OR255を備える。オア回路OR240〜OR255は、最上位から2番目の階級から第2範囲の最下位の階級に各々対応して設けられている。各オア回路OR240〜OR255は、上位の階級に対応するカウンタへ入力される信号と、当該階級に対応する階級信号H240〜H255との論理和を演算する。例えば、オア回路OR253は、第253番目の階級(階調値253)に対応しており、階級信号H253と第254番目の階級に対応するカウンタCNT254に入力されるオア回路OR254の出力信号との論理和を演算して、演算結果をカウンタCNT253に出力する。   The second logic operation unit 13 includes OR circuits OR240 to OR255. The OR circuits OR240 to OR255 are provided corresponding to the second class from the highest level to the lowest level in the second range, respectively. Each of the OR circuits OR240 to OR255 calculates a logical sum of the signal input to the counter corresponding to the upper class and the class signals H240 to H255 corresponding to the class. For example, the OR circuit OR253 corresponds to the 253rd class (gradation value 253), and the OR signal OR253 and the output signal of the OR circuit OR254 input to the counter CNT254 corresponding to the 254th class The logical sum is calculated and the calculation result is output to the counter CNT253.

カウンタCNT0〜CNT15は、階級信号H0又はオア回路OR1〜OR15の出力信号を、入力画像データDinに同期して各々計数する。カウンタCNT0〜CNT15の各計数値は、最下位の階級からの累積度数を各々示すものとなる。従って、カウンタCNT0〜CNT15の各計数値は、第1範囲T1における累積ヒストグラムの各値を示す。カウンタCNT15の計数値は、第1範囲T1の最上位の階級(階調値15)の累積度数を示す。以下の説明では、カウンタCNT15の計数値を第1累算値Σ1と称する。   The counters CNT0 to CNT15 respectively count the class signal H0 or the output signals of the OR circuits OR1 to OR15 in synchronization with the input image data Din. Each count value of the counters CNT0 to CNT15 indicates the cumulative frequency from the lowest rank. Therefore, each count value of the counters CNT0 to CNT15 indicates each value of the cumulative histogram in the first range T1. The count value of the counter CNT15 indicates the cumulative frequency of the highest rank (gradation value 15) in the first range T1. In the following description, the count value of the counter CNT15 is referred to as a first accumulated value Σ1.

また、カウンタCNT240〜CNT255は、階級信号H255又はオア回路OR240〜OR254の出力信号を、入力画像データDinに同期して各々計数する。カウンタCNT240〜CNT255の各計数値は、最上位の階級からの累積度数を各々示すものとなる。従って、カウンタCNT240〜CNT255の各計数値は、第2範囲T2における累積ヒストグラムの各値を示す。そして、カウンタCNT240の計数値は、第2範囲T2の最下位の階級(階調値240)の累積度数を示す。以下の説明では、カウンタCNT240の計数値を第2累算値Σ2と称する。   Further, the counters CNT240 to CNT255 respectively count the class signal H255 or the output signals of the OR circuits OR240 to OR254 in synchronization with the input image data Din. Each count value of the counters CNT240 to CNT255 indicates the cumulative frequency from the highest rank. Therefore, each count value of the counters CNT240 to CNT255 indicates each value of the cumulative histogram in the second range T2. The count value of the counter CNT240 indicates the cumulative frequency of the lowest class (gradation value 240) in the second range T2. In the following description, the count value of the counter CNT240 is referred to as a second accumulated value Σ2.

第1比較回路COP1は、基準値REFと第1累算値Σ1とを比較し、両者の値が一致したとき、出力信号をアクティブとする。また、第2比較回路COP2は、基準値REFと第2累算値Σ2とを比較し、両者の値が一致したとき、出力信号をアクティブとする。   The first comparison circuit COP1 compares the reference value REF and the first accumulated value Σ1, and activates the output signal when the two values match. The second comparison circuit COP2 compares the reference value REF and the second accumulated value Σ2, and activates the output signal when the two values match.

基準最小値生成回路14は、複数の比較回路を備え、各カウンタCNT0〜CNT15の計数値を比較できるように構成されている。そして、基準最小値生成回路14は、第1比較回路COP1の出力信号に基づいて、第1累算値Σ1が基準値REFと一致したことを検知すると、基準値REFを超えた階級(階調値)を特定し、これを基準最小値Rminとして出力する。例えば、図3に示すように基準値REFが「10」であり、階調値15から階調値7までの累積ヒストグラムの値が「10」、階調値6の累積ヒストグラムの値が「19」であるとすれば、階調値7が基準最小値Rminとなる。   The reference minimum value generation circuit 14 includes a plurality of comparison circuits, and is configured to compare the count values of the counters CNT0 to CNT15. When the reference minimum value generation circuit 14 detects that the first accumulated value Σ1 matches the reference value REF based on the output signal of the first comparison circuit COP1, the class (grayscale level) exceeding the reference value REF is detected. Value) is specified, and this is output as the reference minimum value Rmin. For example, as shown in FIG. 3, the reference value REF is “10”, the cumulative histogram value from the gradation value 15 to the gradation value 7 is “10”, and the cumulative histogram value of the gradation value 6 is “19”. ", The gradation value 7 is the reference minimum value Rmin.

一方、基準最大値生成回路15は、複数の比較回路を備え、各カウンタCNT240〜CNT255の計数値を比較できるように構成されている。そして、基準最大値生成回路15は、第2比較回路COP2の出力信号に基づいて、第2累算値Σ2が基準値REFと一致したことを検知すると、基準値REFを超えた階級(階調値)を特定し、これを基準最大値Rmaxとして出力する。例えば、図4に示すように基準値REFが「10」であり、階調値240から階調値249までの累積ヒストグラムの値が「10」、階調値250の累積ヒストグラムの値が「9」であるとすれば、階調値249が基準最大値Rmaxとなる。   On the other hand, the reference maximum value generation circuit 15 includes a plurality of comparison circuits, and is configured to compare the count values of the counters CNT240 to CNT255. When the reference maximum value generation circuit 15 detects that the second accumulated value Σ2 matches the reference value REF based on the output signal of the second comparison circuit COP2, the class (grayscale level) exceeding the reference value REF is detected. Value) is specified, and this is output as the reference maximum value Rmax. For example, as shown in FIG. 4, the reference value REF is “10”, the cumulative histogram value from the gradation value 240 to the gradation value 249 is “10”, and the cumulative histogram value of the gradation value 250 is “9”. ”, The gradation value 249 becomes the reference maximum value Rmax.

このように統計値演算部10は、入力画像データGDinが画素単位で取り込まれる度に最小値側及び最大値側からの累積ヒストグラムHG1及びHG2の各値を更新し、累積ヒストグラムの値が基準値REFを超えた時点で、基準最小値Rmin及び基準最大値Rmaxを各々特定する。即ち、1画面分の入力画像データGDinを取り込んでヒストグラムを作成した後、ヒストグラムに基づいて累積ヒストグラムを生成するのではなく、累積ヒストグラムHG1及びHG2を直接生成している。累積ヒストグラムHG1及びHG2の値が基準値REFを超えた時点で統計値データ10Aを生成することができるので、少なくとも1画面分の入力画像データGDinを取り込んだ時点で処理を完了させることができ、通常は、1画面総ての入力画像データGDinを取り込む前に処理を完了させることができる。これにより、処理を高速化でき、動画などをリアルタイムで処理することが可能となる。   As described above, the statistical value calculation unit 10 updates the values of the cumulative histograms HG1 and HG2 from the minimum value side and the maximum value side each time the input image data GDin is captured in units of pixels, and the value of the cumulative histogram is the reference value. When REF is exceeded, the reference minimum value Rmin and the reference maximum value Rmax are specified. That is, after the input image data GDin for one screen is taken and a histogram is created, the cumulative histograms HG1 and HG2 are directly generated instead of generating the cumulative histogram based on the histogram. Since the statistical data 10A can be generated when the values of the cumulative histograms HG1 and HG2 exceed the reference value REF, the processing can be completed when the input image data GDin for at least one screen is captured. Normally, the processing can be completed before the input image data GDin for all the screens is captured. As a result, the processing speed can be increased, and a moving image or the like can be processed in real time.

次に、統計値データ10Aに基づく画像補正処理について説明する。図5を参照して、これらの処理の一例を説明する。例えば、1画面の入力画像データGDinの階調値が図5(A)のヒストグラムに示されるように分布し、上述した統計演算処理によって基準最小値Rmin及び基準最大値Rmaxが得られたとする。この場合、画像補正部30は、図5(B)に示すように階調値が基準最小値Rminを下回るシャドウ部をカットすると共に、階調値が基準最大値Rmaxを上回るハイライト部をカットする。   Next, an image correction process based on the statistical value data 10A will be described. An example of these processes will be described with reference to FIG. For example, it is assumed that the gradation value of the input image data GDin of one screen is distributed as shown in the histogram of FIG. 5A, and the reference minimum value Rmin and the reference maximum value Rmax are obtained by the statistical calculation process described above. In this case, as shown in FIG. 5B, the image correction unit 30 cuts the shadow portion whose gradation value is lower than the reference minimum value Rmin and cuts the highlight portion whose gradation value is higher than the reference maximum value Rmax. To do.

このため、補正パラメータ演算部20は、出力画像データGDoutの最小値が基準最小値Rminとなり、その最大値が基準最大値RmaxとなるようにLUTを生成する。具体的には、画像補正処理の入出力階調特性が以下の式で与えられるようにLUTを生成する。
GDout=fa*GDin−fb
fa=256/(Rmax−Rmin)
fb=fa*Rmin
なお、faは入出力階調特性の傾きであり、fbは切片である。
Therefore, the correction parameter calculation unit 20 generates the LUT so that the minimum value of the output image data GDout becomes the reference minimum value Rmin and the maximum value becomes the reference maximum value Rmax. Specifically, the LUT is generated so that the input / output gradation characteristics of the image correction processing are given by the following expression.
GDout = fa * GDin−fb
fa = 256 / (Rmax−Rmin)
fb = fa * Rmin
Note that fa is the slope of the input / output gradation characteristics, and fb is the intercept.

図6に、LUTの記憶内容の一例を示す。同図において、点線は画像補正処理を実行しない場合の特性であり、実線は画像補正処理を実行する場合の入出力階調特性である。この図に示すように入力画像データGDinの階調値が最小値「0」から基準最小値Rminまでの範囲において、出力画像データGDoutの階調値が最小値「0」となる。また、入力画像データGDinの階調値が最大値「255」から基準最大値Rmaxまでの範囲において、出力画像データGDoutの階調値が最大値「255」となる。従って、シャドウ部とハイライト部がカットされ、図に示す矢印の方向に階調全体が伸張される。   FIG. 6 shows an example of the contents stored in the LUT. In the figure, dotted lines are characteristics when image correction processing is not executed, and solid lines are input / output gradation characteristics when image correction processing is executed. As shown in this figure, the gradation value of the output image data GDout becomes the minimum value “0” in the range where the gradation value of the input image data GDin ranges from the minimum value “0” to the reference minimum value Rmin. Further, in the range where the gradation value of the input image data GDin is from the maximum value “255” to the reference maximum value Rmax, the gradation value of the output image data GDout becomes the maximum value “255”. Therefore, the shadow portion and the highlight portion are cut, and the entire gradation is expanded in the direction of the arrow shown in the figure.

以上説明したように本実施形態によれば、ヒストグラムを生成する過程を省略して、双方向の累積ヒストグラムHG1及びHG2を生成したので、統計値演算処理を高速に実行できる。さらに、基準最小値Rmin及び基準最大値Rmaxが得られた時点で統計演算処理を終了させることができるので、1画面分の入力画像データGDinを取り込む前に基準最小値Rmin及び基準最大値Rmaxが得られば、統計演算処理を終了させることができ、動画等をリアルタイムで処理することが可能となる。   As described above, according to the present embodiment, the process of generating the histogram is omitted, and the bidirectional cumulative histograms HG1 and HG2 are generated, so that the statistical value calculation process can be executed at high speed. Further, since the statistical calculation process can be terminated when the reference minimum value Rmin and the reference maximum value Rmax are obtained, the reference minimum value Rmin and the reference maximum value Rmax are determined before the input image data GDin for one screen is captured. If it is obtained, the statistical calculation process can be terminated, and a moving image or the like can be processed in real time.

次に、本発明の第2実施形態に係わる画像処理装置について説明する。第1実施形態においては階級の幅を1階調としたが、第2実施形態は階級の幅を複数階調に設定する。第2実施形態に係わる画像処理装置は、統計値演算部10の詳細な構成を除いて、図1に示す第1実施形態の画像処理装置100と同様である。   Next, an image processing apparatus according to the second embodiment of the present invention will be described. In the first embodiment, the class width is set to one gradation, but in the second embodiment, the class width is set to a plurality of gradations. The image processing apparatus according to the second embodiment is the same as the image processing apparatus 100 according to the first embodiment shown in FIG. 1 except for the detailed configuration of the statistical value calculation unit 10.

図7は、第2実施形態に係わる統計値演算部10の詳細な構成を示すブロック図である。なお、この例では、階級の幅を2階調に設定してあり、第1階調値D1は「15」であり、第2階調値D2は「240」である。この例では、カウンタCNT0〜CNT7を用いて8階級の累積度数を各々計数し、CNT120〜CNT127を用いて8階級の累積度数を各々計数する。例えば、カウンタCNT0は階調値「0」及び「1」に対応しており、カウンタCNT127は階調値「254」及び「255」に対応している。   FIG. 7 is a block diagram illustrating a detailed configuration of the statistical value calculation unit 10 according to the second embodiment. In this example, the class width is set to two gradations, the first gradation value D1 is “15”, and the second gradation value D2 is “240”. In this example, the 8th class cumulative frequency is counted using the counters CNT0 to CNT7, and the 8th class cumulative frequency is counted using CNT120 to CNT127. For example, the counter CNT0 corresponds to the gradation values “0” and “1”, and the counter CNT127 corresponds to the gradation values “254” and “255”.

図8に累積ヒストグラムHG1及びHG2の一例を示す。この例では、最下位から第4番目の階級(階調値6及び7に対応)において累積ヒストグラムの値が基準値REFと一致する。従って、基準最小値Rminは当該階級の最小値「6」となる。なお、基準最小値Rminを平均値である「6.5」にしてもよいし、あるいは、当該階級の最大値「7」としてもよい。また、最上位から第3番目の階級(階調値251及び250に対応)において累積ヒストグラムの値が基準値REFと一致する。従って、基準最大値Rmaxは当該階級の最大値「251」となる。なお、基準最大値Rmaxを平均値である「250.5」にしてもよいし、あるいは、当該階級の最小値「250」としてもよい。   FIG. 8 shows an example of the cumulative histograms HG1 and HG2. In this example, the value of the cumulative histogram matches the reference value REF in the fourth class from the lowest (corresponding to the gradation values 6 and 7). Therefore, the reference minimum value Rmin is the minimum value “6” of the class. The reference minimum value Rmin may be the average value “6.5”, or may be the maximum value “7” of the class. In addition, in the third class from the top (corresponding to the gradation values 251 and 250), the value of the cumulative histogram matches the reference value REF. Therefore, the reference maximum value Rmax is the maximum value “251” of the class. The reference maximum value Rmax may be the average value “250.5”, or may be the minimum value “250” of the class.

このように階級の幅を複数の階調に対応させると、累積ヒストグラムを入力階調に対して荒くとることになるが、カウンタやオア回路の数を低減できる。また、画像補正処理には、階調の精度に対する感度がそれ程必要ではなく、大きな特徴が分かれば十分なものもある。本実施形態は、そのような画像補正処理に適用することが好ましい。   When the width of the class is made to correspond to a plurality of gradations in this way, the cumulative histogram becomes rough with respect to the input gradation, but the number of counters and OR circuits can be reduced. Also, image correction processing does not require much sensitivity to gradation accuracy, and may be sufficient if a large feature is known. The present embodiment is preferably applied to such image correction processing.

例えば、ヒストグラムの分散性からコントラストを調整する場合が該当する。図9に、第2実施形態に好適な画像補正処理に用いられるLUTの記憶内容の一例を示す。同図において、点線は画像補正処理を実行しない場合の特性であり、実線は画像補正処理を実行する場合の入出力階調特性である。この画像補正処理にあっては、シャドウ部において出力諧調を下げ、ハイライト部において出力階調を上げることにより、入出力階調特性がS字形状となるようにしている。そして、その程度を基準最小値Rmin及び基準最大値Rmaxに基づいて定める。これにより、中間階調のコントラストを累積ヒストグラムHG1及びHG2に応じて強調することができ、視認性を向上させることができる。   For example, this corresponds to the case where the contrast is adjusted based on the dispersibility of the histogram. FIG. 9 shows an example of stored contents of an LUT used for image correction processing suitable for the second embodiment. In the figure, dotted lines are characteristics when image correction processing is not executed, and solid lines are input / output gradation characteristics when image correction processing is executed. In this image correction process, the output gradation is lowered in the shadow portion and the output gradation is raised in the highlight portion, so that the input / output gradation characteristics have an S-shape. The degree is determined based on the reference minimum value Rmin and the reference maximum value Rmax. Thereby, the contrast of the intermediate gradation can be enhanced according to the cumulative histograms HG1 and HG2, and the visibility can be improved.

なお、本発明は累積値を高速に生成する手段を備えた点に特徴があり、それを用いた処理方法に限定されるものではない。また、累積値の生成手段に関しても、上述した第1及び第2実施形態に限定されるものではなく、例えば、以下の変形が可能である。   The present invention is characterized in that it includes means for generating accumulated values at a high speed, and is not limited to a processing method using the means. Also, the means for generating the accumulated value is not limited to the first and second embodiments described above, and for example, the following modifications are possible.

(1)上述した各実施形態において、入力画像データGDinはRGBの各色に対応する画像データであってもよい。この場合、統計値演算部10は、RGB各色の画像データに基づいて輝度情報を生成し、輝度情報に基づいて基準最小値Rmin及び基準最大値Rmaxを生成してもよい。そして、補正パラメータ演算部20で生成したLUTをRGB各色で共通に用いて出力画像データGDoutを生成してもよい。あるいは、輝度情報の替わりにG色の画像データを用いて基準最小値Rmin及び基準最大値Rmaxを生成してもよい。   (1) In each embodiment described above, the input image data GDin may be image data corresponding to each color of RGB. In this case, the statistical value calculation unit 10 may generate luminance information based on the image data of each RGB color, and may generate the reference minimum value Rmin and the reference maximum value Rmax based on the luminance information. The output image data GDout may be generated by using the LUT generated by the correction parameter calculation unit 20 in common for each color of RGB. Alternatively, the reference minimum value Rmin and the reference maximum value Rmax may be generated using G color image data instead of the luminance information.

(2)また、階級の幅は、1階調又は2階調に限られず自由定めてよい。さらに、3階調に階級、2階調の階級、及び1階調の階級といったように異なる幅を有する階級が混在してもよい。   (2) The class width is not limited to one gradation or two gradations, and may be freely determined. Furthermore, classes having different widths such as a class of 3 gradations, a class of 2 gradations, and a class of 1 gradation may be mixed.

(3)上述した各実施形態において、少なくとも統計値演算部10は、ハードウエアで構成されることを前提としたが、これをソフトウエアで実現してもよい。この場合にも、ヒストグラムを生成することなく累積ヒストグラムHG1及びHG2が直接生成されるので、処理の高速化を図ることができ、CPUの負荷を軽減できる。   (3) In each embodiment described above, it is assumed that at least the statistical value calculation unit 10 is configured by hardware. However, this may be realized by software. Also in this case, since the cumulative histograms HG1 and HG2 are directly generated without generating a histogram, the processing speed can be increased and the load on the CPU can be reduced.

(4)上述した各実施形態において、統計値演算部10は、基準最小値Rmin及び基準最大値Rmaxが得られた時点で処理を終了したが、例えば、基準最小値Rminが得られた時点で基準最小値Rminを得るためのデコード及び累積ヒストグラムHG1の生成処理を停止し、基準最大値Rmaxが得られた時点で基準最大値Rmaxを得るためのデコード及び累積ヒストグラムHG2の生成処理を停止してもよい。   (4) In each embodiment described above, the statistical value calculation unit 10 ends the process when the reference minimum value Rmin and the reference maximum value Rmax are obtained. For example, at the time when the reference minimum value Rmin is obtained. The decoding and cumulative histogram HG1 generation process for obtaining the reference minimum value Rmin is stopped, and the decoding and cumulative histogram HG2 generation process for obtaining the reference maximum value Rmax is stopped when the reference maximum value Rmax is obtained. Also good.

(5)また、上述した各実施形態におい第1階調値D1及び第2階調値D2は、入力画像データGDinの階調数に基づいて自動的に変更してもよい。また、基準値REFは、1画面の画素数に応じて自動的に変更してもよい。   (5) In the above-described embodiments, the first gradation value D1 and the second gradation value D2 may be automatically changed based on the number of gradations of the input image data GDin. The reference value REF may be automatically changed according to the number of pixels on one screen.

(6)また、上述した各実施形態において所定の階調値を各累積ヒストグラムHG1及びHG2の累積度数に反映させないようにしてもよい。例えば、階調値0及び階調値255は、文字などを表示する場合に使われることが多いが、文字等はビデオカメラによって撮像された画像と性質が異なる。このような特異点を含めて統計値を演算するのは、適切な画像補正の観点から好ましくない。そこで、予め特異点が分かっている場合には、所定の階調値を階級から除くことによって、特異点を排除した統計値データ10Aを得ることが可能となる。   (6) Further, in each of the above-described embodiments, a predetermined gradation value may not be reflected in the cumulative frequencies of the cumulative histograms HG1 and HG2. For example, the gradation value 0 and the gradation value 255 are often used when displaying characters and the like, but the characters and the like are different in nature from images captured by a video camera. It is not preferable to calculate a statistical value including such a singular point from the viewpoint of appropriate image correction. Therefore, when the singular point is known in advance, the statistical value data 10A from which the singular point is excluded can be obtained by removing the predetermined gradation value from the class.

(7)また、上述した各実施形態は、液晶パネル、エレクトロルミネッセンス(EL)パネル、デジタルマイクロミラーデバイス(DMD)パネル、プラズマ発光や電子放出による蛍光等を用いた様々な電気光学パネルを備えた電子機器に用いることが好ましい。この場合、電子機器は、出力画像データGDoutに基づいて電気光学パネルを制御するための制御信号を発生するタイミング信号発生回路と、出力画像データGDoutから電気光学パネルに供給する画像信号を生成する画像信号生成回路、電気光学パネルを駆動する駆動回路、及び電気光学パネルを備える。電子機器としては、例えば、モバイル型のパーソナルコンピュータ、携帯電話、テレビや、ビューファインダ型、モニタ直視型のビデオテープレコーダ、カーナビゲーション装置、ページャ、電子手帳、電卓、ワードプロセッサ、ワークステーション、テレビ電話、POS端末、タッチパネルを備えた装置等などが挙げられる。   (7) In addition, each of the above-described embodiments includes a liquid crystal panel, an electroluminescence (EL) panel, a digital micromirror device (DMD) panel, and various electro-optical panels using plasma emission or fluorescence by electron emission. It is preferable to use it for electronic equipment. In this case, the electronic device generates a control signal for controlling the electro-optical panel based on the output image data GDout, and an image that generates an image signal to be supplied to the electro-optical panel from the output image data GDout. A signal generation circuit, a drive circuit for driving the electro-optical panel, and the electro-optical panel are provided. Examples of electronic devices include mobile personal computers, mobile phones, TVs, viewfinder type, monitor direct-view video tape recorders, car navigation devices, pagers, electronic notebooks, calculators, word processors, workstations, video phones, Examples include a POS terminal, a device equipped with a touch panel, and the like.

10…統計値演算部(累算値生成手段、比較手段、統計値生成手段)、10A…統計値データ(統計値)、11…デコーダ(デコード手段)、12…第1論理演算部、13…第2論理演算部、20…補正パラメータ演算部、30…画像補正部、100…画像処理装置、CNT0〜CNT15,CNT240〜CNT255…カウンタ、COP1…第1比較回路(比較手段)、COP2…第2比較回路(比較手段)、D1…第1階調値、D2…第2階調値、GDin…入力画像データ、GDout…出力画像データ、H0〜H15,H240〜H255…階級信号、HG1,HG2…累積ヒストグラム、OR1〜OR14,OR240〜OR254…オア回路、REF…基準値、Rmax…基準最大値、Rmin…基準最小値、T1…第1範囲、T2…第2範囲。   DESCRIPTION OF SYMBOLS 10 ... Statistical value calculation part (Accumulation value production | generation means, comparison means, statistic value production | generation means) 10A ... Statistical value data (statistical value), 11 ... Decoder (decoding means), 12 ... 1st logic operation part, 13 ... Second logic operation unit, 20 ... correction parameter operation unit, 30 ... image correction unit, 100 ... image processing device, CNT0 to CNT15, CNT240 to CNT255 ... counter, COP1 ... first comparison circuit (comparison means), COP2 ... second Comparison circuit (comparison means), D1 ... first gradation value, D2 ... second gradation value, GDin ... input image data, GDout ... output image data, H0-H15, H240-H255 ... class signal, HG1, HG2 ... Cumulative histogram, OR1-OR14, OR240-OR254 ... OR circuit, REF ... reference value, Rmax ... reference maximum value, Rmin ... reference minimum value, T1 ... first range T2 ... the second range.

Claims (6)

画面を構成する各画素に表示すべき階調を示す画像データに統計処理を施して統計値を生成し、前記統計値に基づいて前記画像データに補正処理を施す画像処理装置において、
画素単位で画像データを取り込み、取り込んだ前記画像データの階調値が最小値から第1階調値までの第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第1階調値への方向へ累算した累積度数を階級毎に示す第1範囲における累積ヒストグラムを生成する共に、取り込んだ画像データの階調値が最大値から前記第1諧調値より大きい第2階調値までの第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第2階調値への方向へ累算した累積度数を階級毎に示す第2範囲における累積ヒストグラムを生成する累算ヒストグラム生成手段と、
前記累積ヒストグラムの累積度数を予め定められた基準値と各々比較する比較手段と、
前記比較手段の比較結果を参照して、前記基準値を超えた前記第1範囲における累積ヒストグラムの階級を基準最小値として生成すると共に、前記基準値を超えた前記第2範囲における累積ヒストグラムの階級を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として出力する統計値生成手段と、
前記統計値に基づいて前記画像データに補正処理を施す補正手段と
を備え、
前記第1階調値は、前記第2階調値よりも小さい値であり、
前記累算ヒストグラム生成手段は、
取り込んだ前記画像データが前記第1範囲又は前記第2範囲にある場合にデコードして、属する階級毎に階級信号を各々出力するデコード手段と、
前記第1範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第1範囲の各階級毎に下位の階級からの累算値を各々生成し、前記第1範囲の最上位の階級の累算値を前記第1累算値として出力する第1計数手段と、
前記第2範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第2範囲の各階級毎に上位の階級からの累算値を各々生成し、前記第2範囲の最下位の階級の累算値を前記第2累算値として出力する第2計数手段とを備え、
前記統計値生成手段は、前記基準最小値及び基準最大値が得られると、前記統計値の生成を終了する
ことを特徴とする画像処理装置。
In an image processing apparatus that performs statistical processing on image data indicating gradation to be displayed on each pixel constituting a screen to generate a statistical value, and performs correction processing on the image data based on the statistical value.
When image data is captured in units of pixels, and the gradation value of the captured image data is in a first range from a minimum value to a first gradation value, the image data is divided into a plurality of classes divided into the first range. Identify the class that belongs to it, generate a cumulative histogram in the first range indicating the cumulative frequency accumulated in the direction from the specified class to the first gradation value for each class, and at the same time of the captured image data When the gradation value is in the second range from the maximum value to the second gradation value that is larger than the first gradation value, it is determined which class the image data belongs to among a plurality of classes into which the second range is divided. An accumulated histogram generating means for generating a cumulative histogram in a second range that identifies and indicates the cumulative frequency accumulated in the direction from the identified class to the second gradation value for each class;
Comparison means for comparing the cumulative frequency of the cumulative histogram with a predetermined reference value, respectively.
With reference to the comparison result of the comparison means, the cumulative histogram class in the first range exceeding the reference value is generated as a reference minimum value, and the cumulative histogram class in the second range exceeding the reference value is generated. As a reference maximum value, and a statistical value generation means for outputting the reference minimum value and the reference maximum value as the statistical value;
E Bei and correction means for performing correction processing on the image data based on the statistical values,
The first gradation value is smaller than the second gradation value;
The accumulated histogram generating means includes:
Decoding when the captured image data is in the first range or the second range, and outputting a class signal for each class to which the image data belongs;
Each time the class signal of the first range is output, an accumulated value from a lower class is generated for each class of the first range based on the class signal, and the highest level of the first range is generated. First counting means for outputting the accumulated value of the class as the first accumulated value;
Each time the class signal of the second range is output, an accumulated value from an upper class is generated for each class of the second range based on the class signal, and the lowest level of the second range is generated. And second counting means for outputting the accumulated value of the class as the second accumulated value,
The image processing apparatus, wherein the statistical value generation means ends the generation of the statistical value when the reference minimum value and the reference maximum value are obtained .
前記補正手段は、
前記統計値に基づいてルックアップテーブルを生成し、
入力画像データの諧調値に基づいてルックアップテーブルより読み出した諧調値を補正後の画像データとして出力する
ことを特徴とする請求項1に記載の画像処理装置。
The correction means includes
Generating a lookup table based on the statistics,
The image processing apparatus according to claim 1, wherein the gradation value read from the lookup table based on the gradation value of the input image data is output as corrected image data.
前記累算ヒストグラム生成手段は、
前記比較手段の比較結果を参照して、前記第1累算値が前記基準値に達したとき前記第1累算値の生成を停止し、前記第2累算値が前記基準値に達したとき前記第2累算値の生成を停止する
ことを特徴とする請求項1又は2に記載の画像処理装置。
The accumulated histogram generating means includes:
Referring to the comparison result of the comparison means, generation of the first accumulated value is stopped when the first accumulated value reaches the reference value, and the second accumulated value has reached the reference value. The image processing apparatus according to claim 1, wherein generation of the second accumulated value is stopped .
前記階級には複数の階調値が含まれることを特徴とする請求項1乃至3のうちいずれか1項に記載の画像処理装置。 The image processing apparatus according to claim 1, wherein the class includes a plurality of gradation values. 画面を構成する各画素に表示すべき階調を示す画像データに統計処理を施して統計値を生成し、前記統計値に基づいて前記画像データに補正処理を施す画像処理方法であって、
画素単位で画像データを取り込み、取り込んだ前記画像データの階調値が最小値から第1階調値までの第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第1階調値への方向へ累算した累積度数を階級毎に示す第1範囲における累積ヒストグラムを生成する共に、取り込んだ画像データの階調値が最大値から前記第1諧調値より大きい第2階調値までの第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第2階調値への方向へ累算した累積度数を階級毎に示す第2範囲における累積ヒストグラムを生成する第1ステップと、
前記累積ヒストグラムの累積度数予め定められた基準値と各々比較する第2ステップと、
前記第2ステップによる比較結果を参照して、前記基準値を超えた前記第1範囲における累積ヒストグラムの階級を基準最小値として生成すると共に、前記基準値を超えた前記第2範囲における累積ヒストグラムの階級を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として生成する第3ステップと、
前記統計値に基づいて前記画像データに補正処理を施す第4ステップとを備え、
前記第1階調値は、前記第2階調値よりも小さい値であり、
前記第1ステップは、
取り込んだ前記画像データが前記第1範囲又は前記第2範囲にある場合にデコードして、属する階級毎に階級信号を各々出力するステップと、
前記第1範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第1範囲の各階級毎に下位の階級からの累算値を各々生成し、前記第1範囲の最上位の階級の累算値を前記第1累算値として出力するステップと、
前記第2範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第2範囲の各階級毎に上位の階級からの累算値を各々生成し、前記第2範囲の最下位の階級の累算値を前記第2累算値として出力するステップとを備え、
前記第3ステップは、前記基準最小値及び基準最大値が得られると、前記統計値の生成を終了する
を備えることを特徴とする画像処理方法。
An image processing method for performing statistical processing on image data indicating gradation to be displayed on each pixel constituting a screen to generate a statistical value, and performing correction processing on the image data based on the statistical value,
When image data is captured in units of pixels, and the gradation value of the captured image data is in a first range from a minimum value to a first gradation value, the image data is divided into a plurality of classes divided into the first range. Identify the class that belongs to it, generate a cumulative histogram in the first range indicating the cumulative frequency accumulated in the direction from the specified class to the first gradation value for each class, and at the same time of the captured image data When the gradation value is in the second range from the maximum value to the second gradation value that is larger than the first gradation value, it is determined which class the image data belongs to among a plurality of classes that divide the second range. A first step of identifying and generating a cumulative histogram in a second range indicating, for each class, the cumulative frequency accumulated in the direction from the identified class to the second gradation value;
A second step of comparing each of the cumulative frequencies of the cumulative histogram with a predetermined reference value;
With reference to the comparison result in the second step, the class of the cumulative histogram in the first range that exceeds the reference value is generated as a reference minimum value, and the cumulative histogram in the second range that exceeds the reference value A third step of generating a class as a reference maximum value, and generating the reference minimum value and the reference maximum value as the statistical value;
E Bei a fourth step of performing correction processing on the image data based on the statistical values,
The first gradation value is smaller than the second gradation value;
The first step includes
Decoding when the captured image data is in the first range or the second range and outputting a class signal for each class to which the image data belongs;
Each time the class signal of the first range is output, an accumulated value from a lower class is generated for each class of the first range based on the class signal, and the highest level of the first range is generated. Outputting the accumulated value of the class as the first accumulated value;
Each time the class signal of the second range is output, an accumulated value from an upper class is generated for each class of the second range based on the class signal, and the lowest level of the second range is generated. Outputting an accumulated value of a class of the second accumulated value as the second accumulated value,
The image processing method according to claim 3, wherein the third step includes ending generation of the statistical value when the reference minimum value and the reference maximum value are obtained .
画面を構成する各画素に表示すべき階調を示す画像データに統計処理を施して統計値を生成し、前記統計値に基づいて前記画像データに補正処理を施す画像処理プログラムにおいて、
コンピュータを、
画素単位で画像データを取り込み、取り込んだ前記画像データの階調値が最小値から第1階調値までの第1範囲にあるとき、前記画像データが前記第1範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第1階調値への方向へ累算した累積度数を階級毎に示す第1範囲における累積ヒストグラムを生成する共に、取り込んだ画像データの階調値が最大値から前記第1諧調値より大きい第2階調値までの第2範囲にあるとき、前記画像データが前記第2範囲を分割した複数の階級のうちどの階級に属するかを特定し、前記特定した階級から第2階調値への方向へ累算した累積度数を階級毎に示す第2範囲における累積ヒストグラムを生成する累算ヒストグラム生成手段と、
前記累積ヒストグラムの累積度数を予め定められた基準値と各々比較する比較手段と、
前記比較手段の比較結果を参照して、前記基準値を超えた前記第1範囲における累積ヒストグラムの階級を基準最小値として生成すると共に、前記基準値を超えた前記第2範囲における累積ヒストグラムの階級を基準最大値として生成し、前記基準最小値及び前記基準最大値を前記統計値として出力する統計値生成手段と、
前記統計値に基づいて前記画像データに補正処理を施す補正手段として機能させ、
前記第1階調値は、前記第2階調値よりも小さい値であり、
前記累算ヒストグラム生成手段は、
取り込んだ前記画像データが前記第1範囲又は前記第2範囲にある場合にデコードして、属する階級毎に階級信号を各々出力し、
前記第1範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第1範囲の各階級毎に下位の階級からの累算値を各々生成し、前記第1範囲の最上位の階級の累算値を前記第1累算値として出力し、
前記第2範囲の階級信号が出力される度に、前記階級信号に基づいて、前記第2範囲の各階級毎に上位の階級からの累算値を各々生成し、前記第2範囲の最下位の階級の累算値を前記第2累算値として出力し、
前記統計値生成手段は、前記基準最小値及び基準最大値が得られると、前記統計値の生成を終了する
ことを特徴とする画像処理プログラム。
In an image processing program for performing statistical processing on image data indicating gradation to be displayed on each pixel constituting the screen to generate a statistical value, and performing correction processing on the image data based on the statistical value,
Computer
When image data is captured in units of pixels, and the gradation value of the captured image data is in a first range from a minimum value to a first gradation value, the image data is divided into a plurality of classes divided into the first range. Identify the class that belongs to it, generate a cumulative histogram in the first range indicating the cumulative frequency accumulated in the direction from the specified class to the first gradation value for each class, and at the same time of the captured image data When the gradation value is in the second range from the maximum value to the second gradation value that is larger than the first gradation value, it is determined which class the image data belongs to among a plurality of classes into which the second range is divided. An accumulated histogram generating means for generating a cumulative histogram in a second range that identifies and indicates the cumulative frequency accumulated in the direction from the identified class to the second gradation value for each class;
Comparison means for comparing the cumulative frequency of the cumulative histogram with a predetermined reference value, respectively.
With reference to the comparison result of the comparison means, the cumulative histogram class in the first range exceeding the reference value is generated as a reference minimum value, and the cumulative histogram class in the second range exceeding the reference value is generated. As a reference maximum value, and a statistical value generation means for outputting the reference minimum value and the reference maximum value as the statistical value;
Function as correction means for performing correction processing on the image data based on the statistical values ;
The first gradation value is smaller than the second gradation value;
The accumulated histogram generating means includes:
Decode when the captured image data is in the first range or the second range, and output a class signal for each class to which the image data belongs,
Each time the class signal of the first range is output, an accumulated value from a lower class is generated for each class of the first range based on the class signal, and the highest level of the first range is generated. Output the accumulated value of the first class as the first accumulated value,
Each time the class signal of the second range is output, an accumulated value from an upper class is generated for each class of the second range based on the class signal, and the lowest level of the second range is generated. Output the accumulated value of the second class as the second accumulated value,
The image processing program characterized in that the statistical value generation means terminates the generation of the statistical value when the reference minimum value and the reference maximum value are obtained .
JP2009256829A 2009-11-10 2009-11-10 Image processing apparatus, image processing method, and image processing program Expired - Fee Related JP4557090B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009256829A JP4557090B2 (en) 2009-11-10 2009-11-10 Image processing apparatus, image processing method, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009256829A JP4557090B2 (en) 2009-11-10 2009-11-10 Image processing apparatus, image processing method, and image processing program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2003070528A Division JP4442102B2 (en) 2003-03-14 2003-03-14 Image processing apparatus, image processing method, and image processing program

Publications (2)

Publication Number Publication Date
JP2010086548A JP2010086548A (en) 2010-04-15
JP4557090B2 true JP4557090B2 (en) 2010-10-06

Family

ID=42250357

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009256829A Expired - Fee Related JP4557090B2 (en) 2009-11-10 2009-11-10 Image processing apparatus, image processing method, and image processing program

Country Status (1)

Country Link
JP (1) JP4557090B2 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61153771A (en) * 1984-12-27 1986-07-12 Canon Inc Image processor
JPH04183177A (en) * 1990-11-19 1992-06-30 Matsushita Electric Ind Co Ltd Accumulating histogram circuit, interpolating circuit, and image quality compensating circuit
JPH07336539A (en) * 1994-06-03 1995-12-22 Fuji Photo Film Co Ltd Image processing method
JPH0832808A (en) * 1994-05-09 1996-02-02 Fuji Photo Film Co Ltd Image processing method
JPH09233342A (en) * 1996-02-26 1997-09-05 Fuji Photo Film Co Ltd Contour emphasis method
JP2004208025A (en) * 2002-12-25 2004-07-22 Minolta Co Ltd Solid-state image pickup device
JP4442102B2 (en) * 2003-03-14 2010-03-31 セイコーエプソン株式会社 Image processing apparatus, image processing method, and image processing program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61153771A (en) * 1984-12-27 1986-07-12 Canon Inc Image processor
JPH04183177A (en) * 1990-11-19 1992-06-30 Matsushita Electric Ind Co Ltd Accumulating histogram circuit, interpolating circuit, and image quality compensating circuit
JPH0832808A (en) * 1994-05-09 1996-02-02 Fuji Photo Film Co Ltd Image processing method
JPH07336539A (en) * 1994-06-03 1995-12-22 Fuji Photo Film Co Ltd Image processing method
JPH09233342A (en) * 1996-02-26 1997-09-05 Fuji Photo Film Co Ltd Contour emphasis method
JP2004208025A (en) * 2002-12-25 2004-07-22 Minolta Co Ltd Solid-state image pickup device
JP4442102B2 (en) * 2003-03-14 2010-03-31 セイコーエプソン株式会社 Image processing apparatus, image processing method, and image processing program

Also Published As

Publication number Publication date
JP2010086548A (en) 2010-04-15

Similar Documents

Publication Publication Date Title
JP3873918B2 (en) Image processing apparatus, image processing method, and image processing program
US11113795B2 (en) Image edge processing method, electronic device, and computer readable storage medium
US20210042938A1 (en) Data processing method and computing device
KR101335900B1 (en) Variable scaling of image data for aspect ratio conversion
KR101253213B1 (en) Method and apparatus for controlling video display in mobile terminal
CN110392305B (en) Video static picture detection method, terminal and computer readable storage medium
US8823617B2 (en) Liquid crystal display apparatus and program used for the same
US9454925B1 (en) Image degradation reduction
US7471343B2 (en) Image processing device, image processing method, and image processing program
JP4442102B2 (en) Image processing apparatus, image processing method, and image processing program
JP5136082B2 (en) Luminance correction apparatus, luminance correction processing program, and luminance correction method
JP2009042897A (en) Image processing unit and image processing method
JP4557090B2 (en) Image processing apparatus, image processing method, and image processing program
US20140146095A1 (en) Display apparatus and method for reducing power consumption
US7941005B2 (en) Information processing apparatus and resolution enhancement processing control program
JP2005346639A (en) Image processing apparatus and image processing method
KR20160039091A (en) Method of processing image data and display system for display power reduction
US10909669B2 (en) Contrast adjustment system and contrast adjustment method
CN112669768A (en) LED display screen brightness adjusting method, device and equipment and readable storage medium
US20210158775A1 (en) Display panel, and method and device for driving display panel
JP3941546B2 (en) Contrast enhancement method
US9830692B2 (en) Method and device for processing image data based on characteristic values of pixel values of pixels
US11276186B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and non-transitory computer-readable storage medium
JP2008262018A (en) Drive circuit of image display device and image display method
JP5350497B2 (en) Motion detection device, control program, and integrated circuit

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100406

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100602

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

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

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130730

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees