Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6514481B2 - Image processing apparatus and program - Google Patents
[go: Go Back, main page]

JP6514481B2 - Image processing apparatus and program - Google Patents

Image processing apparatus and program Download PDF

Info

Publication number
JP6514481B2
JP6514481B2 JP2014212931A JP2014212931A JP6514481B2 JP 6514481 B2 JP6514481 B2 JP 6514481B2 JP 2014212931 A JP2014212931 A JP 2014212931A JP 2014212931 A JP2014212931 A JP 2014212931A JP 6514481 B2 JP6514481 B2 JP 6514481B2
Authority
JP
Japan
Prior art keywords
quantization
value
gradation
image processing
processing apparatus
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.)
Active
Application number
JP2014212931A
Other languages
Japanese (ja)
Other versions
JP2016081346A (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.)
Japan Broadcasting Corp
Original Assignee
Japan Broadcasting 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 Japan Broadcasting Corp filed Critical Japan Broadcasting Corp
Priority to JP2014212931A priority Critical patent/JP6514481B2/en
Publication of JP2016081346A publication Critical patent/JP2016081346A/en
Application granted granted Critical
Publication of JP6514481B2 publication Critical patent/JP6514481B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Description

本発明は、画像処理装置、及びプログラムに関する。   The present invention relates to an image processing apparatus and program.

従来、画像処理では、画像を量子化する処理が行われる場合がある。この量子化は、例えば10ビットの画像を8ビットの画像に変換する等の画像のビット数を変更する処理である。この際に用いられるロイドマックス(Lloyd−Max)量子化法は、量子化の際、量子化する前の画像と量子化した後の画像の差分を最小にし、量子化による画像の劣化を少なくする手法の一つである。スカラ量子化の一種であるロイドマックス量子化法においては、輝度ヒストグラム(Histogram)頻度が高い階調の値付近に多くの階調を割り当てる(例えば、非特許文献1、及び非特許文献2等)。   Conventionally, in image processing, processing for quantizing an image may be performed. This quantization is a process of changing the number of bits of an image, such as converting a 10-bit image into an 8-bit image. The Lloyd-Max quantization method used at this time minimizes the difference between the image before quantization and the image after quantization at the time of quantization, thereby reducing image degradation due to quantization. It is one of the methods. In the Lloyd-Max quantization method, which is a type of scalar quantization, many gradations are assigned in the vicinity of gradation values with high luminance histogram frequency (for example, Non-Patent Document 1, Non-Patent Document 2, etc.) .

"Least squares quantization in PCM"S.P.Lloyd,IEEE Trans.Information Theory,vol.IT−28,pp.129−136,Mar.1982."Least squares quantification in PCM" S. P. Lloyd, IEEE Trans. Information Theory, vol. IT-28, pp. 129-136, Mar. 1982. "Quantizing for minimum distortion"J.Max,IEEE Trans.Information Theory,vol.IT−7,pp.7−12,Mar.1960."Quantizing for minimum distortion" J. Max, IEEE Trans. Information Theory, vol. IT-7, pp. 7-12, Mar. 1960.

しかしながら、従来のロイドマックス量子化法では、フィードバック(Feedback)処理を行うため、計算コストが大きくなってしまう問題があった。   However, in the conventional Lloyd Max quantization method, there is a problem that the calculation cost becomes large because feedback processing is performed.

本発明の1つの側面は、量子化の際の計算コストを少なくすることを目的とする。   One aspect of the present invention aims to reduce the computational cost during quantization.

一態様における、画像データを量子化する量子化テーブルを生成する画像処理装置であって、前記画像データが有する画素の階調値と、前記階調値となる画素の頻度との関係を示すヒストグラムデータを生成するヒストグラム生成手段と、前記画像データが有する画素に量子化値を割り当てる場合に、前記量子化値ごとに割り当てる画素数が閾値として設定された閾値テーブルを取得、又は生成する閾値テーブル入力手段と、前記ヒストグラム生成手段から得られる前記ヒストグラムデータで示される前記階調値の低い方又は高い方から順に、前記階調値ごとの画素のカウント数に対応する数の量子化値を割り当て、割り当てた量子化値の数が前記閾値に達した場合に前記量子化値を次の量子化値に切り替えて全ての階調値に対して量子化値を割り当てることで、前記画像データを量子化する量子化テーブルを生成する量子化テーブル生成手段と、を有し、前記量子化テーブル生成手段は、前記画像データをスペクトル解析した結果に基づいて判定されたグラデーション領域に含まれる画素の量子化値を割り当てる画素数の最大値を、他の量子化値に対する最大値よりも小さくして、前記画像データを量子化する量子化テーブルを再度生成することを特徴とする。 The image processing apparatus according to one aspect, which generates a quantization table for quantizing image data, wherein the histogram indicates a relationship between a tone value of a pixel included in the image data and a frequency of a pixel serving as the tone value. Histogram generation means for generating data, and a threshold value table input for acquiring or generating a threshold value table in which the number of pixels allocated for each quantization value is set as a threshold value when assigning quantization values to pixels included in the image data Means, and in order from the lower one or the higher one of the gradation values indicated by the histogram data obtained from the histogram generation means, a number of quantization values corresponding to the count number of pixels for each of the gradation values are allocated assigned quantized values for all gradation values by switching the quantization value to the following quantization value if the number of quantized values reaches the threshold By assigning, anda quantization table generating means for generating a quantization table for quantizing the image data, the quantization table generating means, the image data is determined based on a result of the spectral analysis The maximum value of the number of pixels to which the quantization value of the pixel included in the gradation area is assigned is smaller than the maximum value for other quantization values, and the quantization table for quantizing the image data is generated again. I assume.

フィードフォワード処理により、繰り返し演算を行わずに量子化できるため、量子化の際の計算コストを少なくできる。   The feed forward process can reduce the calculation cost in the quantization because the quantization can be performed without performing the repetitive operation.

前記画像データをスペクトル解析する解析手段を有し、前記閾値テーブル入力手段は、前記解析手段によるスペクトル解析の結果に対応して前記閾値が設定された閾値テーブルを修正することを特徴とする。   The image processing apparatus may further comprise analysis means for spectrally analyzing the image data, and the threshold value table input means may modify the threshold value table in which the threshold value is set according to the result of spectrum analysis by the analysis means.

フィードフォワード処理により、繰り返し演算を行うことなく量子化が行え、量子化の際の計算コストを少なくできる。さらに、スペクトル解析の結果に基づいて生成されることによって、グラデーション領域を判定することができる。   By the feedforward processing, quantization can be performed without performing repetitive operations, and calculation cost can be reduced at the time of quantization. Furthermore, the gradation region can be determined by being generated based on the result of the spectrum analysis.

前記解析手段は、前記スペクトル解析の結果から、周波数のパワーの割合の値によりグラデーション領域を判定し、前記閾値テーブル入力手段は、前記グラデーション領域と判定された領域に対して前記量子化値を割り当てる割合が大きくなる前記閾値テーブルを取得、又は生成することを特徴とする。   The analysis means determines a gradation area based on the value of the ratio of power of frequency from the result of the spectrum analysis, and the threshold table input means allocates the quantization value to the area determined to be the gradation area. It is characterized in that the threshold value table in which the ratio increases is acquired or generated.

フィードフォワード処理により、繰り返し演算を行うことなく量子化が行え、量子化の際の計算コストを少なくできる。さらに、スペクトル解析の結果に基づいて生成されることによって、階調値を細かく量子化することができる。   By the feedforward processing, quantization can be performed without performing repetitive operations, and calculation cost can be reduced at the time of quantization. Furthermore, the tone value can be finely quantized by being generated based on the result of the spectrum analysis.

前記閾値テーブル入力手段は、前記量子化値を割り当てる割合が均等となるように前記閾値が設定された閾値テーブルを取得、又は生成することを特徴とする。   The threshold value table input unit may acquire or generate a threshold value table in which the threshold value is set so that the allocation ratio of the quantization value becomes equal.

フィードフォワード処理により、繰り返し演算を行うことなく量子化が行え、量子化の際の計算コストを少なくできる。さらに、量子化値は、割り当てる割合が均等になる閾値テーブルによって割り当てられる。したがって、割り当てる割合が均等になる閾値テーブルによって、ヒストグラムを平滑にすることができる。   By the feedforward processing, quantization can be performed without performing repetitive operations, and calculation cost can be reduced at the time of quantization. Furthermore, the quantization values are assigned by a threshold table where the assignment rates are even. Therefore, the histogram can be smoothed by the threshold table in which the allocation ratio is even.

本発明の一実施形態に係る画像処理システムの構成の一例を説明するブロック図である。It is a block diagram explaining an example of the composition of the image processing system concerning one embodiment of the present invention. 本発明の一実施形態に係る画像処理装置の機能構成の一例を説明する機能ブロック図である。It is a functional block diagram explaining an example of functional composition of an image processing device concerning one embodiment of the present invention. 本発明の一実施形態に係る画像処理装置による全体処理の一例を説明するフローチャートである。It is a flow chart explaining an example of the whole processing by the image processing device concerning one embodiment of the present invention. 本発明の一実施形態に係るヒストグラムの一例を説明する図である。It is a figure explaining an example of the histogram concerning one embodiment of the present invention. 本発明の一実施形態に係るブロック領域の一例を説明する図である。It is a figure explaining an example of the block field concerning one embodiment of the present invention. 本発明の一実施形態に係るスペクトル解析におけるグラデーション領域解析処理の一例を説明する図である。It is a figure explaining an example of gradation field analysis processing in spectrum analysis concerning one embodiment of the present invention. 本発明の一実施形態に係る第1モード用の閾値テーブルの一例を説明する図である。It is a figure explaining an example of the threshold value table for the 1st mode concerning one embodiment of the present invention. 本発明の一実施形態に係る第2モード用の閾値テーブルの一例を説明する図である。It is a figure explaining an example of the threshold value table for the 2nd mode concerning one embodiment of the present invention. 本発明の一実施形態に係る量子化テーブルを生成する処理の一例を説明する図である。It is a figure explaining an example of processing which generates a quantization table concerning one embodiment of the present invention. 本発明の一実施形態に係る量子化テーブルの一例を説明する図である。It is a figure explaining an example of the quantization table which concerns on one Embodiment of this invention.

以下、本発明の実施の形態について説明する。   Hereinafter, embodiments of the present invention will be described.

<全体構成>
図1は、本発明の一実施形態に係る画像処理システムの構成の一例を説明するブロック図である。図1に示す画像処理システム1は、画像処理装置10と、送信装置11とを有する。
<Overall configuration>
FIG. 1 is a block diagram for explaining an example of the arrangement of an image processing system according to an embodiment of the present invention. An image processing system 1 shown in FIG. 1 includes an image processing apparatus 10 and a transmission apparatus 11.

画像処理装置10は、画像処理システム1に入力される画像データを用いて、ヒストグラム生成処理及びスペクトル解析処理等により画像を量子化するための量子化テーブルを生成する。画像を量子化するとは、例えば画素の階調値が10ビット(1024階調)の画像データを、8ビットの画像データ(256階調)に量子化することをいうが、量子化前後のビット数については、これに限定されるものではない。なお、量子化を行うため、量子化後のビット数は、量子化前のビット数よりも少なくなる。また、画像処理装置10は、生成した量子化テーブルを用いて入力される画像データの量子化処理を行ってもよい。   The image processing apparatus 10 uses the image data input to the image processing system 1 to generate a quantization table for quantizing an image by a histogram generation process, a spectrum analysis process, and the like. Quantizing an image means, for example, quantizing image data having a pixel gradation value of 10 bits (1024 gradations) into 8-bit image data (256 gradations). The number is not limited to this. In addition, since quantization is performed, the number of bits after quantization is smaller than the number of bits before quantization. Also, the image processing apparatus 10 may perform quantization processing of image data input using the generated quantization table.

画像処理装置10は、例えば電子回路基板等で実現される。電子回路基板には、例えばFPGA(Field−Programmable Gate Array)等が実装され、画像処理装置10が行う各種の処理は、実装されたFPGA等によって実行される。なお、本実施形態は、FPGA等のPLD(Programmable Logic Device)を用いる場合に限られない。本実施形態は、例えば画像処理装置10が行う処理の全部、又は一部がASIC(Application Specific Integrated Circuit)によって実現される形態でもよい。   The image processing apparatus 10 is realized by, for example, an electronic circuit board or the like. For example, an FPGA (Field-Programmable Gate Array) or the like is mounted on the electronic circuit board, and various processes performed by the image processing apparatus 10 are executed by the mounted FPGA or the like. Note that the present embodiment is not limited to the case of using a PLD (Programmable Logic Device) such as an FPGA. The present embodiment may be configured such that all or part of the processing performed by the image processing apparatus 10 is realized by an application specific integrated circuit (ASIC), for example.

また、画像処理装置10は、電子回路基板に限られない。画像処理装置10は、例えばPC(Personal Computer)等でもよい。画像処理装置10がPCである場合、画像処理装置10は、CPU(Central Processing Unit)を有し、CPUがプログラムを実行することによって各種の処理を実現してもよい。   Further, the image processing apparatus 10 is not limited to the electronic circuit board. The image processing apparatus 10 may be, for example, a PC (Personal Computer). When the image processing apparatus 10 is a PC, the image processing apparatus 10 may have a CPU (Central Processing Unit), and the CPU may execute various types of processing by executing a program.

送信装置11は、画像処理装置10が出力する処理後画像データ(例えば、8ビットの画像データ)、及び量子化テーブルデータ等の各種データを、所定の画像復元機能を有する受信装置に送信する。   The transmission device 11 transmits various data such as processed image data (for example, 8-bit image data) output from the image processing device 10 and quantization table data to a reception device having a predetermined image restoration function.

受信側(図示せず)では、受信装置は、送信装置11が送信する画像データ、及び量子化テーブルデータ等を受信し、受信した画像データ、及び量子化テーブルデータを利用して、画像データに対して階調復元等の処理を行う。階調復元処理とは、例えば階調値が8ビット(256階調)の画像データを10ビットの画像データ(1024階調)に逆量子化する処理をいうが、これに限定されるものではない。また、本実施形態では、受信側で階調復元以外の処理が行われてもよい。   On the receiving side (not shown), the receiving device receives the image data transmitted by the transmitting device 11, the quantization table data, etc., and uses the received image data and the quantization table data to generate image data. Then, processing such as tone restoration is performed. The tone restoration process is, for example, a process of inversely quantizing image data having a tone value of 8 bits (256 tones) into 10-bit image data (1024 tones), but is not limited thereto. Absent. Further, in the present embodiment, processing other than tone restoration may be performed on the reception side.

<画像処理装置10の機能構成例>
次に、上述した画像処理システム1における画像処理装置10の機能構成例について、図を用いて説明する。図2は、本発明の一実施形態に係る画像処理装置の機能構成の一例を説明する機能ブロック図である。
<Example of Functional Configuration of Image Processing Device 10>
Next, a functional configuration example of the image processing apparatus 10 in the image processing system 1 described above will be described with reference to the drawings. FIG. 2 is a functional block diagram for explaining an example of the functional configuration of the image processing apparatus according to the embodiment of the present invention.

図2に示す画像処理装置10は、入力手段10F1と、ヒストグラム生成手段10F2と、解析手段の一例としてのスペクトル解析手段10F3と、閾値テーブル入力手段10F4と、量子化テーブル生成手段10F5と、量子化手段10F6とを有する。   The image processing apparatus 10 shown in FIG. 2 includes an input unit 10F1, a histogram generation unit 10F2, a spectrum analysis unit 10F3 as an example of an analysis unit, a threshold table input unit 10F4, a quantization table generation unit 10F5, and quantization. And means 10F6.

入力手段10F1は、画像データ、動作モードデータ、及び閾値テーブルデータ等を入力する。動作モードとは、量子化テーブル生成手段10F5において、例えば10ビットの階調値に対して8ビットの量子化値を割り当てる動作内容を設定するものであり、動作モードに応じて閾値テーブルが設定される。閾値テーブルデータは、予め設定された複数の動作モードに対応させて複数の閾値テーブルを有していてもよい。   The input unit 10F1 inputs image data, operation mode data, threshold table data, and the like. The operation mode is to set the operation contents of assigning the quantization value of 8 bits to the gradation value of 10 bits, for example, in the quantization table generation means 10F5, and the threshold value table is set according to the operation mode. Ru. The threshold table data may have a plurality of threshold tables corresponding to a plurality of operation modes set in advance.

また、入力手段10F1は、入力した画像データに対し、閾値テーブルを取得又は生成するための基準となる所定のブロック領域に分割したり、所定のブロック領域においてスペクトラム解析を行う基準となる小ブロック領域に分割する。これらの分割データは、スペクトル解析手段10F3や閾値テーブル入力手段10F4に出力される。入力手段10F1は、例えば入出力用のインタフェース、及びFPGA等の電子回路によって実現される。   In addition, the input unit 10F1 divides the input image data into a predetermined block area serving as a reference for acquiring or generating a threshold value table, and a small block area serving as a reference for performing spectrum analysis in the predetermined block area. Divide into These divided data are output to spectrum analysis means 10F3 and threshold value table input means 10F4. The input unit 10F1 is realized by, for example, an interface for input / output and an electronic circuit such as an FPGA.

ヒストグラム生成手段10F2は、入力手段10F1が入力した画像データが有する画素の階調値と、その階調値となる画素の頻度(カウント数)との関係を示すヒストグラムデータを生成するヒストグラム生成処理を行う。ヒストグラム生成手段10F2は、例えばFPGA等の電子回路によって実現される。   The histogram generation unit 10F2 generates a histogram generation process that generates histogram data indicating the relationship between the tone value of the pixel included in the image data input by the input unit 10F1 and the frequency (count number) of the pixel serving as the tone value. Do. The histogram generation unit 10F2 is realized by an electronic circuit such as an FPGA.

スペクトル解析手段10F3は、入力手段10F1が入力した画像データをスペクトル解析(spectrum analysis)する。例えば、スペクトル解析手段10F3は、画像データを小ブロック領域ごとに解析し、小ブロック領域ごとに解析結果を出力する。また、スペクトル解析は、例えばDCT(Discrete Cosine Transform)、又はFFT(Fast Fourier Transform)等を用いて行う。小ブロック領域とは、例えば縦軸方向が8画素、横軸方向が8画素、あるいは縦軸方向が16画素、横軸方向が16画素の領域であるが、これに限定されるものではない。   Spectrum analysis means 10F3 performs spectrum analysis of the image data input by the input means 10F1. For example, the spectrum analysis unit 10F3 analyzes image data for each small block area, and outputs an analysis result for each small block area. The spectrum analysis is performed using, for example, discrete cosine transform (DCT), fast Fourier transform (FFT), or the like. The small block region is, for example, a region of 8 pixels in the vertical axis direction, 8 pixels in the horizontal axis direction, or 16 pixels in the vertical axis direction, and 16 pixels in the horizontal axis direction, but is not limited thereto.

スペクトル解析の解析結果は、例えば小ブロック領域がグラデーション(gradation)領域であるか否かを判定するのに用いる、所定の小ブロック領域についての周波数スペクトル(frequency spectrum)のデータである。   The analysis result of the spectrum analysis is, for example, data of a frequency spectrum for a predetermined small block area, which is used to determine whether or not the small block area is a gradation area.

スペクトル解析手段10F3は、スペクトル解析の結果から、周波数のパワーの割合の値により、その小ブロック領域がグラデーション領域であるか否かを判定することができる。スペクトル解析手段10F3は、例えばFPGA等の電子回路によって実現される。   The spectrum analysis means 10F3 can determine whether or not the small block area is a gradation area based on the value of the ratio of the power of the frequency from the result of the spectrum analysis. The spectrum analysis means 10F3 is realized by an electronic circuit such as an FPGA.

閾値テーブル入力手段10F4は、閾値テーブルデータを取得、又は生成する処理を行う。例えば、閾値テーブル入力手段10F4は、画像データが有する画素に対して量子化値を割り当てる場合に、量子化値ごとに割り当てる画素数が閾値として設定された閾値テーブルを取得、又は生成する。   The threshold value table input unit 10F4 performs processing for acquiring or generating threshold value table data. For example, when assigning a quantization value to a pixel included in image data, the threshold table input unit 10F4 acquires or generates a threshold table in which the number of pixels assigned for each quantization value is set as a threshold.

具体的には、閾値テーブル入力手段10F4は、設定される動作モードに対応させてブロック領域ごとの閾値テーブルを取得、又は生成する。例えば、ある動作モードでは量子化値を割り当てる割合が均等となるような閾値テーブルであり、他の動作モードではスペクトル解析の結果に対応して、均等の量子化テーブルが修正される。   Specifically, the threshold value table input unit 10F4 acquires or generates a threshold value table for each block area in accordance with the set operation mode. For example, it is a threshold value table in which the allocation ratio of quantization values is equal in one operation mode, and in the other operation mode, the equal quantization table is corrected according to the result of spectrum analysis.

この量子化テーブルの修正は、例えば、スペクトル解析の結果でグラデーション領域と判定された階調値の範囲に対して、量子化値を割り当てる割合を大きくするものである。閾値テーブル入力手段10F4は、例えばFPGA等の電子回路によって実現される。   The correction of the quantization table is, for example, to increase the ratio of allocating the quantization value to the range of the gradation value determined as the gradation region by the result of the spectrum analysis. The threshold value table input unit 10F4 is realized by an electronic circuit such as an FPGA.

量子化テーブル生成手段10F5は、ヒストグラム生成手段10F2からのヒストグラムデータで示される階調値ごとの画素のカウント数と、閾値テーブル入力手段10F4からの閾値テーブルで設定された閾値とに応じて、階調値ごとに量子化値をそれぞれ割り当てて画像データを量子化する量子化テーブルを生成する。例えば、量子化テーブル生成手段10F5は、ヒストグラム生成手段10F2から得られるヒストグラムデータで示される階調値の低い方又は高い方から順に、階調値ごとの画素のカウント数に対応する数の量子化値を割り当てる。また、量子化テーブル生成手段10F5は、割り当てた量子化値が閾値に達した場合に次の量子化値に切り替えて全ての階調値に対して量子化値を割り当てることで、画像データを量子化する量子化テーブルを生成する。量子化テーブル生成手段10F5は、例えばFPGA等の電子回路によって実現される。   The quantization table generation unit 10F5 generates a floor according to the count number of pixels for each gradation value indicated by the histogram data from the histogram generation unit 10F2 and the threshold value set in the threshold value table from the threshold value table input unit 10F4. A quantization value is assigned to each key value to generate a quantization table for quantizing image data. For example, the quantization table generation unit 10F5 quantizes the number corresponding to the count number of pixels for each gradation value in order from the low or high level of the gradation value indicated by the histogram data obtained from the histogram generation unit 10F2. Assign a value In addition, when the allocated quantization value reaches the threshold, the quantization table generation unit 10F5 switches to the next quantization value and allocates the quantization value to all the gradation values, thereby quantizing the image data. Generate the quantization table to be The quantization table generation unit 10F5 is realized by an electronic circuit such as an FPGA.

量子化手段10F6は、量子化テーブル生成手段10F5で生成した量子化テーブルを用いて、例えば10ビットの画像データの量子化を行い、8ビットの処理後画像データ及び量子化テーブルを図1に示す送信装置11に出力する。なお、本実施形態において、画像処理装置10は、量子化手段10F6を有しない構成であってもよく、その場合には、入力された10ビットの画像データ及び量子化テーブルが出力され、他の装置において量子化テーブルを用いて8ビットの画像データを生成してもよい。本実施形態では、図1の送信装置11は、画像処理装置10が出力する量子化テーブルデータ、及び処理後画像データを受信側の受信装置等に送信する。   The quantizing unit 10F6 quantizes, for example, 10-bit image data using the quantization table generated by the quantization table generation unit 10F5, and an 8-bit processed image data and a quantization table are shown in FIG. It is output to the transmitter 11. In the present embodiment, the image processing apparatus 10 may not have the quantizing unit 10F6, and in this case, the input 10-bit image data and the quantization table are output, The quantization table may be used in the device to generate 8-bit image data. In the present embodiment, the transmission device 11 of FIG. 1 transmits the quantization table data output from the image processing device 10 and the post-processing image data to a reception device or the like on the reception side.

なお、各部は、電子回路によって実現される場合に限られない。各部は、全部、又は一部がプログラムによって実現されてもよい。   In addition, each part is not limited to the case where it is realized by an electronic circuit. Each part may be realized in whole or in part by a program.

従来、ロイドマックス量子化は、繰り返し演算によって入力画像と、量子化後の画像と、の差分の最小化を図ったため、計算コストが高くなる場合が多かった。本発明の一実施形態は、ヒストグラム、及び閾値テーブルのデータに基づいて量子化値を割り当てるフィードフォワード処理を行うため、繰り返し演算を行うことなく量子化が行える。繰り返し演算を行わないことによって、画像処理装置10は、計算コストを少なくできる。また、収束するまで繰り返し行う処理がないため計算時間を一定にすることができ、電子回路で実現する場合、電子回路の制御等を簡易にすることができる。   Conventionally, since Lloydmax quantization attempts to minimize the difference between an input image and an image after quantization by repeated operations, the calculation cost often increases. Since one embodiment of the present invention performs feedforward processing of assigning quantization values based on histograms and data of a threshold table, quantization can be performed without performing repetitive operations. By not performing repetitive calculations, the image processing apparatus 10 can reduce the calculation cost. In addition, since there is no processing that is repeatedly performed until convergence, the calculation time can be made constant, and when it is realized by an electronic circuit, control of the electronic circuit can be simplified.

<全体処理>
図3は、本発明の一実施形態に係る画像処理装置による全体処理の一例を説明するフローチャートである。
<Overall processing>
FIG. 3 is a flowchart for explaining an example of the entire processing by the image processing apparatus according to the embodiment of the present invention.

図3の例において、ステップS0201では、画像処理装置10の入力手段10F1は、画像データを入力する。次に、ステップS0202では、画像処理装置10のヒストグラム生成手段10F2は、ヒストグラムデータを生成するヒストグラム生成処理を行う。図4は、本発明の一実施形態に係るヒストグラムの一例を説明する図である。   In the example of FIG. 3, in step S0201, the input unit 10F1 of the image processing apparatus 10 inputs image data. Next, in step S0202, the histogram generation unit 10F2 of the image processing apparatus 10 performs a histogram generation process for generating histogram data. FIG. 4 is a diagram for explaining an example of a histogram according to an embodiment of the present invention.

図4で示すように、ヒストグラムは、縦軸を度数とする「頻度」、及び横軸を画像における画素の輝度値等である「階調値」とするグラフである。ヒストグラム生成処理は、画像データを所定の大きさに分割したブロック領域ごとに行われる。ブロック領域に分割するための情報は、予め画像処理装置10に入力される。   As shown in FIG. 4, the histogram is a graph having “frequency” whose frequency is on the vertical axis, and “tone value” which is the luminance value of pixels in the image on the horizontal axis. The histogram generation process is performed for each block area obtained by dividing the image data into a predetermined size. Information for division into block areas is input to the image processing apparatus 10 in advance.

図5は、本発明の一実施形態に係るブロック領域の一例を説明する図である。図5(A)は、本発明の一実施形態に係る画像データを3×3の9のブロック領域に分割する場合の一例を示す図である。   FIG. 5 is a diagram for explaining an example of a block area according to an embodiment of the present invention. FIG. 5A is a view showing an example in the case of dividing image data according to an embodiment of the present invention into 3 × 3 9 block regions.

入力処理で入力される画像2は、図5(A)で図示するように、画像の縦、及び横方向についてそれぞれ3分割される。同一の被写体で各ヒストグラムのデータ量が同じとなるように、ブロック領域21は、各ブロック領域の有する画素数が等分割となるように生成されるのが好ましい。ブロック領域21は、例えば画像2の面積が9等分となるように生成される。   As illustrated in FIG. 5A, the image 2 input in the input process is divided into three in each of the vertical and horizontal directions of the image. The block area 21 is preferably generated so that the number of pixels in each block area is equally divided so that the data amount of each histogram is the same for the same subject. The block area 21 is generated so that, for example, the area of the image 2 is equal to nine.

なお、実施形態は、3×3の9のブロック領域に分割する場合に限られず、例えば図5(B)に示すように4×4の16のブロック領域に分割してもよい。   The embodiment is not limited to the case of dividing into 3 × 3 9 block areas, and may be divided into 4 × 4 16 block areas as shown in FIG. 5B, for example.

図3に戻り、次に、ステップS0203では、画像処理装置10のスペクトル解析手段10F3は、画像データをスペクトル解析する解析処理を行う。スペクトル解析では、入力処理で入力されるブロック領域の画像データについて、小ブロック領域ごとに解析し、小ブロック領域ごとに解析結果を出力する。また、スペクトル解析では、解析結果に基づいてグラデーション領域であるか否かを判定してもよい。   Returning to FIG. 3, next, in step S0203, the spectrum analysis unit 10F3 of the image processing apparatus 10 performs an analysis process of analyzing the spectrum of the image data. In spectrum analysis, image data of a block area input in input processing is analyzed for each small block area, and analysis results are output for each small block area. Further, in the spectrum analysis, it may be determined whether or not it is a gradation area based on the analysis result.

図6は、本発明の一実施形態に係るスペクトル解析におけるグラデーション領域解析処理の一例を説明する図である。   FIG. 6 is a diagram for explaining an example of gradation region analysis processing in spectrum analysis according to an embodiment of the present invention.

図6の例では、小ブロック領域が縦軸方向16画素、かつ、横軸方向16画素である場合の例を示す図である。グラデーション領域解析処理は、ブロック領域に例えばDCTを行う。DCTの結果に基づいて、グラデーション領域解析処理は、図6に示すように、水平周波数、及び垂直周波数がともに最高周波数の1/8以下となる周波数のパワーの割合を算出する処理である。グラデーション領域解析処理は、割合を例えば0.00乃至1.00の範囲の値で出力する。値が大きい場合、対象となるブロック領域は、低周波帯域のパワーの割合が高い領域である。小ブロック領域がグラデーション領域であるか否かの判定は、例えばパワーの割合の値が所定の値以上である場合、画像処理装置10がグラデーション領域であると判定する方法等で実現される。   The example of FIG. 6 is a diagram showing an example where the small block area is 16 pixels in the vertical axis direction and 16 pixels in the horizontal axis direction. The gradation area analysis process performs, for example, DCT on the block area. Based on the result of the DCT, as shown in FIG. 6, the gradation area analysis process is a process of calculating the ratio of the power of the frequency at which both the horizontal frequency and the vertical frequency are 1⁄8 or less of the maximum frequency. The gradation area analysis process outputs the ratio as, for example, a value in the range of 0.00 to 1.00. When the value is large, the target block area is an area where the ratio of power in the low frequency band is high. The determination as to whether or not the small block area is a gradation area is implemented by, for example, a method of determining that the image processing apparatus 10 is a gradation area when the value of the power ratio is equal to or greater than a predetermined value.

図3に戻り、次に、ステップS0204では、画像処理装置10の閾値テーブル入力手段10F4は、閾値テーブルを取得又は生成する処理を行う。ここで、ステップS0204の処理を行うために、ステップS0202と同様に、ブロック領域に分割するための情報は、予め画像処理装置10に入力される。また、ステップS0204の処理を行うために、ステップS0203と小ブロック領域に係る情報が、予め画像処理装置10に入力される。また、ステップS0204の処理を行うために、ステップS0203で出力される解析結果が、予め画像処理装置10に入力される。また、ステップS0204の処理を行うために、動作モードが外部スイッチ(図示せず)等によって予め画像処理装置10に入力される。   Returning to FIG. 3, next, in step S0204, the threshold value table input unit 10F4 of the image processing apparatus 10 performs processing for acquiring or generating a threshold value table. Here, in order to perform the process of step S0204, information for dividing into block areas is input to the image processing apparatus 10 in advance, as in step S0202. Further, in order to perform the process of step S0204, information related to step S0203 and the small block area is input to the image processing apparatus 10 in advance. Further, in order to perform the process of step S0204, the analysis result output in step S0203 is input to the image processing apparatus 10 in advance. Further, in order to perform the process of step S0204, the operation mode is input to the image processing apparatus 10 in advance by an external switch (not shown) or the like.

例えば、ステップS0204では、予め閾値テーブルを外部から取得しない場合、閾値テーブル入力手段10F4は、閾値テーブルを生成する処理を行う。また、予め閾値テーブルを外部から取得する場合、閾値テーブル入力手段10F4は、閾値テーブルを取得する処理を行う。   For example, in step S0204, when the threshold value table is not obtained in advance from the outside, the threshold value table input unit 10F4 performs a process of generating the threshold value table. In addition, when the threshold value table is acquired in advance from the outside, the threshold value table input unit 10F4 performs a process of acquiring the threshold value table.

また、ステップS0204では、閾値テーブルを生成する処理では、画像処理装置10は、入力する動作モードによって行う処理を切り替えることができる。動作モードは、例えば量子化値を均等に割り当てるヒストグラム平滑化モード(以下、「第1モード」という。)、及びグラデーション領域に重みをつけて割り当てる疑似輪郭抑制モード(以下、「第2モード」という。)等があるが、これに限定されるものではない。   In step S0204, in the process of generating the threshold value table, the image processing apparatus 10 can switch the process to be performed according to the operation mode to be input. The operation mode is, for example, a histogram smoothing mode (hereinafter, referred to as "first mode") to uniformly assign quantization values, and a pseudo contour suppression mode (hereinafter referred to as "second mode") to assign weights to gradation regions. Etc.) but is not limited thereto.

ステップS0204では、画像処理装置10は、第1モード、及び第2モードいずれの場合でも上述した図5に示すブロック領域21ごとに処理を行う。   In step S0204, the image processing apparatus 10 performs processing for each of the block areas 21 shown in FIG. 5 described above in either the first mode or the second mode.

以下、画像処理装置10が10ビット(bit)である1024階調のデータを、8ビットである256階調のデータに量子化する場合を例に、上述した第1モード及び第2モードの閾値テーブルについて説明する。   Hereinafter, the threshold of the first mode and the second mode described above will be described by taking, as an example, the case where the image processing apparatus 10 quantizes data of 1024 gradations of 10 bits into data of 256 gradations of 8 bits. Describe the table.

<第1モード用の閾値テーブルの一例>
図7は、本発明の一実施形態に係る第1モード用の閾値テーブルの一例を説明する図である。図7に示す閾値テーブルの項目としては、例えば「量子化値(8ビット)」、「閾値」等であるが、これに限定されるものではない。ここで閾値とは、階調値ごとのカウント数(頻度)と比較される値である。カウント数が閾値に達している場合、画像処理装置10は、次の量子化値について処理を開始する。閾値は、割り当てる量子化値を切り替えるための基準となる値である。
<Example of Threshold Table for First Mode>
FIG. 7 is a view for explaining an example of the threshold value table for the first mode according to the embodiment of the present invention. The items of the threshold value table shown in FIG. 7 are, for example, “quantized value (8 bits)”, “threshold value”, etc., but are not limited thereto. Here, the threshold is a value to be compared with the count number (frequency) for each gradation value. If the count number has reached the threshold, the image processing apparatus 10 starts processing for the next quantization value. The threshold is a value serving as a reference for switching the quantization value to be assigned.

ステップS0204の閾値テーブルを生成する処理において、第1モードの場合、画像処理装置10は、図7のように、量子化値ごとに割り当てられる画素の数(以下、カウント数という。)が均等となるように閾値を設定する処理を行う。具体的には、図7に示すように、画像データのブロック領域の総画素数256×256=65536に対して、8ビット分の総数256で除算した結果(65526/256=256)を閾値に設定する。図7に示すように、量子化値ごとにそれぞれ同じ値の閾値が設定される場合は、画像処理装置10が量子化値ごとにそれぞれ同じ数の画素を生成し、画像処理装置10が量子化値ごとに均等に割り当てを行う。カウント数が図7に示す「閾値」に達する場合、画像処理装置10は、画素を割り当てる量子化値を次の量子化値とする。次の量子化値は、例えば割り当てを行っている量子化値に1を加えた量子化値である。例えば図7の場合、量子化値「0」に256の画素を割り当てた場合、画像処理装置10は、次の画素には量子化値「1」を割り当てる処理を行う。なお、第1モードの場合、上述したスペクトル解析手段10F3における処理を行わずに、閾値テーブルを生成することができる。   In the process of generating the threshold value table in step S0204, in the case of the first mode, as shown in FIG. 7, in the case of the first mode, the image processing apparatus 10 determines that the number of pixels allocated for each quantization value (hereinafter referred to as count number) is uniform. The threshold value is set to be Specifically, as shown in FIG. 7, the total number of pixels 256 × 256 = 65536 of the block area of the image data is divided by the total number 256 for eight bits, and the result (65526/256 = 256) is used as a threshold. Set As shown in FIG. 7, when the same threshold value is set for each quantization value, the image processing apparatus 10 generates the same number of pixels for each quantization value, and the image processing apparatus 10 quantizes the values. Assign evenly to each value. When the count number reaches the “threshold” shown in FIG. 7, the image processing apparatus 10 sets the quantization value to which the pixel is allocated as the next quantization value. The next quantization value is, for example, a quantization value obtained by adding 1 to the quantization value being assigned. For example, in the case of FIG. 7, when 256 pixels are assigned to the quantization value “0”, the image processing apparatus 10 performs processing of assigning the quantization value “1” to the next pixel. In the case of the first mode, the threshold value table can be generated without performing the processing in the spectrum analysis means 10F3 described above.

<第2モード用の閾値テーブルの一例>
図8は、本発明の一実施形態に係る第2モード用の閾値テーブルの一例を説明する図である。図8に示す閾値テーブルの項目は、上述した図7と同様であるが、これに限定されるものではない。
<Example of Threshold Table for Second Mode>
FIG. 8 is a view for explaining an example of the threshold value table for the second mode according to the embodiment of the present invention. The items in the threshold value table shown in FIG. 8 are similar to those in FIG. 7 described above, but are not limited thereto.

ステップS0204において、画像処理装置10は、第2モードの場合、ブロック領域内に小ブロック領域のグラデーション領域であるか否かを判定する。また、グラデーション領域である場合は、グラデーション領域である量子化値の範囲を判定する。   In step S0204, in the case of the second mode, the image processing apparatus 10 determines whether or not the block area is a gradation area of the small block area. In the case of the gradation area, the range of the quantization value which is the gradation area is determined.

グラデーション領域であるか否かの判定は、画像処理装置10がステップS0203のスペクトル解析の解析結果に基づいて行う。画像処理装置10は、例えば解析結果として得られる周波数スペクトルにおいて、高周波のない、滑らかな領域をグラデーション領域と判定する。また、判定は、例えば上述した図6で説明した方法等で実現される。画像処理装置10は、例えば小ブロック領域の周波数において、周波数の低い方から10パーセントのパワーの合計が、全体のパワーの98パーセントを超える場合、グラデーション領域と判定する。   The determination as to whether or not the area is a gradation area is performed by the image processing apparatus 10 based on the analysis result of the spectrum analysis of step S0203. For example, in the frequency spectrum obtained as an analysis result, the image processing apparatus 10 determines a smooth region without high frequency as a gradation region. Also, the determination is realized by, for example, the method described in FIG. 6 described above. The image processing apparatus 10 determines that, for example, at the frequency of the small block area, the sum of the lower 10% powers of the frequency is a gradation area when it exceeds 98% of the total power.

小ブロック領域がグラデーション領域と判定される場合、画像処理装置10は、グラデーション領域に重みをつけて閾値を割り当てる。   When the small block area is determined to be a gradation area, the image processing apparatus 10 assigns a threshold to the gradation area by weighting.

図8の例では、図7と同様に、図5のブロック領域21ごとに処理を行う場合の例を示している。図8の例は、第2モードであり、かつ、ブロック領域21に含まれる小ブロック領域21Gがグラデーション領域であると判定された場合に用いる閾値テーブルを説明する図である。   In the example of FIG. 8, as in FIG. 7, an example in which processing is performed for each of the block areas 21 of FIG. 5 is shown. The example of FIG. 8 is a diagram for explaining a threshold value table used in the second mode and when it is determined that the small block area 21G included in the block area 21 is a gradation area.

図8は、グラデーション領域用の閾値が図7の閾値と比較して、小さくなるように設定される点が異なる。図8は、量子化値「100」乃至「102」がグラデーション領域用となる場合の例である。   FIG. 8 differs in that the threshold for the gradation area is set to be smaller than the threshold in FIG. FIG. 8 shows an example where the quantization values "100" to "102" are for the gradation area.

図8の場合、グラデーション領域である小ブロック領域21Gに対応する閾値は、閾値テーブル3に、図7の場合より「α」だけ小さい値で設定される。つまり、図8の閾値テーブル3に示すように、グラデーション領域用の閾値は、第1モードで均等になるように設定した閾値から「α」引いた値が設定される。閾値が小さい値となると、カウント数は、閾値に達するのが早くなるため、生成される画素に割り当てられる量子化値が細かく切り替わる場合が多くなる。図8の場合、例えば量子化値「100」に割り当てられる画素の数は、256より少ない数である。図7の場合と比較して、図8の場合は、同様の画像であっても量子化値「100」に割り当てられる画素が少なくなる。   In the case of FIG. 8, the threshold value corresponding to the small block area 21G which is the gradation area is set in the threshold value table 3 as a value smaller by “α” than in the case of FIG. That is, as shown in the threshold table 3 of FIG. 8, the threshold for the gradation area is set to a value obtained by subtracting “α” from the threshold set to be equal in the first mode. When the threshold value is a small value, the count number quickly reaches the threshold value, and the quantization value assigned to the generated pixel is often switched finely. In the case of FIG. 8, for example, the number of pixels allocated to the quantization value “100” is a number smaller than 256. Compared to the case of FIG. 7, in the case of FIG. 8, even in the case of a similar image, the number of pixels assigned to the quantization value “100” decreases.

したがって、図8の場合は、画像処理装置10が、それぞれの値が近い値の輝度値の画素であっても別の量子化値に割り当てる可能性を図7の場合より多くできる。つまり、グラデーション領域と判定された領域に対して量子化値を割り当てる割合が大きくなる。別の量子化値が割り当てられると、それぞれの画素が別の出力値で出力されるため、出力を行う装置(図示せず)は、グラデーション領域のようにそれぞれの輝度値が近い値である画素が近接している箇所でも同じ出力値で一様に出力するのではなく、細かく出力値を変化させることで、輝度値の変化があることを表現できる。   Therefore, in the case of FIG. 8, the image processing apparatus 10 can increase the possibility of assigning to another quantization value even if the pixel is a pixel of a luminance value close to that of the case of FIG. That is, the ratio of assigning the quantization value to the area determined to be the gradation area increases. When another quantization value is assigned, each pixel is output as a different output value, so a device (not shown) that performs output has pixels whose luminance values are close to each other like a gradation region. It is possible to express that there is a change in the luminance value by finely changing the output value instead of uniformly outputting the same output value even in a place where the two are close.

第2モードでは、図8の閾値テーブル3に示すように、閾値を小さくすることによって、グラデーション領域を量子化値「100」乃至「102」の前後に拡大させることができ、さらに、グラデーション領域外の閾値を大きくすることで、グラデーション領域内の各階調値を細かく量子化することができ、疑似輪郭を抑制することができる。   In the second mode, as shown in the threshold table 3 of FIG. 8, the gradation area can be expanded before and after the quantization values “100” to “102” by reducing the threshold, and further, outside the gradation area Each threshold value in the gradation area can be finely quantized by increasing the threshold value of {circumflex over (d)}, and false contours can be suppressed.

また、図8の場合、量子化値「100」乃至「102」に割り当てられる画素は、それぞれ「α」少なくなるように設定されているため、グラデーション領域用の量子化値「100」乃至「102」に割り当てられる画素は、図7の場合と比較して、合計して「3α」少ない。このため、グラデーション領域内の各量子化値を細かく量子化することができ、疑似輪郭を抑制することができる。また、第2にモードでは、「3α」減らした分をグラデーション領域用以外の量子化値「0」乃至「99」、及び量子化値「103」乃至「255」に画素を割り当てる。グラデーション領域用以外の量子化値への割り当ては、例えば割り当てられる画素が各量子化値に、それぞれ均等に割り当てられるように行われる。   Further, in the case of FIG. 8, since the pixels assigned to the quantization values “100” to “102” are set to decrease “α” respectively, the quantization values “100” to “102” for the gradation region are set. The pixels assigned to “1” are “3α” less in total as compared with the case of FIG. For this reason, it is possible to finely quantize each quantization value in the gradation region, and it is possible to suppress pseudo contours. In the second mode, pixels are allocated to the quantization values “0” to “99” and the quantization values “103” to “255” other than for the gradation area in an amount reduced by “3α”. The assignment to the quantization value other than that for the gradation area is performed, for example, such that assigned pixels are equally assigned to the respective quantization values.

図3に戻り、次に、ステップS0205では、画像処理装置10の量子化テーブル生成手段10F5は、量子化テーブルを生成する処理を行う。ステップS0205の処理では、ステップS0203の解析結果と、ステップS0204で生成される閾値テーブル、又は入力される閾値テーブルとが用いられる。量子化テーブルを生成する処理は、例えば図5のブロック領域21ごとに量子化値を割り当てる処理である。   Returning to FIG. 3, next, in step S0205, the quantization table generation unit 10F5 of the image processing apparatus 10 performs a process of generating a quantization table. In the process of step S 0205, the analysis result of step S 0203 and the threshold value table generated in step S 0204 or the threshold value table to be input are used. The process of generating the quantization table is, for example, a process of assigning quantization values to each of the block areas 21 of FIG.

<量子化テーブルを生成する処理の一例>
図9は、本発明の一実施形態に係る量子化テーブルを生成する処理の一例を説明する図である。量子化テーブルを生成する処理を、図9(A)で図示する10ビットの階調値400乃至407の値に対して、8ビットの量子化値100乃至102を割り当てる場合を例に説明する。
<One example of processing to generate quantization table>
FIG. 9 is a diagram for explaining an example of a process of generating a quantization table according to an embodiment of the present invention. The process of generating the quantization table will be described by way of example in which 8-bit quantization values 100 to 102 are assigned to 10-bit gradation values 400 to 407 shown in FIG. 9A.

図9(A)は、ステップS0202の解析結果の一例である。図9(A)は、図5のブロック領域21のヒストグラムの一例を示す図である。量子化テーブルを生成する処理では、量子化値は、例えば値の低い階調値から割り当てられる。なお、高い方から割り当ててもよい。   FIG. 9A shows an example of the analysis result of step S0202. FIG. 9A shows an example of a histogram of the block area 21 of FIG. In the process of generating the quantization table, the quantization value is assigned, for example, from a low gradation value. In addition, you may allocate from the higher one.

図9(B)は、量子化値「100」の割り当ての一例を説明する図である。図9(B)では、量子化値「100」が、最も低い値である10ビットの階調値400から順に割り当てた場合を示す。割り当てる量は、ステップS0204で生成される閾値テーブル、又は入力される閾値テーブルの量子化値「100」に設定される閾値で決定される。   FIG. 9B is a diagram for explaining an example of assignment of the quantization value “100”. FIG. 9B shows the case where the quantization value “100” is assigned in order from the lowest value, ie, the 10-bit gradation value 400. The amount to be allocated is determined by the threshold value table generated in step S0204 or the threshold value set to the quantization value “100” of the input threshold value table.

図9(B)の例では、量子化値「100」に対応する閾値に達するまでに、斜線部分(階調値402の途中)までが割り当てられたことを示す。   In the example of FIG. 9B, it is shown that up to the hatched portion (in the middle of the gradation value 402) is allocated until the threshold value corresponding to the quantization value "100" is reached.

ステップS0205では、量子化テーブル生成手段10F5は、図9(B)に示すように、量子化値「100」の割り当てが対応する閾値に達した場合に、量子化値「100」を次の量子化値「101」に切り替えて割り当てを行う。図9(C)は、量子化値「101」の割り当ての一例を説明する図である。図9(C)では、図9(B)の量子化値「100」の割り当て後、量子化値「101」が、最も低い値である10ビットの階調値402の途中から順に、量子化値「101」の閾値に達するまで割り当てを行い、階調値403の途中まで割り当てられたことを示す。   In step S0205, as shown in FIG. 9B, the quantization table generation unit 10F5 applies the quantization value "100" to the next quantum when the allocation of the quantization value "100" reaches the corresponding threshold value. The allocation value is switched to the conversion value "101". FIG. 9C is a diagram for explaining an example of assignment of the quantization value "101". In FIG. 9C, after assigning the quantization value “100” in FIG. 9B, the quantization value “101” is quantized in order from the middle of the 10-bit gradation value 402 which is the lowest value. Assignment is performed until the threshold value of “101” is reached, indicating that the tone value 403 has been assigned halfway.

また、図9(D)は、量子化値「102」の割り当ての一例を説明する図である。図9(D)の処理は、図9(B)、及び図9(C)と同様に、図9(C)の量子化値「101」の割り当てが閾値に達した場合、次の量子化値「102」に切り替えて最も低い値である10ビットの階調値403の途中から順に割り当てを行う処理である。   FIG. 9D is a view for explaining an example of assignment of the quantization value “102”. Similar to FIGS. 9B and 9C, when the allocation of the quantization value “101” in FIG. 9C reaches the threshold, the process of FIG. 9D performs the next quantization. It is a process of switching to the value "102" and performing allocation sequentially from the middle of the 10-bit gradation value 403 which is the lowest value.

なお、図9(D)の例において、階調値402には、量子化値「100」及び量子化値「101」が割り当てられているが、この場合には、例えば先に割り当てられた量子化値「100」を優先する。したがって、量子化テーブルの階調値402に対して量子化値「100」が設定される。設定方法については、上記の例に限定されるものではない。   In the example of FIG. 9D, the quantization value "100" and the quantization value "101" are assigned to the gradation value 402, but in this case, for example, the previously assigned quantum Prioritize the conversion value "100". Therefore, the quantization value "100" is set to the gradation value 402 of the quantization table. The setting method is not limited to the above example.

なお、上述した割り当ての処理は、第1モードの場合、図7で示した閾値テーブル3に設定された「閾値」に基づいて行う処理である。割り当ての処理は、第2モードの場合、図8で示した閾値テーブル3に設定された「閾値」に基づいて行う処理である。画像処理装置10は、図9(B)で図示するように、階調値「400」の画素を量子化値「100」に割り当てる場合、量子化値「100」に割り当てた画素の数をカウント数としてカウントする処理を行う。つまり、量子化値「100」に割り当てた画素がある毎に、画像処理装置10は、カウント数をカウントアップする処理を行う。カウント数が図7又は図8で示した閾値テーブル3に設定された「閾値」に達した場合、画像処理装置10は、次の量子化値である量子化値「101」に画素を割り当てる。   In the first mode, the assignment process described above is a process performed based on the “threshold value” set in the threshold value table 3 shown in FIG. 7. In the case of the second mode, the process of assignment is a process performed based on the "threshold" set in the threshold table 3 shown in FIG. As illustrated in FIG. 9B, the image processing apparatus 10 counts the number of pixels allocated to the quantization value “100” when allocating the pixel of the gradation value “400” to the quantization value “100”. Perform processing to count as a number. That is, each time there is a pixel assigned to the quantization value “100”, the image processing apparatus 10 performs a process of counting up the count number. When the count number reaches the “threshold value” set in the threshold value table 3 shown in FIG. 7 or FIG. 8, the image processing apparatus 10 allocates a pixel to the quantization value “101” which is the next quantization value.

画像処理装置10が量子化値「101」に画素を割り当てる場合、画像処理装置10は、量子化値「100」の場合と同様に、量子化値「101」に割り当てる画素の数をカウント数としてカウントする処理を行う。量子化値「101」に画素を割り当てる処理は、量子化値「100」の場合と同様に、図7又は図8の閾値テーブル3に基づいて、量子化値「101」に設定される「閾値」にカウント数が達するまで行われる処理である。   When the image processing apparatus 10 assigns pixels to the quantization value "101", the image processing apparatus 10 counts the number of pixels to be assigned to the quantization value "101" as the count number, as in the case of the quantization value "100". Perform processing to count. The process of assigning a pixel to the quantization value "101" is set to the quantization value "101" based on the threshold value table 3 of FIG. 7 or 8 as in the case of the quantization value "100". Is a process performed until the count number reaches.

図9で示すように、量子化テーブルを生成する処理は、ヒストグラムの階調値に対して閾値テーブルに基づいて量子化値を割り当て、最終的に全ての階調値に対して量子化値を割り当てる。   As shown in FIG. 9, in the process of generating the quantization table, quantization values are assigned to the tone values of the histogram based on the threshold value table, and finally the quantization values are assigned to all the tone values. assign.

なお、同じ分割領域に位置し、かつ、同一の輝度値である画素は、同一の量子化値に割り当てられるのが望ましいので、多数の方の量子化値に揃えて割り当てられてもよい。例えば、図9(D)の場合において、「402」の階調値である画素が複数存在する場合を例に説明する。「402」の階調値である画素のうち、同じ分割領域に位置する画素がある場合、同じ分割領域に位置する「402」の階調値である画素は、すべて同じ量子化値に揃えて割り当てられるのが望ましい。例えば、同じ分割領域に位置する「402」の階調値である画素は、すべて量子化値「100」に揃えて割り当てられるのが望ましい。同じブロック領域に位置し、かつ、同一の輝度値である画素は、同一の被写体、即ち同一の色を示す場合が多いため、同じ量子化値で出力されることが望ましい場合が多い。したがって、同じブロック領域に位置し、かつ、同一の輝度値である画素は、同じ量子化値で出力されるように、同じ量子化値に割り当てられることによって、画質の向上を図ることができる。但し、割り当て処理は、上述の方法に限られない。割り当て処理は、別の方法によって各画素の位置を特定し、各画素の位置ごとに割り当てを行う処理でもよい。   In addition, since it is desirable that pixels located in the same division area and having the same luminance value be assigned to the same quantization value, they may be aligned and assigned to a larger number of quantization values. For example, in the case of FIG. 9D, a case where there are a plurality of pixels having a gradation value of "402" will be described as an example. When there is a pixel located in the same divided area among the pixels which are the gradation value of "402", all the pixels which are the gradation value of "402" located in the same divided area are aligned to the same quantized value It is desirable to be assigned. For example, it is desirable that all the pixels which are the gradation value of "402" located in the same division area be aligned and assigned to the quantization value "100". Since pixels located in the same block area and having the same luminance value often exhibit the same subject, that is, the same color, it is often desirable to output with the same quantization value. Therefore, the image quality can be improved by allocating the pixels located in the same block area and having the same luminance value to the same quantization value so as to be output with the same quantization value. However, the assignment process is not limited to the method described above. The assignment process may be a process of specifying the position of each pixel by another method and performing assignment for each position of each pixel.

ヒストグラムに基づいて量子化値を割り当てることによって、頻度の高い階調値付近には、多くの量子化値を割り当てることができる。   By assigning quantization values based on a histogram, many quantization values can be assigned in the vicinity of frequently occurring tone values.

動作モードが上述した第1モードの場合、閾値テーブルは、各量子化値に割り当てられる画素の数が均等になるように設定される。したがって、第1モードの場合、画像処理装置10は、閾値テーブルによって、ヒストグラムを平滑にすることができる。   When the operation mode is the first mode described above, the threshold value table is set so that the number of pixels assigned to each quantization value is equal. Therefore, in the case of the first mode, the image processing apparatus 10 can smooth the histogram by the threshold value table.

動作モードが上述した第2モードの場合、閾値テーブルは、グラデーション領域に割り当てられる量子化値が多くなるように設定される。したがって、第2モードの場合、画像処理装置10は、閾値テーブルによって、階調値を細かく量子化することができる。   When the operation mode is the second mode described above, the threshold value table is set so that the quantization value assigned to the gradation area is large. Therefore, in the case of the second mode, the image processing apparatus 10 can finely quantize the gradation value by the threshold value table.

ここで、第2モードの場合の閾値を小さくする範囲の設定について説明する。先ず、グラデーション領域の範囲は10ビット階調値の値で求まる。この範囲が、例えば「400」〜「419」だったとすると、一旦、第1モードである仮定して、図9の手順により、この範囲が該当する8ビット階調値の範囲を求める。これが、例えば、「110」〜「115」に該当しており、グラデーション領域なのでこの範囲の閾値を半分(256/2)にするならば、減らした分だけ上側、下側にグラデーション領域となる8ビット階調値の範囲を拡げる必要がある。すなわち、上、下側にそれぞれ、3量子化値(閾値が256/2)をグラデーション領域に拡張し、結局8ビットのグラデーション領域は「107」〜「118」となる。また、均等から減らした画素(256/2x12)の分だけ残りの「0」〜「106」及び「119」〜「255」の量子化値で均等に多く負担する(閾値が大きくなる)。   Here, setting of a range in which the threshold value in the second mode is reduced will be described. First, the range of the gradation area is obtained by the value of 10-bit gradation value. Assuming that this range is, for example, "400" to "419", the range of 8-bit gradation values to which this range falls is obtained by the procedure of FIG. 9 once assuming that it is the first mode. This corresponds to, for example, “110” to “115”, and if the threshold of this range is reduced to half (256/2) because it is a gradation region, the gradation region will be the upper and lower portions by the reduced amount. The range of bit gradation values needs to be expanded. That is, three quantization values (the threshold value is 256/2) are extended to the gradation area on the upper side and the lower side, respectively, and eventually the gradation area of 8 bits becomes “107” to “118”. Further, the remaining “0” to “106” and “119” to “255” of quantization values are equally heavily burdened by the pixel (256/2 × 12) reduced from the uniform (the threshold value increases).

なお、本実施形態は、図3で示された全体処理に限られない。本実施形態は、各処理が並行、又は分散して処理されてもよい。例えばステップS0202の処理、及びステップS0203の処理は、並行して処理されてもよい。   The present embodiment is not limited to the entire processing shown in FIG. In the present embodiment, each process may be processed in parallel or in a distributed manner. For example, the process of step S0202 and the process of step S0203 may be performed in parallel.

<量子化テーブルの一例>
図10は、本発明の一実施形態に係る量子化テーブルの一例を説明する図である。
<Example of quantization table>
FIG. 10 is a diagram for explaining an example of a quantization table according to an embodiment of the present invention.

量子化テーブル4は、図9で説明した割り当てが行われる場合に生成される量子化テーブルデータの一例である。すなわち、量子化テーブルとは、8ビット量子化値への割り当て、及び同一輝度値における同一量子化値への揃えが完了後の、図9における横軸の10ビット階調値毎の縦軸に割り当てられた8ビット階調値の対応表である。   The quantization table 4 is an example of quantization table data generated when the allocation described in FIG. 9 is performed. That is, the quantization table is the vertical axis for each 10-bit gradation value on the horizontal axis in FIG. 9 after allocation to 8-bit quantization values and alignment to the same quantization value for the same luminance value are completed. It is a correspondence table of the allocated 8-bit gradation value.

量子化テーブル4で図示するように、図9(B)で階調値「400」に量子化値「100」が割り当てられる場合、量子化テーブル4は、階調値「400」に対する量子化値に「100」が設定される。同様に、階調値「401」乃至「405」に対して、図9で説明した割り当てによって決定した量子化値がそれぞれ設定される。   As illustrated in the quantization table 4, when the quantization value "100" is assigned to the gradation value "400" in FIG. 9B, the quantization table 4 is a quantization value for the gradation value "400". "100" is set to. Similarly, quantization values determined by the allocation described in FIG. 9 are respectively set for the gradation values “401” to “405”.

図3に戻り、次に、ステップS0206では、画像処理装置10の量子化手段10F6は、生成した量子化テーブルを用いて画像データを量子化する処理を行う。次に、ステップS0207では、画像処理装置10の量子化手段10F6は、処理後画像データ及び量子化テーブルデータを図1の送信装置11に出力する処理を行う。   Returning to FIG. 3, next, in step S0206, the quantizing unit 10F6 of the image processing apparatus 10 performs a process of quantizing the image data using the generated quantization table. Next, in step S0207, the quantizing unit 10F6 of the image processing apparatus 10 performs a process of outputting the processed image data and the quantization table data to the transmission apparatus 11 of FIG.

図1の送信装置11は、量子化テーブル4に設定される量子化値を、量子化テーブルデータとして受信側に送信する。量子化テーブルデータの各量子化値は、量子化テーブル4の一行に相当するデータが10ビットの階調値にそれぞれ対応する。10ビットの場合、階調値が1024段階である。10ビットの階調値、かつ、RGBの3色カラーである場合、量子化テーブルデータは、1024段階×3色=3072個の量子化値を示すデータである。   The transmitter 11 of FIG. 1 transmits the quantization value set in the quantization table 4 to the receiving side as quantization table data. In each quantization value of the quantization table data, data corresponding to one row of the quantization table 4 corresponds to a gradation value of 10 bits. In the case of 10 bits, the gradation value is 1024 steps. In the case of the 10-bit gradation value and the RGB three-color color, the quantization table data is data indicating 1024 steps × 3 colors = 3072 quantization values.

受信側では、受信装置は、受信する画像データに含まれる画素を、量子化テーブルデータに基づいて階調復元の処理を行う。具体的には、図10の場合、受信側では、受信装置は、例えば画像データに含まれる階調値「100」の8ビット画素を、「400」の10ビット画素にする処理を行う。例えば8ビット階調値が複数の10ビットに対応しているとき、10ビット階調値の中央値を選択する。   On the reception side, the reception device performs tone restoration processing on the pixels included in the image data to be received, based on the quantization table data. Specifically, in the case of FIG. 10, on the reception side, the reception apparatus performs, for example, processing to set an 8-bit pixel of gradation value "100" included in image data to a 10-bit pixel of "400". For example, when 8-bit tone values correspond to a plurality of 10 bits, the median value of the 10-bit tone values is selected.

<実行プログラム>
ここで、上述した画像処理装置10は、例えば、CPU(Central Processing Unit)、RAM(Random Access Memory)等の揮発性の記憶媒体、ROM(Read Only Memory)等の不揮発性の記憶媒体、マウスやキーボード、ポインティングデバイス等の入力装置、画像やデータを表示する表示部、並びに外部と通信するためのインタフェースを備えたコンピュータによって構成することができる。
<Execution program>
Here, the image processing apparatus 10 described above may be, for example, a volatile storage medium such as a central processing unit (CPU) or a random access memory (RAM), a nonvolatile storage medium such as a read only memory (ROM), a mouse, It can be configured by a computer provided with an input device such as a keyboard, a pointing device, a display unit for displaying images and data, and an interface for communicating with the outside.

したがって、画像処理装置10が有する各機能は、これらの機能を記述したプログラムをCPUに実行させることによりそれぞれ実現可能となる。また、これらのプログラムは、磁気ディスク(フロッピィーディスク、ハードディスク等)、光ディスク(CD−ROM、DVD等)、半導体メモリ等の記録媒体に格納して頒布することもできる。   Therefore, each function of the image processing apparatus 10 can be realized by causing the CPU to execute a program in which these functions are described. Also, these programs can be stored and distributed in a recording medium such as a magnetic disk (floppy disk, hard disk, etc.), optical disk (CD-ROM, DVD, etc.), semiconductor memory, etc.

つまり、上述した各構成における処理をコンピュータに実行させるための実行プログラムを生成し、例えば汎用のPCやサーバ等にそのプログラムをインストールすることにより、本実施形態における画像処理を実現することができる。   That is, the image processing according to the present embodiment can be realized by generating an execution program for causing a computer to execute the processing in each configuration described above and installing the program in, for example, a general-purpose PC or server.

上述したように、本実施形態によれば、量子化の際の計算コストを少なくすることができる。また、本実施形態によれば、出現頻度の高い階調値付近に多くの量子化値を割りつけ、かつヒストグラム平滑化も考慮したフィードフォワード処理による量子化テーブルを生成することができる。   As described above, according to the present embodiment, it is possible to reduce the calculation cost at the time of quantization. Further, according to the present embodiment, it is possible to assign a large number of quantization values in the vicinity of the tone value having a high appearance frequency, and generate a quantization table by feedforward processing in consideration of histogram smoothing.

以上、本発明の好ましい実施例について詳述したが、本発明は係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形、変更が可能である。   Although the preferred embodiments of the present invention have been described in detail, the present invention is not limited to the specific embodiments, and various modifications may be made within the scope of the present invention as set forth in the claims. , Change is possible.

1 画像処理システム
10 画像処理装置
10F1 入力手段
10F2 ヒストグラム生成手段
10F3 スペクトル解析手段
10F4 閾値テーブル入力手段
10F5 量子化テーブル生成手段
10F6 量子化手段
11 送信装置
2 画像
21 ブロック領域
21G グラデーション領域
3 閾値テーブル
4 量子化テーブル
Reference Signs List 1 image processing system 10 image processing apparatus 10F1 input unit 10F2 histogram generation unit 10F3 spectrum analysis unit 10F4 threshold table input unit 10F5 quantization table generation unit 10F6 quantization unit 11 transmitter 2 image 21 block area 21G gradation area 3 threshold table 4 quantum Table

Claims (2)

画像データを量子化する量子化テーブルを生成する画像処理装置であって、
前記画像データが有する画素の階調値と、前記階調値となる画素の頻度との関係を示すヒストグラムデータを生成するヒストグラム生成手段と、
前記画像データが有する画素に量子化値を割り当てる場合に、前記量子化値ごとに割り当てる画素数が閾値として設定された閾値テーブルを取得、又は生成する閾値テーブル入力手段と、
前記ヒストグラム生成手段から得られる前記ヒストグラムデータで示される前記階調値の低い方又は高い方から順に、前記階調値ごとの画素のカウント数に対応する数の量子化値を割り当て、割り当てた量子化値の数が前記閾値に達した場合に前記量子化値を次の量子化値に切り替えて全ての階調値に対して量子化値を割り当てることで、前記画像データを量子化する量子化テーブルを生成する量子化テーブル生成手段と
を有し、
前記量子化テーブル生成手段は、
前記画像データをスペクトル解析した結果に基づいて判定されたグラデーション領域に含まれる画素の量子化値を割り当てる画素数の最大値を、他の量子化値に対する最大値よりも小さくして、前記画像データを量子化する量子化テーブルを再度生成する画像処理装置。
An image processing apparatus for generating a quantization table for quantizing image data, comprising:
A histogram generation unit configured to generate histogram data indicating a relationship between a tone value of a pixel included in the image data and a frequency of a pixel serving as the tone value;
A threshold value table input unit configured to obtain or generate a threshold value table in which the number of pixels to be assigned to each of the quantization values is set as a threshold when assigning quantization values to pixels included in the image data;
The allocated quantum value is a number of quantization values corresponding to the count number of pixels for each of the gradation values in order from the lower one or the higher one of the gradation values indicated by the histogram data obtained from the histogram generation means by assigning a quantization value for all the gradation values by switching the quantization value to the following quantization values if the number of reduction value reaches the threshold value, quantization for quantizing the image data Quantization table generation means for generating a table ;
Have
The quantization table generation means
In the image data, the maximum value of the number of pixels to which the quantization value of the pixel included in the gradation area determined based on the result of the spectrum analysis of the image data is allocated is smaller than the maximum value for other quantization values. An image processing apparatus for generating again a quantization table for quantizing .
コンピュータを請求項1に記載の画像処理装置として機能させるプログラム。A program that causes a computer to function as the image processing apparatus according to claim 1.
JP2014212931A 2014-10-17 2014-10-17 Image processing apparatus and program Active JP6514481B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014212931A JP6514481B2 (en) 2014-10-17 2014-10-17 Image processing apparatus and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014212931A JP6514481B2 (en) 2014-10-17 2014-10-17 Image processing apparatus and program

Publications (2)

Publication Number Publication Date
JP2016081346A JP2016081346A (en) 2016-05-16
JP6514481B2 true JP6514481B2 (en) 2019-05-15

Family

ID=55958836

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014212931A Active JP6514481B2 (en) 2014-10-17 2014-10-17 Image processing apparatus and program

Country Status (1)

Country Link
JP (1) JP6514481B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013029953A (en) * 2011-07-28 2013-02-07 Sony Corp Image processing device and method
JP5878785B2 (en) * 2012-02-20 2016-03-08 日本放送協会 Gradation reduction apparatus and program

Also Published As

Publication number Publication date
JP2016081346A (en) 2016-05-16

Similar Documents

Publication Publication Date Title
US10534987B2 (en) Image processing apparatus image processing method and program
JP2018137796A (en) Method and apparatus for encoding or decoding moving picture content encoding unit in palette encoding mode using adaptive palette predictor
US20170324958A1 (en) Generating custom quantization tables for jpeg compression based on image content
JP7141862B2 (en) Method for tone-adapting an image to the target peak luminance of a target display device
JP2023156452A (en) Parallel histogram calculation with application to palette table derivation
CN110199297B (en) Method and apparatus for color similarity assessment
CN111901497A (en) Gray image processing method and device and printer
JP2022550008A (en) Parallel Histogram Computation by Application to Palette Table Derivation
CN107404600B (en) Image processing device and method
JP7390849B2 (en) Video signal conversion device and program
JP4064979B2 (en) Apparatus and method for adjusting color image saturation
JP6514481B2 (en) Image processing apparatus and program
EP1990989B1 (en) Color processing apparatus and method
JP4393489B2 (en) Image processing apparatus and method
JP4525541B2 (en) Image processing device
JP6486082B2 (en) Image processing apparatus, image processing method, and program
JP6389748B2 (en) Image processing apparatus and program
JP4486661B2 (en) Dynamic contrast enhancement circuit and enhancement method
JP2021190788A (en) Saturation correction device, video signal converter, and program
JP5934031B2 (en) Gradation reduction apparatus and program
KR101826040B1 (en) Apparatus and method for processing image based on file format
Yeung et al. Restoration of half-toned color-quantized images using particle swarm optimization with wavelet mutation
JP6190170B2 (en) Space / gradation reduction apparatus and program
JP7364250B2 (en) Video processing device, video processing method, video processing system, and video processing program
JP2009188745A (en) Image compression apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170829

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180803

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180814

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181011

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190412

R150 Certificate of patent or registration of utility model

Ref document number: 6514481

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250