[go: up one dir, main page]

JP2009118297A - Quantization method and quantization device for specimen value - Google Patents

Quantization method and quantization device for specimen value Download PDF

Info

Publication number
JP2009118297A
JP2009118297A JP2007290442A JP2007290442A JP2009118297A JP 2009118297 A JP2009118297 A JP 2009118297A JP 2007290442 A JP2007290442 A JP 2007290442A JP 2007290442 A JP2007290442 A JP 2007290442A JP 2009118297 A JP2009118297 A JP 2009118297A
Authority
JP
Japan
Prior art keywords
value
sample
quantization
samples
lower limit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007290442A
Other languages
Japanese (ja)
Inventor
Eriko Kimura
絵理子 木村
Naoki Kawai
直樹 河合
Kazuo Matsufuji
和夫 松藤
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2007290442A priority Critical patent/JP2009118297A/en
Publication of JP2009118297A publication Critical patent/JP2009118297A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Facsimile Image Signal Circuits (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To perform proper quantization, even when a sample that has a very singular specimen value is included. <P>SOLUTION: The quantization is performed, by associating any quantization value of an (m) stage with respective (n) pieces of samples having a predetermined specimen value. The lower limit value SL larger than the minimum value of the specimen value, the upper limit value SH smaller than a maximum value are set, and sections SL-SH are set as the quantization object range (b). The quantization object range (b) is divided into M stages, and a predetermined quantization value is respectively determined in the respective stages. Although the quantization value of the stage belonging with its specimen value is respectively associated with the respective samples, the quantization value of the stage belonging to a lower limit value SL associated with the sample, having a specimen value less than the lower limit value SL, the quantization value of the stage belonging with the upper limit value SH is associated with the sample, having a specimen value exceeding the upper limit value SH. The lower limit value SL and the upper limit value SH are defined by designating a cumulative distribution function value, when it is assumed that the distribution of the specimen value is a normal distribution. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、標本値の量子化方法および量子化装置に関し、特に、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う技術に関する。   The present invention relates to a sample value quantization method and a quantization apparatus, and more particularly to a quantum value obtained by associating one of m stages of quantized values with each of n samples having a predetermined sample value. It is related to the technology to make.

それぞれ固有の標本値をもった多数のサンプルに対して、各標本値を量子化する技術は、様々な産業分野で広く利用されている。特に、アナログデータをデジタルデータに変換してコンピュータに取り込んで処理する場合、アナログのスカラー値を量子化してデジタルデータに変換する処理が不可欠である。たとえば、スキャナーやデジタルカメラなどによって取り込まれた画像データは、アナログ原画像のもつスカラー値を量子化してデジタル値に変換することによって得られたデータである。この場合、アナログ原画像を8ビットの階調画像として取り込むのであれば、アナログ原画像のもつスカラー値は、256段階のいずれかのデジタル値に量子化されることになる。   A technique for quantizing each sample value with respect to a large number of samples each having a unique sample value is widely used in various industrial fields. In particular, when analog data is converted into digital data and taken into a computer for processing, the analog scalar value is quantized and converted into digital data. For example, image data captured by a scanner or a digital camera is data obtained by quantizing a scalar value of an analog original image and converting it into a digital value. In this case, if the analog original image is captured as an 8-bit gradation image, the scalar value of the analog original image is quantized into any one of 256 digital values.

このような量子化を行う際に生じる量子化誤差を低減するための工夫がいろいろ提案されている。たとえば、下記の特許文献1には、原稿上の画像をスキャナーで取り込んで量子化する際に、原稿上の文書部分と写真部分とを別個に取り扱い、それぞれ異なる基準値を用いて量子化を行うことにより、適切な濃度変化をもったデジタル画像データを生成する技術が開示されている。また、下記の特許文献2には、熱的雑音信号など、測定によって得られたアナログデータをデジタルデータに量子化する際に、量子化に用いる代表点の間隔を不均一に設定して非線形な量子化を行うようにし、量子化誤差を低減する技術が開示されている。
特開平6−125456号公報 特開2006−46953号公報
Various ideas have been proposed for reducing the quantization error that occurs when performing such quantization. For example, in Patent Document 1 below, when an image on a document is captured by a scanner and quantized, the document portion and the photograph portion on the document are handled separately, and quantization is performed using different reference values. Thus, a technique for generating digital image data having an appropriate density change is disclosed. Further, in Patent Document 2 described below, when analog data obtained by measurement, such as a thermal noise signal, is quantized into digital data, the interval between representative points used for quantization is set non-uniformly to be nonlinear. A technique for performing quantization and reducing the quantization error is disclosed.
JP-A-6-125456 JP 2006-46953 A

一般に、多数のサンプルがもつ個々の標本値を量子化する場合、標本値の最大値〜最小値までの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、各サンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける処理が行われる。ところが、極めて特異な標本値(たとえば、極端に大きな値や極端に小さな値)をもつサンプルが含まれていると、当該特異な標本値までも含めた数値範囲をm段階に分割して量子化が行われることになるため、実質的に有効な量子化段階の数が少なくなり、適切な量子化処理が阻害されることになる。特に、スキャナーやデジタルカメラなど、様々な測定機器を用いて取り込んだアナログ信号には、ノイズ成分が含まれており、このようなノイズ成分が極めて特異な標本値を与えることが少なくない。   In general, when quantizing individual sample values of a large number of samples, the numerical range from the maximum value to the minimum value of the sample values is divided into m stages, and predetermined quantized values are determined for each stage. A process for associating a quantized value at a stage to which the sample value belongs is performed. However, if samples with extremely specific sample values (for example, extremely large values or extremely small values) are included, the numerical range including the specific sample values is divided into m stages and quantized. As a result, the number of effective quantization steps is reduced, and appropriate quantization processing is hindered. In particular, analog signals captured using various measuring devices such as scanners and digital cameras contain noise components, and such noise components often give extremely specific sample values.

そこで本発明は、極めて特異な標本値をもつサンプルが含まれていた場合にも、適切な量子化処理を行うことが可能な標本値の量子化方法および量子化装置を提供することを目的とする。   Accordingly, an object of the present invention is to provide a sample value quantization method and a quantization apparatus capable of performing an appropriate quantization process even when a sample having a very specific sample value is included. To do.

(1) 本発明の第1の態様は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う標本値の量子化方法において、
コンピュータに対して、n個のサンプルの標本値をデジタルデータとして入力し、所定の記憶場所に格納する入力ステップと、
コンピュータに対して、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定ステップと、
コンピュータが、記憶場所に格納されているn個の標本値を大きさの順に並べ替える処理を行うソートステップと、
コンピュータが、ソートステップによって大きさの順に並べ替えられたn個の標本値に基づいて、小さい方から第((n×(1−C))/2+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))/2)番目の標本値の値を上限値SHと決定する上下限決定ステップと、
コンピュータが、下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める段階決定ステップと、
コンピュータが、n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づけ、対応づけた各量子化値を各サンプルに対応する記憶場所に格納する量子化ステップと、
を行い、
量子化ステップにおいて、n個のサンプルのうち、下限値SL未満の標本値を有するサンプルについては、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプルについては、上限値SHが所属する段階の量子化値を対応づけるようにしたものである。
(1) In the first aspect of the present invention, a sample value to be quantized by associating one of m stages of quantized values with each of n samples having a predetermined sample value. In the quantization method,
An input step for inputting a sample value of n samples as digital data to a computer and storing it in a predetermined storage location;
A condition setting step for setting a stage number m (m is a natural number of 2 or more) and a parameter value C (0 <C <1) for the computer;
A sorting step in which a computer performs a process of rearranging n sample values stored in a storage location in order of size;
The computer sets the value of the ((n × (1-C)) / 2 + 1) -th sample value from the smallest to the lower limit SL based on the n sample values rearranged in order of magnitude by the sorting step. And an upper and lower limit determination step for determining the value of the (n− (n × (1-C)) / 2) -th sample value from the smaller one as the upper limit value SH;
A stage determination step in which a computer divides a numerical range from a lower limit value SL to an upper limit value SH into m stages and determines a predetermined quantization value for each stage;
A quantization step in which a computer associates the quantized value of the stage to which the sample value belongs for each of the n samples, and stores each associated quantized value in a memory location corresponding to each sample;
And
In the quantization step, for samples having a sample value less than the lower limit SL among the n samples, a sample having a sample value exceeding the upper limit SH is associated with the quantized value of the stage to which the lower limit SL belongs. Is associated with the quantized value at the stage to which the upper limit SH belongs.

(2) 本発明の第2の態様は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う標本値の量子化方法において、
コンピュータに対して、n個のサンプルの標本値をデジタルデータとして入力し、所定の記憶場所に格納する入力ステップと、
コンピュータに対して、段階数m(mは2以上の自然数)、パラメータ値C(0<C<1)、バランス値P(0≦P≦1)を設定する条件設定ステップと、
コンピュータが、記憶場所に格納されているn個の標本値を大きさの順に並べ替える処理を行うソートステップと、
コンピュータが、ソートステップによって大きさの順に並べ替えられたn個の標本値に基づいて、小さい方から第((n×(1−C))×P+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))×(1−P))番目の標本値の値を上限値SHと決定する上下限決定ステップと、
コンピュータが、下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める段階決定ステップと、
コンピュータが、n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づけ、対応づけた各量子化値を各サンプルに対応する記憶場所に格納する量子化ステップと、
を行い、
量子化ステップにおいて、n個のサンプルのうち、下限値SL未満の標本値を有するサンプルについては、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプルについては、上限値SHが所属する段階の量子化値を対応づけるようにしたものである。
(2) According to the second aspect of the present invention, a sample value to be quantized by associating one of m stages of quantized values with each of n samples having a predetermined sample value. In the quantization method,
An input step for inputting a sample value of n samples as digital data to a computer and storing it in a predetermined storage location;
A condition setting step for setting a stage number m (m is a natural number of 2 or more), a parameter value C (0 <C <1), and a balance value P (0 ≦ P ≦ 1) for the computer;
A sorting step in which a computer performs a process of rearranging n sample values stored in a storage location in order of size;
The computer sets the value of the ((n × (1-C)) × P + 1) -th sample value from the smallest to the lower limit SL based on the n sample values rearranged in order of magnitude by the sorting step. And an upper and lower limit determination step for determining the value of the (n− (n × (1-C)) × (1-P))-th sample value from the smaller one as the upper limit value SH;
A stage determination step in which a computer divides a numerical range from a lower limit value SL to an upper limit value SH into m stages and determines a predetermined quantization value for each stage;
A quantization step in which a computer associates the quantized value of the stage to which the sample value belongs for each of the n samples, and stores each associated quantized value in a memory location corresponding to each sample;
And
In the quantization step, for samples having a sample value less than the lower limit SL among the n samples, a sample having a sample value exceeding the upper limit SH is associated with the quantized value of the stage to which the lower limit SL belongs. Is associated with the quantized value at the stage to which the upper limit SH belongs.

(3) 本発明の第3の態様は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う標本値の量子化方法において、
コンピュータに対して、n個のサンプルの標本値をデジタルデータとして入力し、所定の記憶場所に格納する入力ステップと、
コンピュータに対して、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定ステップと、
コンピュータが、記憶場所に格納されているn個の標本値について、平均値Mと標準偏差σとを演算する平均・標準偏差演算ステップと、
コンピュータが、正規分布において、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)がパラメータ値Cに等しくなる標準化スコアzを求め、求めた平均値Mおよび標準偏差σならびに標準化スコアzを用いて、上限値SH=M+zσおよび下限値SL=M−zσを決定する上下限決定ステップと、
コンピュータが、下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める段階決定ステップと、
コンピュータが、n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づけ、対応づけた各量子化値を各サンプルに対応する記憶場所に格納する量子化ステップと、
を行い、
量子化ステップにおいて、n個のサンプルのうち、下限値SL未満の標本値を有するサンプルについては、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプルについては、上限値SHが所属する段階の量子化値を対応づけるようにしたものである。
(3) According to the third aspect of the present invention, a sample value to be quantized by associating one of m stages of quantized values with each of n samples having a predetermined sample value. In the quantization method,
An input step for inputting a sample value of n samples as digital data to a computer and storing it in a predetermined storage location;
A condition setting step for setting a stage number m (m is a natural number of 2 or more) and a parameter value C (0 <C <1) for the computer;
An average / standard deviation calculation step in which the computer calculates an average value M and a standard deviation σ for n sample values stored in the storage location;
In the normal distribution, the cumulative distribution function value f (z) indicating the proportion of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation” in the normal distribution is the parameter value C. An upper and lower limit determination step for determining an equalized standardized score z and determining an upper limit SH = M + zσ and a lower limit SL = M−zσ using the calculated average value M and standard deviation σ and standardized score z;
A stage determination step in which a computer divides a numerical range from a lower limit value SL to an upper limit value SH into m stages and determines a predetermined quantization value for each stage;
A quantization step in which a computer associates the quantized value of the stage to which the sample value belongs for each of the n samples, and stores each associated quantized value in a memory location corresponding to each sample;
And
In the quantization step, for samples having a sample value less than the lower limit SL among the n samples, a sample having a sample value exceeding the upper limit SH is associated with the quantized value of the stage to which the lower limit SL belongs. Is associated with the quantized value at the stage to which the upper limit SH belongs.

(4) 本発明の第4の態様は、上述した第3の態様に係る標本値の量子化方法において、
正規分布における標準化スコアをzとしたときに、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)と標準化スコアzとの対応関係を示す対応テーブルを予めコンピュータ内に用意しておき、上下限決定ステップでは、対応テーブルを参照することにより、パラメータ値Cに等しい累積分布関数値f(z)に対応する標準化スコアzを求めるようにしたものである。
(4) According to a fourth aspect of the present invention, in the sample value quantization method according to the third aspect described above,
Cumulative distribution function value f (z) indicating the proportion of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation”, where z is the standardized score in the normal distribution A correspondence table showing the correspondence between the standardized score z and the standardized score z is prepared in advance in the computer, and in the upper and lower limit determination step, the cumulative distribution function value f (z) equal to the parameter value C is obtained by referring to the correspondence table. The corresponding standardized score z is obtained.

(5) 本発明の第5の態様は、上述した第1〜第4の態様に係る標本値の量子化方法において、
量子化段階で、標本値Sをもったサンプルに対して、((S−SL)/(SH−SL))×(m−1)なる演算値を整数値に丸めることにより求まる「0〜(m−1)の範囲内の整数で示される量子化値」を対応づけることにより量子化を行うようにしたものである。
(5) According to a fifth aspect of the present invention, in the sample value quantization method according to the first to fourth aspects described above,
In the quantization stage, for a sample having a sample value S, a calculation value of ((S-SL) / (SH-SL)) × (m−1) is rounded to an integer value “0- ( The quantization is performed by associating the “quantized values indicated by integers within the range of m−1)”.

(6) 本発明の第6の態様は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う標本値の量子化装置において、
n個のサンプルの標本値をデジタルデータとして入力し、これを格納する元データ格納部と、
予めもしくはオペレータの指示に基づき、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定部と、
n個の標本値を並べ替えのために一時的に保持するソート作業部と、
元データ格納部に格納されているn個の標本値を複製して、ソート作業部に保持させ、これを大きさの順に並べ替える処理を行うソート処理部と、
ソート処理部による並べ替え処理が完了した後、ソート作業部に大きさの順に並べられているn個の標本値に基づいて、小さい方から第((n×(1−C))/2+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))/2)番目の標本値の値を上限値SHと決定する上下限決定部と、
下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける量子化処理部と、
n個のサンプルについて、それぞれ対応づけられた量子化値をデジタルデータとして格納する量子化データ格納部と、
を設け、
量子化処理部が、n個のサンプルのうち、下限値SL未満の標本値を有するサンプルについては、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプルについては、上限値SHが所属する段階の量子化値を対応づけるようにしたものである。
(6) According to a sixth aspect of the present invention, a sample value to be quantized by associating one of m stages of quantized values with each of n samples having a predetermined sample value. In the quantizer,
An original data storage unit for inputting sample values of n samples as digital data and storing the digital data;
A condition setting unit for setting the number of steps m (m is a natural number of 2 or more) and the parameter value C (0 <C <1) in advance or based on an operator's instruction;
a sort working unit that temporarily holds n sample values for sorting;
A sort processing unit that replicates n sample values stored in the original data storage unit, holds the sample value in the sort operation unit, and performs a process of rearranging the sample values in order of size;
After the rearrangement process by the sort processing unit is completed, the ((n × (1-C)) / 2 + 1) from the smallest one is based on the n sample values arranged in order of size in the sort operation unit. An upper / lower limit determination unit that determines the value of the nth sample value as the lower limit value SL and determines the value of the (n− (n × (1−C)) / 2) th sample value from the smaller value as the upper limit value SH. When,
The numerical value range from the lower limit value SL to the upper limit value SH is divided into m stages, a predetermined quantization value is determined for each stage, and the quantization value of the stage to which the sample value belongs for each of the n samples. A corresponding quantization processing unit;
a quantized data storage unit that stores, as digital data, a quantized value associated with each of n samples;
Provided,
The quantization processing unit associates the quantized value at the stage to which the lower limit value SL belongs with respect to a sample having a sample value less than the lower limit value SL among the n samples, and has a sample value exceeding the upper limit value SH. For the sample, the quantization value at the stage to which the upper limit SH belongs belongs.

(7) 本発明の第7の態様は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う標本値の量子化装置において、
n個のサンプルの標本値をデジタルデータとして入力し、これを格納する元データ格納部と、
予めもしくはオペレータの指示に基づき、段階数m(mは2以上の自然数)、パラメータ値C(0<C<1)、バランス値P(0≦P≦1)を設定する条件設定部と、
n個の標本値を並べ替えのために一時的に保持するソート作業部と、
元データ格納部に格納されているn個の標本値を複製して、ソート作業部に保持させ、これを大きさの順に並べ替える処理を行うソート処理部と、
ソート処理部による並べ替え処理が完了した後、ソート作業部に大きさの順に並べられているn個の標本値に基づいて、小さい方から第((n×(1−C))×P+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))×(1−P))番目の標本値の値を上限値SHと決定する上下限決定部と、
下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける量子化処理部と、
n個のサンプルについて、それぞれ対応づけられた量子化値をデジタルデータとして格納する量子化データ格納部と、
を設け、
量子化処理部が、n個のサンプルのうち、下限値SL未満の標本値を有するサンプルについては、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプルについては、上限値SHが所属する段階の量子化値を対応づけるようにしたものである。
(7) According to a seventh aspect of the present invention, a sample value to be quantized by associating one of m stages of quantized values with each of n samples having a predetermined sample value. In the quantizer,
An original data storage unit for inputting sample values of n samples as digital data and storing the digital data;
A condition setting unit for setting the step number m (m is a natural number of 2 or more), the parameter value C (0 <C <1), and the balance value P (0 ≦ P ≦ 1) in advance or based on an instruction from the operator;
a sort working unit that temporarily holds n sample values for sorting;
A sort processing unit that replicates n sample values stored in the original data storage unit, holds the sample value in the sort operation unit, and performs a process of rearranging the sample values in order of size;
After the rearrangement process by the sort processing unit is completed, the ((n × (1-C)) × P + 1) from the smallest one is based on the n sample values arranged in order of size in the sort operation unit. The value of the nth sample value is determined as the lower limit value SL, and the value of the (n− (n × (1−C)) × (1−P)) th sample value from the smaller value is determined as the upper limit value SH. An upper / lower limit determination unit;
The numerical value range from the lower limit value SL to the upper limit value SH is divided into m stages, a predetermined quantization value is determined for each stage, and the quantization value of the stage to which the sample value belongs for each of the n samples. A corresponding quantization processing unit;
a quantized data storage unit that stores, as digital data, a quantized value associated with each of n samples;
Provided,
The quantization processing unit associates the quantized value at the stage to which the lower limit value SL belongs with respect to a sample having a sample value less than the lower limit value SL among the n samples, and has a sample value exceeding the upper limit value SH. For the sample, the quantization value at the stage to which the upper limit SH belongs belongs.

(8) 本発明の第8の態様は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う標本値の量子化装置において、
n個のサンプルの標本値をデジタルデータとして入力し、これを格納する元データ格納部と、
予めもしくはオペレータの指示に基づき、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定部と、
元データ格納部に格納されているn個の標本値について、平均値Mと標準偏差σとを演算する平均・標準偏差演算部と、
正規分布における標準化スコアをzとしたときに、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)と標準化スコアzとの対応関係を示す対応テーブルを格納した対応テーブル格納部と、
対応テーブルを参照することにより、パラメータ値Cに等しい累積分布関数値f(z)に対応する標準化スコアzを求め、求めた平均値Mおよび標準偏差σならびに標準化スコアzを用いて、上限値SH=M+zσおよび下限値SL=M−zσを決定する上下限決定部と、
下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける量子化処理部と、
n個のサンプルについて、それぞれ対応づけられた量子化値をデジタルデータとして格納する量子化データ格納部と、
を設け、
量子化処理部が、n個のサンプルのうち、下限値SL未満の標本値を有するサンプルについては、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプルについては、上限値SHが所属する段階の量子化値を対応づけるようにしたものである。
(8) According to an eighth aspect of the present invention, a sample value to be quantized by associating one of m stages of quantized values with each of n samples having a predetermined sample value. In the quantizer,
An original data storage unit for inputting sample values of n samples as digital data and storing the digital data;
A condition setting unit for setting the number of steps m (m is a natural number of 2 or more) and the parameter value C (0 <C <1) in advance or based on an operator's instruction;
An average / standard deviation calculation unit for calculating an average value M and a standard deviation σ for n sample values stored in the original data storage unit;
Cumulative distribution function value f (z) indicating the proportion of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation”, where z is the standardized score in the normal distribution A correspondence table storage unit that stores a correspondence table indicating a correspondence relationship between and a standardized score z;
By referring to the correspondence table, the standardized score z corresponding to the cumulative distribution function value f (z) equal to the parameter value C is obtained, and using the obtained average value M, standard deviation σ, and standardized score z, the upper limit SH = M + zσ and a lower limit SL = M−zσ, an upper / lower limit determining unit;
The numerical value range from the lower limit value SL to the upper limit value SH is divided into m stages, a predetermined quantization value is determined for each stage, and the quantization value of the stage to which the sample value belongs for each of the n samples. A corresponding quantization processing unit;
a quantized data storage unit that stores, as digital data, a quantized value associated with each of n samples;
Provided,
The quantization processing unit associates the quantized value at the stage to which the lower limit value SL belongs with respect to a sample having a sample value less than the lower limit value SL among the n samples, and has a sample value exceeding the upper limit value SH. For the sample, the quantization value at the stage to which the upper limit SH belongs belongs.

(9) 本発明の第9の態様は、上述の第6〜第8の態様に係る標本値の量子化装置において、
量子化処理部が、標本値Sをもったサンプルに対して、((S−SL)/(SH−SL))×(m−1)なる演算値を整数値に丸めることにより求まる「0〜(m−1)の範囲内の整数で示される量子化値」を対応づけることにより量子化を行うようにしたものである。
(9) According to a ninth aspect of the present invention, in the sample value quantization apparatus according to the sixth to eighth aspects described above,
The quantization processing unit calculates “(0−S−SL) / (SH−SL)) × (m−1) for the sample having the sample value S by rounding it to an integer value“ 0 ”. Quantization is performed by associating “quantized values represented by integers within the range of (m−1)”.

(10) 本発明の第10の態様は、コンピュータにプログラムを組み込むことにより、上述の第6〜第9の態様に係る標本値の量子化装置として機能させるようにしたものである。   (10) According to a tenth aspect of the present invention, a program is incorporated into a computer so as to function as the sample value quantization apparatus according to the sixth to ninth aspects described above.

本発明に係る標本値の量子化方法および量子化装置によれば、多数のサンプルがもつ個々の標本値を量子化する場合、標本値の最小値に代わる下限値SLと、標本値の最大値に代わる上限値SHとが定められ、下限値SL〜上限値SHまでの数値範囲がm段階に分割されて量子化処理が行われることになる。このため、極端に大きな値や極端に小さな値など、極めて特異な標本値をもつサンプルが含まれていた場合にも、適切な量子化処理が行われる。したがって、標本値にノイズ成分が含まれていた場合にも、当該ノイズ成分を除去した適切な量子化が可能になる。また、下限値SLと上限値SHとは、パラメータ値Cによって任意に設定することが可能であるため、個々のサンプル集団に適したパラメータ値Cを適宜設定することにより、当該サンプル集団に最適な量子化処理を行うことが可能になる。   According to the sample value quantization method and the quantization apparatus according to the present invention, when individual sample values of a large number of samples are quantized, the lower limit value SL instead of the minimum value of the sample values, and the maximum value of the sample values The upper limit value SH is determined, and the numerical range from the lower limit value SL to the upper limit value SH is divided into m stages and the quantization process is performed. For this reason, even when a sample having a very specific sample value such as an extremely large value or an extremely small value is included, an appropriate quantization process is performed. Therefore, even when a noise component is included in the sample value, it is possible to perform appropriate quantization with the noise component removed. Further, since the lower limit value SL and the upper limit value SH can be arbitrarily set by the parameter value C, the parameter value C suitable for each sample group is appropriately set, so that the optimum value for the sample group can be obtained. Quantization processing can be performed.

以下、本発明を図示する実施形態に基づいて説明する。   Hereinafter, the present invention will be described based on the illustrated embodiments.

<<< §1.従来の一般的な量子化手法とその問題点 >>>
はじめに、従来の一般的な量子化手法とその問題点を具体例に即して説明する。いま、それぞれ所定の標本値をもったn個のサンプルからなる母集団について、図1に示すようなヒストグラムが得られた場合を考えてみる。図示の例は、標本値が0〜2550の範囲に分布している例であり、標本値の最小値Smin=0、最大値Smax=2550である。ここで、このn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行うことにする。
<<< §1. Conventional general quantization method and its problems >>
First, a conventional general quantization method and its problems will be described based on a specific example. Consider the case where a histogram as shown in FIG. 1 is obtained for a population of n samples each having a predetermined sample value. The illustrated example is an example in which the sample values are distributed in the range of 0 to 2550, and the minimum value Smin = 0 and the maximum value Smax = 2550 of the sample values. Here, quantization is performed by associating each of the n samples with one of m stages of quantization values.

この場合、従来の一般的な量子化方法では、任意の標本値Sをもつサンプルに対応づけられる量子化値Qは、
Q=INT(((S−Smin)/(Smax−Smin))×(m−1))
なる式で算出される。ここで、INT(X)は、Xの値を整数値に丸める関数(四捨五入でも、切り上げでも、切り捨てでもよい)である。たとえば、具体的例として、各サンプルの標本値を、それぞれ8ビットのデジタルデータにより表現できるように、m=256とし、0〜255までの量子化値を定義した例を考えてみよう。この場合、図1の例では、Smin=0、Smax=2550であるから
Q=INT(((S−0)/(2550−0))×255)
となり、結局、
Q=INT((S/2550)×255)
なる演算式によって、0〜255までの全256段階のいずれかの量子化値が対応づけられることになる。図1のヒストグラムの下方に示した0〜255の升目は、0〜2550までの数値範囲をとる標本値に対応づけられる256段階の量子化値を示している。
In this case, in the conventional general quantization method, the quantization value Q associated with a sample having an arbitrary sample value S is:
Q = INT (((S−Smin) / (Smax−Smin)) × (m−1))
It is calculated by the following formula. Here, INT (X) is a function that rounds the value of X to an integer value (may be rounded, rounded up, or rounded down). For example, let us consider an example in which m = 256 and quantized values from 0 to 255 are defined so that the sample value of each sample can be expressed by 8-bit digital data. In this case, in the example of FIG. 1, Smin = 0 and Smax = 2550.
Q = INT (((S-0) / (2550-0)) × 255)
After all,
Q = INT ((S / 2550) × 255)
Any of the 256-level quantized values from 0 to 255 are associated with each other by the following arithmetic expression. A grid of 0 to 255 shown below the histogram of FIG. 1 indicates 256 levels of quantized values that are associated with sample values that take a numerical range of 0 to 2550.

図1に示す例は、標本値の分布状態がほぼ正規分布に近い母集団についての例であり、このような例の場合、従来の一般的な量子化方法を採用しても、特に不都合は生じない。これに対して、図2に示すような分布状態をとる母集団を考えてみよう。この母集団では、n個のサンプルのうち、(n−1)個の標本値は、0〜510の範囲内に分布しているが、最後の1個の標本値が2550となっている。すなわち、n個のサンプルのうちの1個だけが極めて特異な標本値(極端に大きな値)をとっている。このように、たとえ1個のサンプルであったとしても、その標本値が2550となっている以上、この母集団全体としては、標本値が0〜2550の範囲に分布していることになる。したがって、標本値の最小値Smin=0、最大値Smax=2550となるので、m=256とした場合、各サンプルに対応づけられる量子化値Qは、
Q=INT((S/2550)×255)
なる演算式で与えられることになる。
The example shown in FIG. 1 is an example of a population whose sample value distribution state is almost a normal distribution. In such an example, even if a conventional general quantization method is adopted, there is no particular inconvenience. Does not occur. On the other hand, consider a population having a distribution state as shown in FIG. In this population, out of n samples, (n−1) sample values are distributed in the range of 0 to 510, but the last one sample value is 2550. That is, only one of the n samples takes a very specific sample value (an extremely large value). Thus, even if it is one sample, since the sample value is 2550, the entire population is distributed in the range of 0 to 2550. Therefore, since the minimum value Smin = 0 and the maximum value Smax = 2550 of the sample value, when m = 256, the quantized value Q associated with each sample is
Q = INT ((S / 2550) × 255)
Is given by the following equation.

その結果、図2のヒストグラムの下方に示す升目のように、0〜2550までの数値範囲をとる標本値に対して、0〜255までの量子化値が対応づけられる。ところが、(n−1)個のサンプルの標本値は、0〜510の範囲内に分布しているので、これらのサンプルに対応づけられる量子化値は0〜51ということになる。そして、特異な標本値2550をとるサンプルについては、量子化値255が対応づけられる。結局、量子化値52〜254が対応づけられるサンプルは皆無であり、せっかく256段階の量子化を行っているにも拘わらず、実質的には52段階の量子化を行っているのと変わらない結果となる。すなわち、図2に示すように、極めて特異な標本値をもつサンプルが1つでも含まれていると、従来の量子化方法では、実質的に有効な量子化段階の数が少なくなり、適切な量子化処理が阻害されることになる。   As a result, as shown in the lower part of the histogram in FIG. 2, the quantized values from 0 to 255 are associated with the sample values taking the numerical range from 0 to 2550. However, since the sample values of (n−1) samples are distributed within the range of 0 to 510, the quantized values associated with these samples are 0 to 51. A quantized value 255 is associated with a sample having a specific sample value 2550. In the end, there are no samples to which the quantization values 52 to 254 are associated, and even though the quantization of 256 steps is performed, it is substantially the same as that of the quantization of 52 steps. Result. That is, as shown in FIG. 2, if even one sample having a very specific sample value is included, the number of effective quantization steps is substantially reduced in the conventional quantization method. The quantization process will be hindered.

このように、極めて特異な標本値をもつサンプルが混入する事態は、スキャナーやデジタルカメラなどの測定機器を用いて取り込んだ画像データの場合、少なからず発生する。たとえば、測定系に電磁的なノイズが混入した場合、ノイズの影響を受けた測定画素からのアナログ出力信号は、他の画素からの信号に比べて、極めて特異な値を示す可能性がある。このようなノイズ成分に起因する標本値は、本来、量子化を行う際に除外すべきである。   In this way, a situation in which a sample having a very specific specimen value is mixed occurs not a little in the case of image data captured using a measuring device such as a scanner or a digital camera. For example, when electromagnetic noise is mixed in the measurement system, the analog output signal from the measurement pixel affected by the noise may show a very unique value as compared with signals from other pixels. Sample values resulting from such noise components should be excluded when performing quantization.

たとえば、図2に示す例の場合、標本値2550をとるサンプルを無視して、残りの(n−1)個のサンプルについて量子化を行うようにすれば、標本値の最小値Smin=0、最大値Smax=510となるので、m=256とした場合、各サンプルに対応づけられる量子化値Qは、
Q=INT((S/510)×255)
なる演算式で与えられ、0〜510までの数値範囲をとる標本値に対して、0〜255までの量子化値が対応づけられる。
For example, in the case of the example shown in FIG. 2, if the sample having the sample value 2550 is ignored and the remaining (n−1) samples are quantized, the minimum value Smin = 0 of the sample value, Since the maximum value Smax = 510, when m = 256, the quantized value Q associated with each sample is
Q = INT ((S / 510) × 255)
Quantized values from 0 to 255 are associated with sample values that take a numerical range from 0 to 510.

もちろん、量子化を行う際に除外すべき標本値は、必ずしもノイズ成分に起因する標本値に限らない。たとえば、図2に示す例において、標本値2550がノイズ成分に起因するものではなく、本来の正しい測定値を示すものであったとしても、このような極めて特異な標本値は、量子化を行う際に除外した方が好ましい。   Of course, sample values to be excluded when performing quantization are not necessarily limited to sample values caused by noise components. For example, in the example shown in FIG. 2, even if the sample value 2550 does not originate from a noise component but shows an original correct measurement value, such a very specific sample value is quantized. It is better to exclude it.

本発明は、図2に示す例のように、極めて特異な標本値をもつサンプルが含まれていた場合にも、適切な量子化処理を行うことが可能な標本値の量子化方法および量子化装置を提供することを目的とするものであり、以下に、その基本概念を説明する。   The present invention provides a sample value quantization method and a quantization method capable of performing appropriate quantization processing even when a sample having a very specific sample value is included as in the example shown in FIG. The object is to provide an apparatus, and its basic concept will be described below.

<<< §2.本発明の基本概念 >>>
本発明の基本的な考え方は、n個のサンプルの標本値が最小値Smin〜Smaxという数値範囲に分布していた場合に、当該数値範囲の全域を量子化対象範囲とせずに、その両端の一部を除外した領域を量子化対象範囲として量子化を行う、という点にある。
<<< §2. Basic concept of the present invention >>
The basic idea of the present invention is that when the sample values of n samples are distributed in the numerical range of the minimum values Smin to Smax, the entire numerical range is not set as the quantization target range, but at both ends thereof. The quantization is performed using the region excluding a part as the quantization target range.

たとえば、図3は、図1に示す例と同様に、0〜2550の範囲に分布した標本値を有するn個のサンプルからなる母集団のヒストグラムである。したがって、この母集団の標本値の最小値はSmin=0であり、最大値はSmax=2550である。ここで、図示のとおり、最小値Smin=0よりも若干大きな下限値SLと、最大値Smax=2550よりも若干小さな上限値SHとを設定し、標本値を示す横軸を3つの区間a,b,cに分割する。ここで、区間aは、最小値Smin(=0)〜下限値SLの区間であり、区間bは、下限値SL〜上限値SHの区間であり、区間cは、上限値SH〜最大値Smax(=2550)の区間である。なお、境界となる下限値SLおよび上限値SHは、概念的には両方の区間に属すると考えてよい。   For example, FIG. 3 is a histogram of a population composed of n samples having sample values distributed in the range of 0 to 2550, as in the example shown in FIG. Therefore, the minimum value of the sample values of this population is Smin = 0, and the maximum value is Smax = 2550. Here, as shown in the figure, a lower limit SL slightly larger than the minimum value Smin = 0 and an upper limit SH slightly smaller than the maximum value Smax = 2550 are set. Divide into b and c. Here, the section a is a section from the minimum value Smin (= 0) to the lower limit value SL, the section b is a section from the lower limit value SL to the upper limit value SH, and the section c is an upper limit value SH to the maximum value Smax. (= 2550). Note that the lower limit value SL and the upper limit value SH serving as boundaries may conceptually belong to both sections.

ここで、区間bを量子化対象範囲とし、この量子化対象範囲b内の数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定めるようにする。区間aおよびcは、量子化対象から除外されることになるので、以下、区間aを下方除外範囲と呼び、区間cを上方除外範囲と呼ぶことにする。そして、量子化対象範囲b内の標本値をもつサンプルについては、その標本値が所属する段階の量子化値を対応づける。すなわち、任意の標本値Sをもつサンプルに対応づけられる量子化値Qは、
Q=INT(((S−SL)/(SH−SL))×(m−1))
なる式で算出される。INT(X)は、前述したとおり、Xの値を整数値に丸める関数(四捨五入でも、切り上げでも、切り捨てでもよい)である。たとえば、m=256とした場合は、
Q=INT(((S−SL)/(SH−SL))×255)
となる。図3のヒストグラムの下方に示した0〜255の升目は、量子化対象範囲b内の標本値に対応づけられる256段階の量子化値を示している。
Here, the interval b is set as the quantization target range, and the numerical range in the quantization target range b is divided into m stages, and predetermined quantization values are determined for each stage. Since the sections a and c are excluded from the quantization target, the section a is hereinafter referred to as a lower exclusion range and the section c is referred to as an upper exclusion range. And about the sample which has the sample value in the quantization object range b, the quantization value of the stage to which the sample value belongs is matched. That is, the quantized value Q associated with a sample having an arbitrary sample value S is
Q = INT (((S−SL) / (SH−SL)) × (m−1))
It is calculated by the following formula. As described above, INT (X) is a function that rounds the value of X to an integer value (may be rounded, rounded up, or rounded down). For example, if m = 256,
Q = INT (((S-SL) / (SH-SL)) × 255)
It becomes. The grids 0 to 255 shown below the histogram in FIG. 3 indicate 256-stage quantized values that are associated with the sample values in the quantization target range b.

一方、下限値SL未満の標本値を有するサンプル(下方除外範囲aに所属するサンプル:図3のヒストグラムの左端ハッチング部分)については、下限値SLが所属する段階の量子化値0を対応づけ、上限値SHを越える標本値を有するサンプル(上方除外範囲cに所属するサンプル:図3のヒストグラムの右端ハッチング部分)については、上限値SHが所属する段階の量子化値255を対応づけるようにする。   On the other hand, for samples having sample values less than the lower limit SL (samples belonging to the lower exclusion range a: the leftmost hatched portion of the histogram in FIG. 3), the quantization value 0 of the stage to which the lower limit SL belongs is associated. For samples having sample values exceeding the upper limit SH (samples belonging to the upper exclusion range c: the rightmost hatched portion of the histogram in FIG. 3), the quantization value 255 at the stage to which the upper limit SH belongs is associated. .

このような取り扱いをすると、量子化後のヒストグラムとしては、下方除外範囲aの出現頻度は0となり、この部分のサンプルの出現頻度は、下限値SLについての出現頻度に積算されることになる。図3のヒストグラムに示す頻度積算バーB1は、こうして積算されたサンプル数を示し、ヒストグラムの左端ハッチング部分のサンプル数に相当する。同様に、上方除外範囲cの出現頻度も0となり、この部分のサンプルの出現頻度は、上限値SHについての出現頻度に積算されることになる。図3のヒストグラムに示す頻度積算バーB2は、こうして積算されたサンプル数を示し、ヒストグラムの右端ハッチング部分のサンプル数に相当する。   With this handling, the appearance frequency of the lower exclusion range a is 0 in the quantized histogram, and the appearance frequency of this portion of the sample is added to the appearance frequency for the lower limit value SL. The frequency integration bar B1 shown in the histogram of FIG. 3 indicates the number of samples integrated in this way, and corresponds to the number of samples in the leftmost hatched portion of the histogram. Similarly, the appearance frequency of the upper exclusion range c is also 0, and the appearance frequency of this portion of the sample is added to the appearance frequency for the upper limit SH. The frequency integration bar B2 shown in the histogram of FIG. 3 indicates the number of samples integrated in this way, and corresponds to the number of samples in the rightmost hatched portion of the histogram.

こうして、量子化を行う際に、上述のような本発明に係る取り扱いを行うと、図1に示す従来の量子化手法の結果とは若干異なる結果が得られることになる。すなわち、量子化対象範囲が、本来の範囲であるSmin〜Smaxから、SL〜SHという範囲に変更されることになり、量子化値0をとるサンプル数が本来よりも頻度積算バーB1の分だけ多くなり、同様に、量子化値255をとるサンプル数が本来よりも頻度積算バーB2の分だけ多くなる。しかしながら、これら両端の量子化値をとるサンプルを除けば、大局的には、従来の量子化法と大差ない結果が得られ、実用上、大きな支障は生じない。   Thus, when performing the quantization according to the present invention as described above, a result slightly different from the result of the conventional quantization method shown in FIG. 1 is obtained. That is, the quantization target range is changed from the original range of Smin to Smax to the range of SL to SH, and the number of samples for which the quantized value is 0 is equal to the frequency integration bar B1 than the original range. Similarly, the number of samples taking the quantized value 255 is increased by the frequency integration bar B2 from the original. However, except for the samples that take the quantization values at both ends, a result that is not significantly different from the conventional quantization method can be obtained on a global basis, and there is no practical problem.

図3に示す例は、標本値の分布状態がほぼ正規分布に近い母集団についての例であるため、本発明に係る量子化法のメリットは顕著ではない。ところが、本発明を、極めて特異な標本値を有する母集団に対して適用した場合には、大きなメリットが生じる。具体的には、図4に示すような分布状態をとる母集団に適用した場合を考えてみよう。この図4に示すヒストグラムは、図2に示すヒストグラムと同様であり、この母集団では、n個のサンプルのうち、(n−1)個の標本値は、0〜510の範囲内に分布しているが、最後の1個の標本値が2550となっている。このように、極めて特異な標本値2550をもつサンプルが存在すると、従来の量子化法では、実質的に有効な量子化段階の数が少なくなり、適切な量子化処理が阻害されるという問題が生じることは、既に述べたとおりである。   The example shown in FIG. 3 is an example of a population in which the distribution state of sample values is almost a normal distribution, and thus the merit of the quantization method according to the present invention is not significant. However, when the present invention is applied to a population having extremely specific sample values, a great merit occurs. Specifically, consider the case where the present invention is applied to a population having a distribution state as shown in FIG. The histogram shown in FIG. 4 is the same as the histogram shown in FIG. 2. In this population, (n−1) sample values out of n samples are distributed in the range of 0 to 510. However, the last one sample value is 2550. Thus, when there is a sample having a very specific sample value 2550, the conventional quantization method has a problem that the number of effective quantization steps is substantially reduced and an appropriate quantization process is hindered. What happens is as already mentioned.

本発明に係る量子化法では、次のような取り扱いがなされる。まず、この母集団の標本値の最小値はSmin=0であり、最大値はSmax=2550である。ここで、図示のとおり、最小値Smin=0よりも若干大きな下限値SLと、最大値Smax=2550よりもかなり小さな上限値SHとを設定し、標本値を示す横軸を、下方除外範囲a,量子化対象範囲b,上方除外範囲cに分割する。下方除外範囲aは、最小値Smin(=0)〜下限値SLの区間であり、量子化対象範囲bは、下限値SL〜上限値SHの区間であり、上方除外範囲cは、上限値SH〜最大値Smax(=2550)の区間である。   In the quantization method according to the present invention, the following handling is performed. First, the minimum value of the sample values of this population is Smin = 0, and the maximum value is Smax = 2550. Here, as shown in the drawing, a lower limit value SL slightly larger than the minimum value Smin = 0 and an upper limit value SH considerably smaller than the maximum value Smax = 2550 are set, and the horizontal axis indicating the sample value is represented by the lower exclusion range a. , The range to be quantized b, and the upper exclusion range c. The lower exclusion range a is a section from the minimum value Smin (= 0) to the lower limit value SL, the quantization target range b is a section from the lower limit value SL to the upper limit value SH, and the upper exclusion range c is the upper limit value SH. It is a section of ~ maximum value Smax (= 2550).

そして、上述したとおり、量子化対象範囲b内の数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める。たとえば、m=256とした場合は、図4のヒストグラムの下方に示すような256段階の量子化値が定義される。そして、量子化対象範囲b内の標本値をもつサンプルについては、その標本値が所属する段階の量子化値を対応づけ、下限値SL未満の標本値を有するサンプル(下方除外範囲aに所属するサンプル:図4のヒストグラムの左端ハッチング部分)については、下限値SLが所属する段階の量子化値0を対応づけ、上限値SHを越える標本値を有するサンプル(上方除外範囲cに所属するサンプル:図4のヒストグラムの右端ハッチング部分および標本値2550をもつサンプル)については、上限値SHが所属する段階の量子化値255を対応づけるようにする。   Then, as described above, the numerical range within the quantization target range b is divided into m stages, and predetermined quantization values are determined for the respective stages. For example, when m = 256, 256 levels of quantization values are defined as shown below the histogram of FIG. Then, for a sample having a sample value in the quantization target range b, the quantization value at the stage to which the sample value belongs is associated and a sample having a sample value less than the lower limit SL (belonging to the lower exclusion range a) For the sample: the hatched portion at the left end of the histogram in FIG. 4, a sample having a sample value exceeding the upper limit SH (corresponding to the quantization value 0 at the stage to which the lower limit SL belongs) (sample belonging to the upper exclusion range c: For the rightmost hatched portion of the histogram in FIG. 4 and the sample having the sample value 2550, the quantized value 255 at the stage to which the upper limit SH belongs belongs.

このような取り扱いをすると、量子化後のヒストグラムとしては、下方除外範囲aの出現頻度は0となり、この部分のサンプルの出現頻度は、下限値SLについての出現頻度に積算されることになる。図4のヒストグラムに示す頻度積算バーB1は、こうして積算されたサンプル数を示し、ヒストグラムの左端ハッチング部分のサンプル数に相当する。同様に、上方除外範囲cの出現頻度も0となり、この部分のサンプルの出現頻度は、上限値SHについての出現頻度に積算されることになる。図4のヒストグラムに示す頻度積算バーB2は、こうして積算されたサンプル数を示し、ヒストグラムの右端ハッチング部分および標本値2550をもつサンプルのサンプル数に相当する。   With this handling, the appearance frequency of the lower exclusion range a is 0 in the quantized histogram, and the appearance frequency of this portion of the sample is added to the appearance frequency for the lower limit value SL. The frequency integration bar B1 shown in the histogram of FIG. 4 indicates the number of samples integrated in this way, and corresponds to the number of samples in the leftmost hatched portion of the histogram. Similarly, the appearance frequency of the upper exclusion range c is also 0, and the appearance frequency of this portion of the sample is added to the appearance frequency for the upper limit SH. The frequency integration bar B2 shown in the histogram of FIG. 4 indicates the number of samples integrated in this way, and corresponds to the number of samples of the sample having the rightmost hatched portion of the histogram and the sample value 2550.

やはり、量子化対象範囲が、本来の範囲であるSmin〜Smaxから、SL〜SHという範囲に変更されることになり、量子化値0をとるサンプル数が本来よりも頻度積算バーB1の分だけ多くなり、同様に、量子化値255をとるサンプル数が本来よりも頻度積算バーB2の分だけ多くなるが、大局的には、適切な量子化が行われていることになる。   After all, the quantization target range is changed from the original range Smin to Smax to the range SL to SH, and the number of samples taking the quantized value 0 is equal to the frequency integration bar B1 than the original range. Similarly, the number of samples that take the quantized value 255 is increased by the frequency integration bar B2 from the original, but generally, appropriate quantization is performed.

図2に示す従来の量子化法に基づく結果と、図4に示す本発明に係る量子化法に基づく結果とを比較すれば、本発明のメリットは明白である。図2に示す例では、0〜2550までの数値範囲をとる標本値に対して、0〜255までの量子化値が対応づけられているため、せっかく256段階の量子化を行っているにも拘わらず、実質的には52段階の量子化を行っているのと変わらない結果となる。これに対して、図4に示す例では、0〜2550までの数値範囲をとる標本値に対して、下限値SL〜上限値SHまでの量子化対象範囲bについて0〜255までの量子化値が対応づけられるので、大多数のサンプルが分布している範囲に対して256段階の量子化が行われたことになり、実質的に有効な量子化段階の数を十分に確保することができ、適切な量子化処理が可能になる。   If the result based on the conventional quantization method shown in FIG. 2 is compared with the result based on the quantization method according to the present invention shown in FIG. 4, the merit of the present invention is obvious. In the example shown in FIG. 2, quantization values from 0 to 255 are associated with sample values that take a numerical value range from 0 to 2550, so 256 levels of quantization are performed. Regardless, the result is substantially the same as when performing 52-stage quantization. On the other hand, in the example shown in FIG. 4, the quantized values from 0 to 255 for the quantization target range b from the lower limit value SL to the upper limit value SH with respect to the sample value taking the numerical range from 0 to 2550. Therefore, 256 stages of quantization have been performed on the range in which the majority of samples are distributed, and the number of effective quantization stages can be sufficiently secured. Therefore, an appropriate quantization process can be performed.

ここで、本発明を実施する上では、下限値SLおよび上限値SHをどのように設定するかが重要であることがわかる。たとえば、図4に示す例の場合、最小値Smin=0に対して+30した値として、下限値SL=30を設定し、最大値Smax=2550に対して、−30した値として、上限値SH=2520という設定を行ったとすると、このような設定では、本発明のメリットは十分に得られないことがわかるであろう。この場合、数値幅30に相当する下方除外範囲aおよび上方除外範囲cが設定されるものの、量子化対象範囲bは、30〜2520の数値範囲となり、実質的に有効な量子化段階の数を十分に確保することはできない。したがって、所定の絶対値Δを定め、下限値SL=最小値Smin+Δ、上限値SL=最大値Smax−Δ、というような設定方法は有効な方法とは言えない。同様に、所定の割合G%を定め、下限値SL=最小値Smin+(Smax−Smin)×G%、上限値SL=最大値Smax−(Smax−Smin)×G%、というような設定方法も有効な方法とは言えない。   Here, it is understood that how to set the lower limit value SL and the upper limit value SH is important in carrying out the present invention. For example, in the case of the example shown in FIG. 4, the lower limit SL = 30 is set as a value +30 with respect to the minimum value Smin = 0, and the upper limit SH is set as a value −30 with respect to the maximum value Smax = 2550. If the setting of = 2520 is performed, it will be understood that the merit of the present invention cannot be sufficiently obtained with such a setting. In this case, although the lower exclusion range a and the upper exclusion range c corresponding to the numerical value range 30 are set, the quantization target range b is a numerical range of 30 to 2520, and the number of effective quantization stages is substantially equal to the numerical range. It cannot be secured sufficiently. Therefore, a setting method in which a predetermined absolute value Δ is set and the lower limit value SL = minimum value Smin + Δ and the upper limit value SL = maximum value Smax−Δ is not an effective method. Similarly, there is a setting method in which a predetermined ratio G% is determined, and the lower limit value SL = minimum value Smin + (Smax−Smin) × G% and the upper limit value SL = maximum value Smax− (Smax−Smin) × G%. It is not an effective method.

本願発明者は、本発明のメリットを十分に生かすためには、下限値SLおよび上限値SHを、サンプル数の割合に基づいて決定するのが最良であることに気がついた。具体的には、たとえば、全n個のサンプルをその標本値の小さい順に並べたときに、順位がn×0%〜n×5%に所属するサンプルが下方除外範囲aに含まれ、順位がn×5%〜n×95%に所属するサンプルが量子化対象範囲bに含まれ、順位がn×95%〜n×100%に所属するサンプルが上方除外範囲cに含まれるように、各範囲a,b,cの境界となる下限値SLおよび上限値SHを設定するのである。そうすれば、標本値が下限値SL未満となる5%のサンプルと、標本値が上限値SHを越える5%のサンプルとが、量子化対象範囲bから外れることになり、残りの90%のサンプルが、量子化対象範囲b内のサンプルということになる。   The inventor of the present application has realized that it is best to determine the lower limit value SL and the upper limit value SH based on the ratio of the number of samples in order to make full use of the merits of the present invention. Specifically, for example, when all n samples are arranged in ascending order of the sample values, the samples belonging to the rank n × 0% to n × 5% are included in the lower exclusion range a, and the rank is Samples belonging to n × 5% to n × 95% are included in the quantization target range b, and samples belonging to the rank n × 95% to n × 100% are included in the upper exclusion range c. A lower limit value SL and an upper limit value SH that are boundaries of the ranges a, b, and c are set. Then, 5% of the samples whose sample values are less than the lower limit SL and 5% of the samples whose sample values exceed the upper limit SH are out of the quantization target range b, and the remaining 90%. The sample is a sample within the quantization target range b.

別言すれば、標本値の小さな一部のサンプルと、標本値の大きな一部のサンプルを除外し、標本値が中程度の「n×90%」個のサンプルの標本値の分布範囲を量子化対象範囲bとして、量子化が行われることになる。このような設定を行った場合、図3に示す例では、ヒストグラムの左端ハッチング部分に属するサンプル数が「n×5%」、ヒストグラムの右端ハッチング部分に属するサンプル数が「n×5%」、残りの中間部分に属するサンプル数が「n×90%」ということになる。同様に、図4に示す例では、ヒストグラムの左端ハッチング部分に属するサンプル数が「n×5%」、ヒストグラムの右端ハッチング部分に属するサンプルおよび標本値2550をもつサンプルの総数が「n×5%」、残りの中間部分に属するサンプル数が「n×90%」ということになる。このような方法で下限値SLおよび上限値SHの設定を行えば、本発明のメリットを十分に生かした量子化が可能になる。   In other words, some samples with small sample values and some samples with large sample values are excluded, and the distribution range of sample values of “n × 90%” samples with medium sample values is quantized. The quantization is performed as the quantization target range b. When such setting is performed, in the example shown in FIG. 3, the number of samples belonging to the leftmost hatched portion of the histogram is “n × 5%”, the number of samples belonging to the rightmost hatched portion of the histogram is “n × 5%”, The number of samples belonging to the remaining intermediate portion is “n × 90%”. Similarly, in the example illustrated in FIG. 4, the number of samples belonging to the leftmost hatched portion of the histogram is “n × 5%”, and the total number of samples belonging to the rightmost hatched portion of the histogram and the sample value 2550 is “n × 5%”. ”, The number of samples belonging to the remaining intermediate portion is“ n × 90% ”. If the lower limit value SL and the upper limit value SH are set by such a method, quantization that makes full use of the merits of the present invention becomes possible.

もちろん、中間部分に属するサンプル数の割合は、必ずしも90%に設定する必要はなく、85%に設定しても、80%に設定してもかまわない。本発明では、この中間部分に属するサンプル数の割合(量子化対象範囲bに含まれるサンプル数の全サンプル数nに対する割合)を、パラメータ値C(0<C<1)として設定することにする。C=90%に設定すれば、残り10%のサンプルが、下方除外範囲aもしくは上方除外範囲cに所属することになり、これら10%のサンプルが極めて特異な標本値を有していても、適切な量子化が行われることになる。   Of course, the ratio of the number of samples belonging to the intermediate portion does not necessarily need to be set to 90%, and may be set to 85% or 80%. In the present invention, the ratio of the number of samples belonging to the intermediate portion (the ratio of the number of samples included in the quantization target range b to the total number of samples n) is set as the parameter value C (0 <C <1). . If C = 90%, the remaining 10% of the samples belong to the lower exclusion range a or the upper exclusion range c, and even if these 10% samples have very specific specimen values, Appropriate quantization will be performed.

パラメータ値Cを小さく設定すればするほど、特異な標本値を有するサンプルをより多く除外範囲に追いやることができるが、量子化対象範囲bはそれだけ狭まることになり、量子化の結果が従来の量子化法による結果と遊離し、得られる量子化結果は、本来の量子化結果に比べて歪んだものになる。したがって、実用上は、特異な標本値を有するサンプル数が比較的多いと思われる母集団に対しては、パラメータ値Cを、たとえば80%のように、比較的小さく設定し、図3に示すような正規分布に近いと思われる母集団に対しては、たとえば98%のように、比較的大きく設定する、というように、母集団の特性に応じて、パラメータ値Cを適宜設定するようにすればよい。   The smaller the parameter value C is set, the more samples having specific sample values can be driven to the exclusion range. However, the quantization target range b is narrowed so much, and the quantization result is the conventional quantum value. The result of quantization is free from the result of quantization, and the obtained quantization result is distorted compared to the original quantization result. Therefore, in practice, for a population that seems to have a relatively large number of samples having unique sample values, the parameter value C is set to a relatively small value, for example, 80%, and is shown in FIG. For a population that seems to be close to such a normal distribution, the parameter value C is appropriately set according to the characteristics of the population, such as 98%, for example. do it.

<<< §3.本発明の基本的実施形態 >>>
続いて、図5の流れ図を参照しながら、本発明に係る標本値の量子化方法の基本的な実施形態を説明する。この量子化方法は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う方法であり、実際には、コンピュータによって実行される処理から構成される。
<<< §3. Basic embodiment of the present invention >>
Next, a basic embodiment of the sample value quantization method according to the present invention will be described with reference to the flowchart of FIG. This quantization method is a method of performing quantization by associating one of m stages of quantization values with each of n samples having a predetermined sample value. It is comprised from the process performed by.

まず、入力ステップS1では、コンピュータに対して、n個のサンプルの標本値をデジタルデータとして入力し、所定の記憶場所に格納する処理が行われる。ここでは、たとえば、S1,S2,S3,...,Snというn個のデジタルデータが標本値としてコンピュータに入力されたものとする。   First, in the input step S1, a sample value of n samples is input as digital data to the computer and stored in a predetermined storage location. Here, for example, it is assumed that n digital data S1, S2, S3,..., Sn are input to the computer as sample values.

次の条件設定ステップS2は、入力したn個のサンプルに対する量子化処理の条件を設定する処理段階であり、コンピュータに対して、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)の設定が行われる。たとえば、量子化後のサンプルを8ビットのデータで表現するのであれば、n個のサンプルのそれぞれに対して、256段階のいずれかの量子化値0〜255を対応づけることになるので、m=256(2)に設定することになる。一方、パラメータ値Cは、上述したとおり、全n個のサンプルのうち、量子化対象範囲bに含まれるサンプルの割合を示す値であり、n個のサンプルからなる母集団の特性に応じて、適当と思われる値(たとえば、90%などの値)を設定すればよい。 The next condition setting step S2 is a processing stage for setting the quantization processing conditions for the input n samples, and for the computer, the stage number m (m is a natural number of 2 or more) and parameter value C (0 <C <1) is set. For example, if the quantized sample is expressed by 8-bit data, any of the n samples is associated with one of 256 quantization values 0 to 255. = 256 (2 8 ). On the other hand, as described above, the parameter value C is a value indicating the proportion of samples included in the quantization target range b out of all n samples, and according to the characteristics of the population composed of n samples, An appropriate value (for example, a value such as 90%) may be set.

以上述べた、ステップS1,S2の処理は、コンピュータを操作するオペレータが、コンピュータに対して何らかの操作を行うことにより実行される処理であり、いわば量子化のための準備処理ということができる。これに対して、以下に述べるステップS3〜S6は、コンピュータによって自動的に実行される処理である。   The processes in steps S1 and S2 described above are processes that are executed when an operator who operates the computer performs some operation on the computer, and can be said to be a preparation process for quantization. On the other hand, steps S3 to S6 described below are processes automatically executed by the computer.

まず、ソートステップS3では、ステップS1で入力され、コンピュータ内の記憶場所に格納されているn個の標本値を大きさの順に並べ替える処理が行われる。ステップS1で入力したn個のデジタルデータS1,S2,S3,...,Snは、それぞれのサンプルの標本値であり、これらの標本値が、小さい順もしくは大きい順に並び替えられることになる。なお、このようなスカラー値をもったデータを大きさの順に並べ替える処理は、一般にソート処理と呼ばれている公知の処理であり、様々なアルゴリズムが知られている。したがって、ここでは、ソート処理を行うための詳細な手順についての説明は省略する。   First, in the sorting step S3, a process of rearranging the n sample values input in step S1 and stored in the storage location in the computer in order of size is performed. The n pieces of digital data S1, S2, S3,..., Sn input in step S1 are sample values of the respective samples, and these sample values are rearranged in ascending order or descending order. Note that the process of rearranging data having scalar values in the order of size is a known process generally called a sort process, and various algorithms are known. Therefore, a detailed description of the procedure for performing the sorting process is omitted here.

続く上下限決定ステップS4では、§2で説明した下限値SLおよび上限値SHを決定する処理が行われる。具体的には、ソートステップS3によって大きさの順に並べ替えられたn個の標本値に基づいて、小さい方から第((n×(1−C))/2+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))/2)番目の標本値の値を上限値SHと決定する処理が行われる(計算結果が整数番目にならない場合には、切り捨てまたは切り上げなどにより適宜まるめてよい)。ソートステップS3の実行により、コンピュータ内のメモリには、アドレスの順番に従って、標本値が大きさの順に格納されているので、小さい方からX番目の標本値の値は、X番目に対応するアドレスに格納されているデータを読み出すことにより認識することができる。したがって、このステップS4の処理は、それぞれ特定のアドレスからデータを読み出し、これを下限値SLおよび上限値SHとする処理ということになる。   In the subsequent upper / lower limit determination step S4, the process of determining the lower limit value SL and the upper limit value SH described in §2 is performed. Specifically, the value of the ((n × (1-C)) / 2 + 1) -th sample value from the smaller one is calculated based on the n sample values rearranged in order of magnitude by the sorting step S3. The lower limit value SL is determined, and the process of determining the value of the (n− (n × (1-C)) / 2) th sample value from the smaller value as the upper limit value SH is performed (the calculation result is the integer number). If not, round it up by rounding down or rounding up) By executing the sort step S3, the sample values are stored in the memory in the computer in the order of the size in the order of the addresses. Therefore, the value of the Xth sample value from the smallest is the address corresponding to the Xth. Can be recognized by reading the data stored in the. Therefore, the process of step S4 is a process of reading data from each specific address and setting it to the lower limit value SL and the upper limit value SH.

ここでは、たとえば、ステップS1において、n=10000個の標本値が入力され、ステップS2において、パラメータ値C=90%(0.9)という設定が行われた場合を考えてみよう。この場合、小さい方から第((n×(1−C))/2+1)番目、すなわち、小さい方から501番目の標本値の値が下限値SLとなり、小さい方から第(n−(n×(1−C))/2)番目、すなわち、小さい方から9500番目の標本値の値が上限値SHとなる。下限値SLや上限値SHが、実際にどのような値になるかは、小さい方から501番目および9500番目の標本値がどのような値であるかに依存して決まることになる。当然ながら、図3に示すような分布をとる母集団を対象とする場合と、図4に示すような分布をとる母集団を対象とする場合とでは、下限値SLや上限値SHの値は異なる。   Here, for example, consider the case where n = 10000 sample values are input in step S1, and the parameter value C = 90% (0.9) is set in step S2. In this case, the value of the ((n × (1-C)) / 2 + 1) th from the smallest, that is, the value of the 501st sample value from the smallest is the lower limit SL, and the (n− (n × n × The value of the (1-C)) / 2) th, that is, the 9500th sample value from the smallest is the upper limit SH. The actual values of the lower limit SL and the upper limit SH are determined depending on the values of the 501st and 9500th sample values from the smallest. Naturally, the values of the lower limit SL and the upper limit SH are as follows when the population having the distribution shown in FIG. 3 is targeted and when the population having the distribution shown in FIG. 4 is targeted. Different.

次の段階決定ステップS5では、下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める処理が行われる。たとえば、ステップS2において、段階数m=256という設定がなされていたとすると、上述の具体例の場合、小さい方から501番目〜9500番目の標本値の数値範囲が量子化対象範囲bとなり、この範囲が256段階に分割され、各段階に0〜255の量子化値が対応づけられる。   In the next stage determination step S5, the numerical value range from the lower limit value SL to the upper limit value SH is divided into m stages, and processing for determining a predetermined quantized value for each stage is performed. For example, assuming that the number of stages m = 256 is set in step S2, in the case of the above-described specific example, the numerical range of the 501st to 9500th sample values from the smallest is the quantization target range b. Are divided into 256 stages, and a quantization value of 0 to 255 is associated with each stage.

そして、最後の量子化ステップS6では、n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づけ、対応づけた各量子化値を各サンプルに対応する記憶場所に格納する処理が行われる。具体的には、標本値Sをもったサンプルに対して、((S−SL)/(SH−SL))×(m−1)なる演算値を整数値に丸めることにより求まる「0〜(m−1)の範囲内の整数で示される量子化値」を対応づけることにより量子化が行われる。但し、下限値SL未満の標本値を有するサンプルについては、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプルについては、上限値SHが所属する段階の量子化値を対応づける。   Then, in the last quantization step S6, for each of the n samples, the quantization value at the stage to which the sample value belongs is associated, and each associated quantization value is stored in a memory location corresponding to each sample. Processing is performed. Specifically, for a sample having the sample value S, “0 (-(S−SL) / (SH−SL)) × (m−1)” is obtained by rounding the calculated value to an integer value. Quantization is performed by associating a “quantized value indicated by an integer within a range of m−1)”. However, for a sample having a sample value less than the lower limit SL, the quantization value at the stage to which the lower limit SL belongs is associated, and for a sample having a sample value exceeding the upper limit SH, the stage to which the upper limit SH belongs. Associate the quantized values of.

すなわち、標本値Sをもったサンプルに対しては、
Q=INT(((S−SL)/(SH−SL))×(m−1))
なる演算式で求まる量子化値Qが対応づけられる。但し、INT(X)は、Xの値を整数値に丸める関数(四捨五入でも、切り上げでも、切り捨てでもよい)である。たとえば、SL=50、SH=460、S=123、m=256として、INT(X)としてXの小数部を切り捨てする関数を用いたとすれば、
Q=INT(((123−50)/(460−50))×(256−1))
なる演算により、Q=45なる量子化値が得られることになる。したがって、S=123なる標本値をもつサンプルに対しては、Q=45なる量子化値が対応づけられる。
That is, for a sample with a sample value S,
Q = INT (((S−SL) / (SH−SL)) × (m−1))
The quantized value Q obtained by the following arithmetic expression is associated. However, INT (X) is a function for rounding the value of X to an integer value (rounding, rounding up, or rounding down). For example, if SL = 50, SH = 460, S = 123, m = 256, and a function that truncates the fractional part of X as INT (X) is used,
Q = INT (((123-50) / (460-50)) × (256-1))
As a result, a quantized value of Q = 45 is obtained. Accordingly, a quantized value of Q = 45 is associated with a sample having a sample value of S = 123.

また、下限値SL=50であるから、S=50未満の標本値をもつサンプルについては、一律にQ=0なる量子化値が対応づけられ、上限値SH=460であるから、S=460を越える標本値をもつサンプルについては、一律にQ=255なる量子化値が対応づけられる。   Further, since the lower limit value SL = 50, for samples having a sample value less than S = 50, a quantized value of Q = 0 is uniformly associated with the upper limit value SH = 460, so S = 460. For samples having a sample value exceeding 1, a quantized value of Q = 255 is uniformly associated.

図6は、本発明の基本的実施形態に係る量子化処理装置の構成を示すブロック図である。この装置は、所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う装置であり、図5の流れ図に示す各ステップを実行する機能を有している。上述したとおり、この各ステップは、実際にはコンピュータを用いて実行される処理である。図6に示すとおり、この装置は、元データ格納部10,ソート作業部20,ソート処理部30,量子化処理部40,上下限決定部50,条件設定部60,量子化データ格納部70という各ブロック構成要素の集合体からなるが、実際には、これらの各構成要素は、コンピュータに専用のプログラムを組み込むことにより実現される。   FIG. 6 is a block diagram showing the configuration of the quantization processing apparatus according to the basic embodiment of the present invention. This device is a device that performs quantization by associating one of m stages of quantized values with each of n samples having a predetermined sample value. Each of the samples shown in the flowchart of FIG. It has a function to execute steps. As described above, each step is actually a process executed using a computer. As shown in FIG. 6, this apparatus is referred to as an original data storage unit 10, a sort operation unit 20, a sort processing unit 30, a quantization processing unit 40, an upper / lower limit determination unit 50, a condition setting unit 60, and a quantized data storage unit 70. Each block is composed of a collection of blocks. Actually, each of these components is realized by incorporating a dedicated program into a computer.

元データ格納部10は、n個のサンプルの標本値をデジタルデータとして入力し、これを格納する構成要素である。ここに示す実施形態の場合、コンピュータ用のハードディスク装置によって元データ格納部10が構成されている。オペレータは、所定のデータフォーマットをもったファイルの形式で、n個のサンプルの標本値S1,S2,S3,...,Snをデジタルデータとして入力し、元データ格納部10に格納する作業を行うことになる。   The original data storage unit 10 is a component that inputs the sample values of n samples as digital data and stores them. In the case of the embodiment shown here, the original data storage unit 10 is constituted by a hard disk device for a computer. The operator inputs the sample values S1, S2, S3,..., Sn of the n samples as digital data in a file format having a predetermined data format, and stores it in the original data storage unit 10. Will do.

なお、元データ格納部10に格納されるデータには、各サンプルの標本値とともに、必要に応じて、データ識別コードを含ませておく。たとえば、量子化処理の対象となる母集団のデータが、地球上の多数の地点における何らかの物理量の測定値であるような場合、通常、個々のサンプルがどの地点の測定値であるのかを特定する情報が必要になる。このような場合、元データ格納部10には、たとえば、図7(a) に示すようなデジタルデータが入力される。図7(a) の右欄に示すデータS1,S2,S3,...,Snは、各サンプルの標本値、すなわち、上例の場合は、個々の地点の測定値であり、左欄に示すデータD1,D2,D3,...,Dnは、データ識別コード、すなわち、個々の地点を特定するための緯度経度などのデータである。したがって、この図7(a) に示す情報は、全n個の地点のうち、第i番目の地点(緯度経度Diで特定される地点)の測定値がSiであることを示す情報になる。   The data stored in the original data storage unit 10 includes a data identification code as necessary together with the sample value of each sample. For example, if the population data to be quantized is a measurement of some physical quantity at a number of locations on the earth, it usually identifies which point the individual sample is at. Information is needed. In such a case, for example, digital data as shown in FIG. 7A is input to the original data storage unit 10. The data S1, S2, S3,..., Sn shown in the right column of FIG. 7 (a) are sample values of each sample, that is, in the above example, measured values at individual points. The indicated data D1, D2, D3,..., Dn are data identification codes, that is, data such as latitude and longitude for specifying individual points. Accordingly, the information shown in FIG. 7A is information indicating that the measured value of the i-th point (the point specified by the latitude and longitude Di) is Si among all n points.

一方、ソート作業部20は、ソート処理部30によって行われるソート処理の作業場所として利用される構成要素であり、n個の標本値を並べ替えのために一時的に保持する機能を有する。ここに示す実施形態の場合、コンピュータ用のメモリ(RAM)によってソート作業部20が構成されている。   On the other hand, the sort work unit 20 is a component used as a work place for the sort processing performed by the sort processing unit 30 and has a function of temporarily holding n sample values for sorting. In the case of the embodiment shown here, the sort working unit 20 is configured by a computer memory (RAM).

ソート処理部30は、元データ格納部10に格納されているn個の標本値を複製して、ソート作業部20に保持させ、これを大きさの順に並べ替える処理を行う構成要素であり、実際には、コンピュータのCPUに所定のソートルーチンを実行させることにより実現される。   The sort processing unit 30 is a component that performs a process of copying n sample values stored in the original data storage unit 10 and holding them in the sort operation unit 20 and rearranging them in order of size, Actually, it is realized by causing a CPU of a computer to execute a predetermined sort routine.

たとえば、元データ格納部10内に、図7(a) に示すようなデータが格納されていた場合、ソート処理部30は、まず、これらのデータのうちの標本値S1,S2,S3,...,Snをソート作業部20へ複製する。図7(b) は、こうしてソート作業部20へ複製された標本値S1,S2,S3,...,Snを示している。なお、ソート作業には、データ識別コードは不要であるため、ソート作業部20へデータ識別コードを複製する必要はない。   For example, when data as shown in FIG. 7 (a) is stored in the original data storage unit 10, the sort processing unit 30 first selects the sample values S1, S2, S3,. .., Sn are copied to the sort working unit 20. FIG. 7B shows the sample values S1, S2, S3,..., Sn thus copied to the sort operation unit 20. Note that the data identification code is not necessary for the sort operation, and therefore it is not necessary to duplicate the data identification code to the sort operation unit 20.

ここに示す実施形態の場合、ソート作業部20はメモリであり、各標本値は固定長データとしてこのメモリの連続したアドレス空間内に格納される。したがって、このアドレス空間内に格納されている第i番目の標本値の格納場所を示すアドレス値は、単純な演算により求めることができる。   In the embodiment shown here, the sort operation unit 20 is a memory, and each sample value is stored as fixed-length data in a continuous address space of this memory. Therefore, the address value indicating the storage location of the i-th sample value stored in this address space can be obtained by a simple calculation.

このように、メモリ上の連続アドレス空間内に格納されている固定長データを、その大きさの順に並べ替える処理(ソート処理)は、様々な方法が知られている。たとえば、バブルソートと呼ばれている方法で、データを小さい順に並べ替えるのであれば、第i番目のデータと第(i+1)番目のデータとを比較し、前者≦後者であればそのまま、前者>後者であれば両者を入れ替える、というステップを、i=1〜(n−1)まで順次実行するという手順を、データの入れ替えが生じなくなるまで繰り返す処理を行えばよい。この他にもデータのソート処理のアルゴリズムは様々なものが公知であり、ここでは詳細な説明は省略する。   As described above, various methods are known for processing (sorting) the fixed-length data stored in the continuous address space on the memory in the order of the size. For example, if the data is to be rearranged in a method called bubble sort, the i-th data is compared with the (i + 1) -th data, and if the former ≦ the latter, the former> In the latter case, a process of sequentially executing the steps of exchanging both from i = 1 to (n−1) may be repeated until no data exchange occurs. There are various other data sorting algorithms known in the art, and a detailed description thereof is omitted here.

条件設定部60は、予めもしくはオペレータの指示に基づき、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する構成要素である。m,Cの値を固定して利用する場合には、たとえば、m=256、C=90%(0.9)といった固定値をプログラムで予め設定しておけばよい。この場合、量子化処理は、常に段階数m=256、パラメータ値C=90%という条件で実行される。ただ、実用上は、母集団の性質や、量子化後のデータの利用形態などに応じて、段階数mおよびパラメータ値C(0<C<1)をオペレータの指示に基づいて任意に設定できるようにしておくのが好ましい。その場合は、ディスプレイ画面上に何らかの入力画面を提示するようにし、オペレータが所望の値を入力して設定できるようにしておけばよい。   The condition setting unit 60 is a component that sets the step number m (m is a natural number of 2 or more) and the parameter value C (0 <C <1) in advance or based on an operator's instruction. When the values of m and C are fixed and used, for example, fixed values such as m = 256 and C = 90% (0.9) may be set in advance by a program. In this case, the quantization process is always executed under the condition that the number of steps m = 256 and the parameter value C = 90%. However, in practice, the number of steps m and the parameter value C (0 <C <1) can be arbitrarily set based on the operator's instruction in accordance with the characteristics of the population, the use form of the data after quantization, and the like. It is preferable to do so. In that case, an input screen may be presented on the display screen so that the operator can input and set a desired value.

上下限決定部50は、ソート処理部30による並べ替え処理が完了した後、ソート作業部20に大きさの順に並べられているn個の標本値に基づいて、小さい方から第((n×(1−C))/2+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))/2)番目の標本値の値を上限値SHと決定する処理を行う。ここで、nの値は、ソート作業部20に格納されている標本値の総数であり、Cの値は、条件設定部60に設定されているパラメータ値Cの値である。こうして決定された下限値SLおよび上限値SHのもつ意味は、既に述べたとおりである。   After the rearrangement process by the sort processing unit 30 is completed, the upper and lower limit determination unit 50 starts from the smallest ((n × n) based on the n sample values arranged in the sort operation unit 20 in order of size. The value of the (1-C)) / 2 + 1) th sample value is determined as the lower limit value SL, and the value of the (n− (n × (1-C)) / 2) th sample value from the smaller one is the upper limit. Processing to determine the value SH is performed. Here, the value of n is the total number of sample values stored in the sort operation unit 20, and the value of C is the value of the parameter value C set in the condition setting unit 60. The meanings of the lower limit value SL and the upper limit value SH thus determined are as described above.

図7(c) は、ソート処理部30による並べ替え処理が完了した後、ソート作業部20に大きさの順(この例では小さい順)に並べられているn個の標本値を示す図である。図示のとおり、メモリの連続したアドレス空間の第1番目には、標本値の最小値Sminが格納され、第n番目には、標本値の最大値Smaxが格納されている。下限値SLは、小さい方から第((n×(1−C))/2+1)番目の標本値の値として決定されるので、該当番目の標本値が格納されているアドレスを計算によって求め、当該アドレス場所に格納されている標本値を読み出すことにより、下限値SLの値を認識することができる。同様に、上限値SHは、小さい方から第(n−(n×(1−C))/2)番目の標本値の値として決定されるので、該当番目の標本値が格納されているアドレスを計算によって求め、当該アドレス場所に格納されている標本値を読み出すことにより、上限値SHの値を認識することができる。この図7(c) に示した下方除外範囲a,量子化対象範囲b,上方除外範囲cは、図3および図4に示すヒストグラムにおける各範囲に相当する。   FIG. 7 (c) is a diagram showing n sample values arranged in the order of size (in this example, in ascending order) after the sorting process by the sort processing unit 30 is completed. is there. As shown in the figure, the minimum value Smin of the sample values is stored in the first in the continuous address space of the memory, and the maximum value Smax of the sample values is stored in the nth. Since the lower limit value SL is determined as the value of the ((n × (1-C)) / 2 + 1) th sample value from the smaller one, the address where the corresponding sample value is stored is obtained by calculation, By reading the sample value stored at the address location, the value of the lower limit SL can be recognized. Similarly, since the upper limit value SH is determined as the value of the (n− (n × (1-C)) / 2) th sample value from the smallest value, the address at which the corresponding sample value is stored. Is obtained by calculation and the value of the upper limit SH can be recognized by reading the sample value stored at the address location. The lower exclusion range a, the quantization target range b, and the upper exclusion range c shown in FIG. 7C correspond to the respective ranges in the histograms shown in FIGS.

こうして、上下限決定部50によって決定された下限値SLおよび上限値SHは、量子化処理部40に与えられる。量子化処理部40は、下限値SL〜上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、元データ格納部10に格納されているn個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける処理を行う。具体的には、標本値Sをもったサンプルに対して、((S−SL)/(SH−SL))×(m−1)なる演算値を整数値に丸めることにより求まる「0〜(m−1)の範囲内の整数で示される量子化値」を対応づける処理が行われる。ここで、mは、条件設定部60に設定されている段階数mの値である。   Thus, the lower limit value SL and the upper limit value SH determined by the upper / lower limit determination unit 50 are given to the quantization processing unit 40. The quantization processing unit 40 divides a numerical range from the lower limit value SL to the upper limit value SH into m stages, determines a predetermined quantization value for each stage, and stores n pieces of data stored in the original data storage unit 10. For each sample, a process of associating the quantized value at the stage to which the sample value belongs is performed. Specifically, for a sample having the sample value S, “0 (-(S−SL) / (SH−SL)) × (m−1)” is obtained by rounding the calculated value to an integer value. The process of associating “quantized values indicated by integers within the range of m−1)” is performed. Here, m is the value of the number of steps m set in the condition setting unit 60.

既に述べたとおり、この量子化処理では、n個のサンプルのうち、下限値SL未満の標本値を有するサンプル(標本値が図7(c) の下方除外範囲a内に入るサンプル)については、下限値SLが所属する段階の量子化値を対応づけ、上限値SHを越える標本値を有するサンプル(標本値が図7(c) の上方除外範囲c内に入るサンプル)については、上限値SHが所属する段階の量子化値を対応づける処理が行われる。   As already described, in this quantization process, among samples of n samples, samples having a sample value less than the lower limit SL (samples whose sample value falls within the lower exclusion range a in FIG. 7C) For a sample having a sample value that exceeds the upper limit value SH (a sample that falls within the upper exclusion range c in FIG. 7C), associates the quantized value at the stage to which the lower limit value SL belongs, and the upper limit value SH. The process of associating the quantized value at the stage to which the

こうして、各サンプルに対してそれぞれ所定の量子化値が対応づけられたら、量子化処理部40は、n個のサンプルについて、それぞれ対応づけられた量子化値をデジタルデータとして量子化データ格納部70に格納する。図7(d) は、こうして量子化データ格納部70に格納されたデータ例を示す。ここに示す例では、元データ格納部10には、図7(a) に示すように、データ識別コードと標本値とがそれぞれ対になって格納されているので、量子化データ格納部70には、図7(d) に示すように、データ識別コードと量子化値とを対にして格納している。   In this way, when a predetermined quantized value is associated with each sample, the quantization processing unit 40 uses the quantized value associated with each of the n samples as the digital data as the quantized data storage unit 70. To store. FIG. 7D shows an example of data stored in the quantized data storage unit 70 in this way. In the example shown here, since the data identification code and the sample value are stored in pairs in the original data storage unit 10 as shown in FIG. As shown in FIG. 7D, the data identification code and the quantized value are stored in pairs.

別言すれば、量子化処理部40は、元データ格納部10内に格納されている図7(a) に示すようなデータ(元データ)に対して、標本値Sを量子化値Qに置換する処理を行い、その結果として得られる図7(d) に示すようなデータ(量子化データ)を量子化データ格納部70に格納する処理を行う。すなわち、第i番目のサンプルのデータ識別コードDiで特定される標本値Siは、量子化値Qiに置換されることになり、量子化データ格納部70内では、この量子化値Qiが第i番目のサンプルに対応する記憶場所(データ識別コードDiと対になる場所)に格納されることになる。図7(d) に示す量子化値Q1〜Qnは、こうして置換された合計n個の量子化値である。   In other words, the quantization processing unit 40 converts the sample value S into the quantization value Q for the data (original data) shown in FIG. 7A stored in the original data storage unit 10. The replacement process is performed, and the data (quantized data) as shown in FIG. 7D obtained as a result is stored in the quantized data storage unit 70. That is, the sample value Si specified by the data identification code Di of the i-th sample is replaced with the quantized value Qi. In the quantized data storage unit 70, the quantized value Qi is the i-th sample. The data is stored in the storage location corresponding to the second sample (location corresponding to the data identification code Di). The quantized values Q1 to Qn shown in FIG. 7 (d) are a total of n quantized values thus replaced.

なお、ここでは、各サンプルにデータ識別コードD1〜Dnを付加して取り扱う例を述べたが、データ識別コードD1〜Dnは必ずしも必要なものではない。たとえば、上例のように、量子化処理の対象となる母集団のデータが、地球上の多数の地点における何らかの物理量の測定値であるような場合、通常は、個々のサンプルがどの地点の測定値であるのかを特定する情報が必要になるので、量子化処理後も、図7(d) に示す例のように、データ識別コードと量子化値とを対応づけておくのが好ましい。しかしながら、用途によっては、データ識別コードが不要な場合もある。   Here, an example has been described in which data identification codes D1 to Dn are added to each sample for handling, but the data identification codes D1 to Dn are not necessarily required. For example, as in the above example, when the population data to be quantized is a measurement of some physical quantity at many points on the earth, it is usually the measurement at which point each sample is measured. Since information specifying whether the value is a value is required, it is preferable to associate the data identification code with the quantized value after the quantization process as in the example shown in FIG. However, depending on the application, a data identification code may not be necessary.

たとえば、各地点における物理量の測定値を単に統計処理するだけの用途であれば、個々の測定値がどの地点の測定値であるかを特定する必要はない。このような場合は、元データ格納部10には、標本値S1,S2,S3,...,Snだけを格納するようにし、量子化データ格納部70には、量子化値Q1,Q2,Q3,...,Qnだけを格納するようにすれば足りる。   For example, if it is an application in which the measured value of the physical quantity at each point is simply statistically processed, it is not necessary to specify which point the individual measured value is. In such a case, only the sample values S1, S2, S3,..., Sn are stored in the original data storage unit 10, and the quantized values Q1, Q2, and the like are stored in the quantized data storage unit 70. It is sufficient to store only Q3, ..., Qn.

また、画像データのように、個々のサンプルの配列位置によって、当該サンプルが特定されるようなデータの場合も、データ識別コードは不要である。たとえば、スキャナやデジタルカメラなどで得られた画素データについて量子化する場合を考えてみよう。一般的なデジタルカメラでは、いわゆるRAWデータと呼ばれる撮像時の生のデータを変換して、表示用画像データを得ることになる。たとえば、RAWデータとして得られた12ビットのデータを8ビットのデータに変換して表示用画像データを得る場合、4096段階の細かな情報をもった標本値(12ビットのデータ)を256段階に量子化する必要がある。   Further, in the case of data such as image data in which the sample is specified by the arrangement position of each sample, the data identification code is not necessary. For example, consider the case of quantizing pixel data obtained with a scanner or digital camera. A general digital camera converts display raw data called RAW data to obtain display image data. For example, when 12-bit data obtained as RAW data is converted into 8-bit data to obtain display image data, sample values (12-bit data) having detailed information in 4096 levels are converted into 256 levels. It needs to be quantized.

あるいは、いわゆるheight fieldと呼ばれる凹凸形状を示すための二次元画像データを作成する際にも、量子化が行われる。たとえば、動物の皮膚や植物の表面などの細かな凹凸形状を二次元画像として表現する場合、凹凸情報を示す奥行き方向(深さ方向)の寸法測定値をそれぞれの画素値とする二次元画像が作成される。この場合、寸法測定値を量子化して二次元画像データを作成する必要がある。   Alternatively, the quantization is also performed when creating two-dimensional image data for showing an uneven shape called a so-called height field. For example, when a fine uneven shape such as an animal skin or a plant surface is expressed as a two-dimensional image, a two-dimensional image having dimension measurement values in the depth direction (depth direction) indicating unevenness information as respective pixel values is obtained. Created. In this case, it is necessary to produce two-dimensional image data by quantizing the dimension measurement value.

このような二次元画像に対する量子化を行う場合、元データ格納部10には、たとえば、図8(a) に示すような二次元画素配列からなるデータが入力されることになる。個々の画素には、それぞれ所定の画素値が定義されている。本発明では、これら個々の画素がサンプルということになり、個々の画素値が標本値ということになる。図8(a) に示す例において、S1,S2,S3,...,Snは各画素の画素値(すなわち、標本値)を示している。上例のRAWデータ画像の場合、各画素値は12ビットで表現される標本値によって構成され、上例のheight field画像の場合、各画素値は奥行き方向の寸法測定値によって構成される。   When such a two-dimensional image is quantized, for example, data composed of a two-dimensional pixel array as shown in FIG. 8A is input to the original data storage unit 10. A predetermined pixel value is defined for each pixel. In the present invention, these individual pixels are samples, and the individual pixel values are sample values. In the example shown in FIG. 8A, S1, S2, S3,..., Sn indicate pixel values (that is, sample values) of the respective pixels. In the case of the RAW data image in the above example, each pixel value is constituted by a sample value expressed by 12 bits, and in the case of the height field image in the above example, each pixel value is constituted by a dimension measurement value in the depth direction.

このような画像データの場合、個々のサンプルは、その配列位置によって特定することができるので、個々のサンプルを特定するためのデータ識別コードは不要である。したがって、元データ格納部10には、図8(a) に示すような標本値の二次元配列からなるデータを入力すればよい。また、ソート作業部20上では、図8(b) に示すように、この二次元配列からなる標本値を概念的に一次元に並べた状態として、大きさの順にソートすればよい。図8(c) は、こうしてソートされたn個の標本値を示している。このようなソート結果に基づいて、下限値SLおよび上限値SHを決定する方法は、既に述べた方法と全く同様である。図8(d) は、量子化処理部40によって対応づけられた量子化値Q1〜Qnを、量子化データ格納部70に格納した状態を示す図である。図8(a) に示す二次元配列と全く同様の二次元配列の形で、量子化値Q1〜Qnが格納されていることになり、この量子化データ格納部70に格納されたデータは、そのまま量子化後の画像データを構成することになる。要するに、量子化処理部40は、個々のサンプルについて対応づけられた量子化値を、量子化データ格納部70内の個々のサンプルに対応する記憶場所(二次元配列上の対応位置)に格納する処理を行うことになる。   In the case of such image data, since each sample can be specified by its arrangement position, a data identification code for specifying each sample is unnecessary. Therefore, data consisting of a two-dimensional array of sample values as shown in FIG. Further, on the sort operation unit 20, as shown in FIG. 8 (b), the sample values composed of this two-dimensional array may be conceptually arranged in a one-dimensional manner and sorted in order of size. FIG. 8C shows n sample values sorted in this way. The method of determining the lower limit value SL and the upper limit value SH based on such a sort result is exactly the same as the method already described. FIG. 8D is a diagram illustrating a state in which the quantized values Q1 to Qn associated by the quantization processing unit 40 are stored in the quantized data storage unit 70. The quantized values Q1 to Qn are stored in the form of a two-dimensional array that is exactly the same as the two-dimensional array shown in FIG. 8A. The data stored in the quantized data storage unit 70 is The quantized image data is constructed as it is. In short, the quantization processing unit 40 stores the quantization value associated with each sample in a storage location (corresponding position on the two-dimensional array) corresponding to each sample in the quantized data storage unit 70. Processing will be performed.

以上、本発明の基本的実施形態を述べたが、この基本的実施形態では、オペレータは、元データ格納部10に対してn個のサンプルの標本値S1,S2,S3,...,Snをデジタルデータとして入力する作業と、条件設定部60に対して、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する作業を行えばよい。   In the above, the basic embodiment of the present invention has been described. In this basic embodiment, the operator has sample values S1, S2, S3,. Is input as digital data, and the condition setting unit 60 may be configured to set the number of steps m (m is a natural number of 2 or more) and the parameter value C (0 <C <1).

ここで、段階数mは、量子化の段階を示す値であるので、一般的には2の累乗(たとえば、2=256)のような値を設定するのが好ましい。もちろん、段階数mを予め固定しておくのであれば、オペレータによる指定は不要である。また、パラメータ値Cは、全サンプルの何%くらいを量子化対象範囲bに含ませるかを指定する値であるので、たとえば、90%というように、直感的に把握可能な数値として設定することができる。量子化処理に必要な値は、下限値SLおよび上限値SHであるが、これらの値は、ソート結果とパラメータ値Cとに基づいて、上下限決定部50によって自動的に計算されるため、オペレータは直接的には意識する必要はない。このように、パラメータ値Cという直感的に把握可能な数値指定により、自動的に下限値SLおよび上限値SHの決定が行われる点が、本発明の大きな特徴である。もちろん、パラメータ値Cを予め固定しておくのであれば、オペレータによる指定は不要である。 Here, since the stage number m is a value indicating the stage of quantization, it is generally preferable to set a value such as a power of 2 (for example, 2 8 = 256). Of course, if the number of steps m is fixed in advance, designation by the operator is unnecessary. The parameter value C is a value that specifies what percentage of all the samples is included in the quantization target range b. For example, the parameter value C should be set as an intuitively graspable value such as 90%. Can do. The values necessary for the quantization processing are the lower limit value SL and the upper limit value SH, but these values are automatically calculated by the upper and lower limit determination unit 50 based on the sorting result and the parameter value C. The operator does not need to be aware of it directly. As described above, the major feature of the present invention is that the lower limit value SL and the upper limit value SH are automatically determined by the numerical designation of the parameter value C that can be intuitively grasped. Of course, if the parameter value C is fixed in advance, designation by the operator is unnecessary.

<<< §4.上下限決定方法の変形例 >>>
ここでは、これまでに述べた基本的実施形態における下限値SLおよび上限値SHの決定方法を若干変更した変形例を述べる。§3で説明したように、図5のステップS4では、大きさ順にソートされた後の標本値について、小さい方から第((n×(1−C))/2+1)番目の値を下限値SLとし、小さい方から第(n−(n×(1−C))/2)番目の値を上限値SHとする処理が行われた。このような方法で下限値SLおよび上限値SHを決定すると、全n個の標本値のうち、割合Cの標本値が量子化対象範囲bに属し、残りの割合(1−C)の標本値が下方除外範囲aもしくは上方除外範囲cに属するようになる。ここで、下方除外範囲aに属する標本値の数と上方除外範囲cに属する標本値の数は等しく設定される(厳密に言えば、計算結果が整数番目にならない場合に、まるめる処理を行った場合は、1だけ差が生じる可能性がある)。
<<< §4. Modified example of upper / lower limit determination method >>>
Here, a modified example in which the determination method of the lower limit value SL and the upper limit value SH in the basic embodiment described so far is slightly changed will be described. As described in §3, in step S4 of FIG. 5, the ((n × (1-C)) / 2 + 1) th value from the smaller value is set as the lower limit value for the sample values after sorting in order of magnitude. SL was performed, and the (n− (n × (1−C)) / 2) value from the smallest value was set to the upper limit value SH. When the lower limit SL and the upper limit SH are determined by such a method, among all n sample values, the sample value of the ratio C belongs to the quantization target range b, and the remaining sample value of the ratio (1-C) Belongs to the lower exclusion range a or the upper exclusion range c. Here, the number of sample values belonging to the lower exclusion range “a” and the number of sample values belonging to the upper exclusion range “c” are set to be equal (strictly speaking, the rounding process is performed when the calculation result does not become an integer number). In some cases, there may be a difference of 1).

たとえば、n=10000、パラメータ値C=90%(0.9)の場合、小さい方から第((n×(1−C))/2+1)番目、すなわち、小さい方から501番目の標本値の値が下限値SLとなり、小さい方から第(n−(n×(1−C))/2)番目、すなわち、小さい方から9500番目の標本値の値が上限値SHとなる。したがって、90%に相当する9000個の標本値が量子化対象範囲bに属し、値の小さな500個の標本値が下方除外範囲aに属し、値の大きな500個の標本値が上方除外範囲cに属するように、下限値SLや上限値SHが決定される。   For example, when n = 10000 and the parameter value C = 90% (0.9), the ((n × (1-C)) / 2 + 1) th from the smallest, that is, the 501st sample value from the smallest The value becomes the lower limit SL, and the value of the (n− (n × (1-C)) / 2) th from the smallest, that is, the value of the 9500th sample value from the smallest becomes the upper limit SH. Therefore, 9000 sample values corresponding to 90% belong to the quantization target range b, 500 sample values with small values belong to the lower exclusion range a, and 500 sample values with large values belong to the upper exclusion range c. The lower limit SL and the upper limit SH are determined so as to belong to.

このように、全10000個の標本値のうち、値の小さな500個と値の大きな500個の標本値を除外すれば、一般的には、特異な値をもった標本値を除外した量子化が可能になる。しかしながら、母集団の特性によっては、特異な値をもった標本値は、その他の標本値よりも大きな値をとる傾向がある場合や、逆に小さな値をとる傾向がある場合も少なくない。   As described above, if 500 sample values having a small value and 500 samples having a large value are excluded from all 10000 sample values, in general, quantization is performed by excluding sample values having unique values. Is possible. However, depending on the characteristics of the population, a sample value having a unique value tends to take a larger value than other sample values, and conversely, tends to take a small value.

たとえば、CCD撮像装置などでは、受光量に応じた電荷を蓄積する受光素子が多数配列されることになるが、何らかの原因で電荷がリークすると、蓄積電荷量は0に落ちてしまう。このような場合、蓄積電荷量に比例した標本値を用いることにすると、電荷リークが生じた受光素子の標本値は、通常の受光素子の標本値に比べて小さくなる。このような場合、電荷リークが生じた受光素子の標本値を除外するという観点では、下方除外範囲aに属する標本値の数を上方除外範囲cに属する標本値の数よりも大きく設定した方が理にかなっている。もちろん、逆に、ノイズが発生すると電圧値が飽和するような測定系の場合は、ノイズの影響を受けた標本値は、通常の標本値に比べて大きくなる。このような場合、ノイズの影響を受けた標本値を除外するという観点では、上方除外範囲cに属する標本値の数を下方除外範囲aに属する標本値の数よりも大きく設定した方が理にかなっている。   For example, in a CCD imaging device or the like, a large number of light receiving elements for accumulating charges according to the amount of received light are arranged. However, if the charge leaks for some reason, the amount of accumulated charge falls to zero. In such a case, if a sample value proportional to the amount of accumulated charge is used, the sample value of the light receiving element in which charge leakage has occurred becomes smaller than the sample value of a normal light receiving element. In such a case, from the viewpoint of excluding the sample values of the light receiving element in which the charge leak has occurred, it is better to set the number of sample values belonging to the lower exclusion range a larger than the number of sample values belonging to the upper exclusion range c. It stands to reason. Of course, in the case of a measurement system in which the voltage value is saturated when noise occurs, the sample value affected by the noise is larger than the normal sample value. In such a case, from the viewpoint of excluding sample values affected by noise, it is more reasonable to set the number of sample values belonging to the upper exclusion range c larger than the number of sample values belonging to the lower exclusion range a. It is correct.

このように、母集団の特性によって、下方除外範囲aに属する標本値の数と上方除外範囲cに属する標本値の数とのバランスを調整することができれば便利である。ここで述べる変形例は、このような調整機能を付加するものである。   Thus, it is convenient if the balance between the number of sample values belonging to the lower exclusion range a and the number of sample values belonging to the upper exclusion range c can be adjusted according to the characteristics of the population. The modification described here adds such an adjustment function.

具体的には、図5の条件設定ステップS2において、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)とともに、バランス値P(0≦P≦1)を設定するようにする。すなわち、図6の条件設定部60には、予めもしくはオペレータの指示に基づき、段階数m、パラメータ値C、バランス値Pという3つの数値を設定する機能を設けておく。ここで、バランス値Pは、下方除外範囲aに属する標本値の数と下方除外範囲cに属する標本値の数とのバランスを調整するためのファクターであり、バランス値Pが大きいほど、下方除外範囲aに属する標本値の数の方が上方除外範囲cに属する標本値の数よりも多くなる。P=0の場合、上方除外範囲aに属する標本値の数は0になり、P=1の場合、下方除外範囲cに属する標本値の数は0になる。   Specifically, in the condition setting step S2 of FIG. 5, the balance value P (0 ≦ P ≦ 1) is set together with the step number m (m is a natural number of 2 or more) and the parameter value C (0 <C <1). To do. That is, the condition setting unit 60 of FIG. 6 is provided with a function for setting three numerical values, that is, the number m of steps, the parameter value C, and the balance value P in advance or based on an operator instruction. Here, the balance value P is a factor for adjusting the balance between the number of sample values belonging to the lower exclusion range “a” and the number of sample values belonging to the lower exclusion range “c”. The number of sample values belonging to the range a is larger than the number of sample values belonging to the upper exclusion range c. When P = 0, the number of sample values belonging to the upper exclusion range a is 0, and when P = 1, the number of sample values belonging to the lower exclusion range c is 0.

そして、上下限決定ステップS4の処理(上下限決定部50で行われる処理)では、ソートステップS3によって大きさの順に並べ替えられたソート作業部20内のn個の標本値に基づいて、小さい方から第((n×(1−C))×P+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))×(1−P))番目の標本値の値を上限値SHと決定する処理を行うようにする。数式内にバランス値Pが組み込まれている点が、§3で述べた基本的実施形態と異なる点である。   In the process of the upper / lower limit determination step S4 (the process performed by the upper / lower limit determination unit 50), the value is small based on the n sample values in the sort operation unit 20 rearranged in order of size by the sort step S3. The value of the ((n × (1-C)) × P + 1) th sample value from the direction is determined as the lower limit value SL, and the (n− (n × (1-C)) × (1− P)) A process of determining the value of the first sample value as the upper limit SH is performed. The point that the balance value P is incorporated in the mathematical formula is different from the basic embodiment described in §3.

たとえば、n=10000、パラメータ値C=90%(0.9)、P=0.3の場合、小さい方から第((n×(1−C))×P+1)番目、すなわち、小さい方から301番目の標本値の値が下限値SLとなり、小さい方から第(n−(n×(1−C))×(1−P))番目、すなわち、小さい方から9300番目の標本値の値が上限値SHとなる。したがって、90%に相当する9000個の標本値が量子化対象範囲bに属する点は、§3で述べた基本的実施形態の場合と同じであるが、値の小さな300個の標本値が下方除外範囲aに属し、値の大きな700個の標本値が上方除外範囲cに属するように、下限値SLや上限値SHが決定される。   For example, when n = 10000, parameter value C = 90% (0.9), and P = 0.3, the ((n × (1-C)) × P + 1) th from the smallest, that is, from the smallest The value of the 301st sample value becomes the lower limit value SL, and the value of the 9300th sample value from the smaller one is (n− (n × (1-C)) × (1-P)) th, that is, the smaller one. Becomes the upper limit SH. Therefore, the point that 9000 sample values corresponding to 90% belong to the quantization target range b is the same as in the basic embodiment described in §3, but 300 sample values having small values are lower. The lower limit value SL and the upper limit value SH are determined so that 700 sample values belonging to the exclusion range a and having a large value belong to the upper exclusion range c.

もし、P=0に設定した場合、下方除外範囲aに属する標本数は0になり、値の大きな1000個の標本値が上方除外範囲cに属することになる。逆に、P=1に設定した場合、上方除外範囲cに属する標本数は0になり、値の小さな1000個の標本値が下方除外範囲aに属することになる。§3で述べた基本的実施形態は、上記式において、P=0.5に設定した特別なケースと言うことができる。   If P = 0 is set, the number of samples belonging to the lower exclusion range a is 0, and 1000 sample values having a large value belong to the upper exclusion range c. On the contrary, when P = 1 is set, the number of samples belonging to the upper exclusion range c is 0, and 1000 sample values having a small value belong to the lower exclusion range a. The basic embodiment described in §3 can be said to be a special case where P = 0.5 in the above formula.

<<< §5.本発明の実用的実施形態 >>>
これまで述べた実施形態では、図5のソートステップS3において、n個の標本値を大きさ順に並べ替える処理を必須のプロセスとしており、図6に示す装置構成においても、ソート作業部20およびソート処理部30が必須の構成要素となっている。前述したとおり、このようなソート処理を行う方法としては、既にいくつものアルゴリズムが知られており、理論的には、コンピュータ内部でこのようなソート処理を実行することに困難な点はない。
<<< §5. Practical embodiment of the present invention >>>
In the embodiment described so far, in the sorting step S3 in FIG. 5, the process of rearranging n sample values in order of size is an essential process. In the apparatus configuration shown in FIG. The processing unit 30 is an essential component. As described above, a number of algorithms are already known as methods for performing such sort processing. Theoretically, there is no difficulty in executing such sort processing inside a computer.

しかしながら、このソート処理は、対象となるデータの総数nが増えれば増えるほど、処理負担が指数関数的に増加する処理であり、かなり演算時間を要する処理になる。もちろん、処理能力の高い大型コンピュータであれば、データ総数nが増加しても比較的短い演算時間でソート処理を行うことが可能かもしれないが、汎用のパソコンを用いて本発明に係る量子化装置を構成したり、デジタルカメラに内蔵するための専用半導体チップによって本発明に係る量子化装置を構成したりする場合、それほど高速なソート処理は期待できない。このような場合、ソート処理を行うと、実用的な処理時間内に量子化を完了することが困難になる可能性がある。   However, this sort process is a process in which the processing load increases exponentially as the total number n of the target data increases, and the process requires much calculation time. Of course, a large computer with high processing capability may be able to perform sort processing in a relatively short calculation time even if the total number n of data increases, but the quantization according to the present invention can be performed using a general-purpose personal computer. When the apparatus is configured, or when the quantization apparatus according to the present invention is configured by a dedicated semiconductor chip to be incorporated in a digital camera, it is not possible to expect sort processing that is so fast. In such a case, if the sort process is performed, it may be difficult to complete quantization within a practical processing time.

そこで、ここでは、十分なソート処理能力をもたない装置を用いても、実用上、十分な処理時間内に量子化を完了することが可能になる実施形態を述べる。図9は、このような実用的実施形態に係る量子化処理方法の手順を示す流れ図である。図5に示す基本的実施形態の手順との相違は、ソートステップS3の代わりに平均・標準偏差演算ステップS3Aを行う点と、上下限決定ステップS4の代わりに上下限決定ステップS4A(ステップの名称は同じ)を行う点のみである。以下、この相違点のみについて説明する。   Thus, here, an embodiment will be described in which quantization can be completed within a practically sufficient processing time even if an apparatus that does not have sufficient sort processing capability is used. FIG. 9 is a flowchart showing the procedure of the quantization processing method according to such a practical embodiment. The difference from the procedure of the basic embodiment shown in FIG. 5 is that average / standard deviation calculation step S3A is performed instead of sort step S3, and upper / lower limit determination step S4A (name of step) instead of upper / lower limit determination step S4. Is the same). Only this difference will be described below.

まず、平均・標準偏差演算ステップS3Aでは、入力ステップS1で入力されて記憶場所に格納されているn個の標本値について、平均値Mと標準偏差σとを演算する処理が実行される。具体的には、n個の標本値S1,S2,S3,...,Snについての平均値Mと標準偏差σは、
M=Σi=1〜nSi/n
σ=√((Σi=1〜n(Si−M))/n)
なる式で演算される。
First, in the average / standard deviation calculation step S3A, a process of calculating the average value M and the standard deviation σ is executed for the n sample values input in the input step S1 and stored in the storage location. Specifically, the average value M and the standard deviation σ for n sample values S1, S2, S3,.
M = Σ i = 1 to n Si / n
σ = √ ((Σ i = 1 to n (Si-M) 2 ) / n)
Is calculated by the following formula.

一方、上下限決定ステップS4Aは、下限値SLと上限値SHを決定する処理を行うステップである点は、図5に示す基本的実施形態における上下限決定ステップS4と同様であるが、その決定プロセスが異なっている。基本的実施形態では、ソートステップS3によるソート結果を利用して、パラメータ値Cに応じた下限値SL,上限値SHの決定が行われているが、ここで述べる実用的実施形態は、演算負担がかかるソートステップを省略することを目的とするものであるから、ソート結果を利用することはできない。その代わりに、平均・標準偏差演算ステップS3Aで求めた平均値Mと標準偏差σとを利用して、パラメータ値Cに応じた下限値SL,上限値SHの決定が行われる。   On the other hand, the upper and lower limit determination step S4A is the same as the upper and lower limit determination step S4 in the basic embodiment shown in FIG. 5 in that the lower limit value SL and the upper limit value SH are processed. The process is different. In the basic embodiment, the lower limit value SL and the upper limit value SH corresponding to the parameter value C are determined using the sorting result in the sorting step S3. However, the practical embodiment described here is an operation burden. Since the purpose is to omit such a sorting step, the sorting result cannot be used. Instead, the lower limit SL and the upper limit SH corresponding to the parameter value C are determined using the average value M and the standard deviation σ obtained in the average / standard deviation calculation step S3A.

この上下限決定ステップS4Aで行われる下限値SL,上限値SHの決定手法の原理を説明するために、まず、統計上の正規分布の特徴を図10のグラフを参照しながら説明しておく。図10のグラフは、横軸に標本値、縦軸にその出現頻度をとったヒストグラムであり、統計学上、最も一般的な正規分布の場合、図示のように、左右対称のなだらかな山型分布になる。そして、グラフの左右の中心位置が、全標本値の平均値Mになり、標準偏差をσとした場合、(M−σ)〜(M+σ)の範囲の標本値をもつサンプルは、全体の約68.26%、(M−2σ)〜(M+2σ)の範囲の標本値をもつサンプルは、全体の約95.44%になる。   In order to explain the principle of the determination method of the lower limit value SL and the upper limit value SH performed in the upper and lower limit determination step S4A, first, the characteristics of the statistical normal distribution will be described with reference to the graph of FIG. The graph of FIG. 10 is a histogram with the sample value on the horizontal axis and the frequency of appearance on the vertical axis. In the case of the most common normal distribution in terms of statistics, as shown in the figure, a symmetric gentle mountain shape is shown. Distribution. When the center position on the left and right of the graph is the average value M of all the sample values, and the standard deviation is σ, samples having sample values in the range of (M−σ) to (M + σ) Samples with sample values in the range of 68.26% (M-2σ) to (M + 2σ) account for about 95.44% of the total.

一般に、標本値Sと平均値Mとの差Δを標準偏差σで割った値z=Δ/σは、標準化スコア(もしくは、z−スコア)と呼ばれており、図10に示すヒストグラムにおける横軸上の位置を示すパラメータとして用いられている。たとえば、標準化スコアz=1は、平均値Mとの差Δが標準偏差σの1倍に等しい位置、すなわち、図10における(M−σ)の位置および(M+σ)の位置を示す。また、標準化スコアz=2は、平均値Mとの差Δが標準偏差σの2倍に等しい位置、すなわち、図10における(M−2σ)の位置および(M+2σ)の位置を示す。   In general, a value z = Δ / σ obtained by dividing the difference Δ between the sample value S and the average value M by the standard deviation σ is called a standardized score (or z-score), and is a horizontal value in the histogram shown in FIG. It is used as a parameter indicating the position on the axis. For example, the standardized score z = 1 indicates a position where the difference Δ from the average value M is equal to one time the standard deviation σ, that is, the position of (M−σ) and the position of (M + σ) in FIG. The standardized score z = 2 indicates a position where the difference Δ from the average value M is equal to twice the standard deviation σ, that is, the position of (M−2σ) and the position of (M + 2σ) in FIG.

そこで、いま、任意の標準化スコアzの値について、(M−zσ)〜(M+zσ)の範囲を設定し、この範囲内に標本値が入るサンプル数の全サンプル数に対する割合を累積分布関数値f(z)と定義する。すると、この累積分布関数値f(z)は、図10にハッチングを施して示す領域内のサンプル数の全サンプル数に対する割合、別言すれば、この山型ヒストグラムの全面積に対するハッチング部分の面積の割合を示すことになる。正規分布の場合、上述したとおり、z=1に対する累積分布関数値f(1)=約68.26%、z=2に対する累積分布関数値f(2)=約95.44%である。   Therefore, a range of (M−zσ) to (M + zσ) is set for an arbitrary standardized score z value, and the ratio of the number of samples that fall within this range to the total number of samples is the cumulative distribution function value f. (Z) is defined. Then, this cumulative distribution function value f (z) is the ratio of the number of samples in the hatched area shown in FIG. 10 to the total number of samples, in other words, the area of the hatched portion with respect to the total area of the mountain histogram. Will be shown. In the case of the normal distribution, as described above, the cumulative distribution function value f (1) for z = 1 = approximately 68.26%, and the cumulative distribution function value f (2) for z = 2 = approximately 95.44%.

このように、累積分布関数値f(z)は、標準化スコアzが定まれば一義的に定まる関数値であり、特に、標本値の分布が正規分布をとる場合には、個々の標準化スコアzの値に対応する累積分布関数値f(z)の値は、図11の計算式による演算で求まることが知られており、また、図12に例示するような標準正規分布表が定数表などに掲載されている。図11の計算式におけるΣの項は、k=0〜無限大までの和になっているが、実用上は、k=0〜所定の有限値までの演算を行えば十分である。   As described above, the cumulative distribution function value f (z) is a function value that is uniquely determined when the standardized score z is determined. In particular, when the distribution of the sample values is a normal distribution, each standardized score z It is known that the value of the cumulative distribution function value f (z) corresponding to the value of is obtained by calculation using the calculation formula of FIG. 11, and the standard normal distribution table illustrated in FIG. 12 is a constant table or the like. It is published in. The term of Σ in the calculation formula of FIG. 11 is a sum from k = 0 to infinity, but in practice it is sufficient to perform an operation from k = 0 to a predetermined finite value.

図12の標準正規分布表は、図11の計算式を用いた演算により作成されたものである。最左列は、標準化スコアzの上位桁(小数第1位までの桁)の値を示しており、最上行は、標準化スコアzの下位桁(小数第2位の桁)の値を示している。なお、この図12の表によって引かれる数値は、M〜(M+zσ)の範囲内に標本値が入るサンプル数(図12の上段に示すヒストグラムのハッチング部分)の全サンプル数に対する割合を示す数値になっており、本発明で定義された累積分布関数値f(z)との関係では、f(z)/2に対応する数値になっている。たとえば、図12の表において、z=1.00に対応する数値は、0.3413となっているので、本発明で定義された累積分布関数値f(1)は、これを2倍した値0.6826になる。同様に、図12の表において、z=2.00に対応する数値は、0.4772となっているので、本発明で定義された累積分布関数値f(2)は、これを2倍した値0.9544になる。   The standard normal distribution table of FIG. 12 is created by calculation using the calculation formula of FIG. The leftmost column indicates the value of the upper digit (digits up to the first decimal place) of the standardized score z, and the uppermost row indicates the value of the lower digit (second digit of the decimal point) of the standardized score z. Yes. The numerical value drawn by the table of FIG. 12 is a numerical value indicating the ratio of the number of samples (the hatched portion of the histogram shown in the upper part of FIG. 12) of the sample value within the range of M to (M + zσ) to the total number of samples. Thus, the relationship with the cumulative distribution function value f (z) defined in the present invention is a numerical value corresponding to f (z) / 2. For example, in the table of FIG. 12, since the numerical value corresponding to z = 1.00 is 0.3413, the cumulative distribution function value f (1) defined in the present invention is a value obtained by doubling this value. 0.6826. Similarly, in the table of FIG. 12, since the numerical value corresponding to z = 2.00 is 0.4772, the cumulative distribution function value f (2) defined in the present invention is doubled. The value is 0.9544.

この図12に示すような標準正規分布表は、標準化スコアzの値から、対応する累積分布関数値f(z)を引くためのテーブルになっているが、この表を組み換えることにより、逆に、累積分布関数値f(z)から、対応する標準化スコアzを引くためのテーブルを用意することができる。図13は、このような機能をもった対応テーブルの一例を示す。この図13に示す対応テーブルの左欄には、累積分布関数値f(z)の値が、0〜1.0まで、0.1刻みで掲載されており、対応する標準化スコアzの値が右欄に掲載されている。もちろん、必要に応じて、より刻みの細かい累積分布関数値f(z)が掲載されたテーブルを用意することも可能である。   The standard normal distribution table as shown in FIG. 12 is a table for subtracting the corresponding cumulative distribution function value f (z) from the value of the standardized score z. In addition, a table for subtracting the corresponding standardized score z from the cumulative distribution function value f (z) can be prepared. FIG. 13 shows an example of a correspondence table having such a function. In the left column of the correspondence table shown in FIG. 13, the cumulative distribution function value f (z) is listed in increments of 0.1 from 0 to 1.0, and the corresponding standardized score z value is displayed. It is listed in the right column. Of course, it is also possible to prepare a table in which the cumulative distribution function value f (z) with finer steps is posted as necessary.

図12に示すような一般的な標準正規分布表(標準化スコアzの値から、対応する累積分布関数値f(z)を引くためのテーブル)に基づいて、図13に示すような対応テーブル(累積分布関数値f(z)から、対応する標準化スコアzを引くためのテーブル)を作成するには、予め、十分な有効桁数をもって算出された標準正規分布表を用意しておき、目的となる累積分布関数値f(z)に最も近似する値に対応する標準化スコアzの値を逆引きすればよい。   Based on a general standard normal distribution table (table for subtracting the corresponding cumulative distribution function value f (z) from the standardized score z value) as shown in FIG. In order to create a table for subtracting the corresponding standardized score z from the cumulative distribution function value f (z), a standard normal distribution table calculated with a sufficient number of significant digits is prepared in advance. The standardized score z corresponding to the value closest to the cumulative distribution function value f (z) is reversed.

さて、ここで、§3で述べた基本的実施形態との関係において、累積分布関数値f(z)の意味するところを考えると、この累積分布関数値f(z)は、図5の条件設定ステップS2で設定したパラメータ値Cに相当する値であることがわかる。本発明におけるパラメータ値C(0<C<1)は、量子化対象範囲bに含まれるサンプル数の全サンプル数nに対する割合を指定するものであり、C=90%に設定すれば、全サンプル数nのうちの90%が量子化対象範囲bに含まれ、残りの10%が下方除外範囲aもしくは上方除外範囲cに含まれるように、下限値SLおよび上限値SHが決定されることになる。   Now, considering the meaning of the cumulative distribution function value f (z) in relation to the basic embodiment described in §3, the cumulative distribution function value f (z) is the condition shown in FIG. It can be seen that the value corresponds to the parameter value C set in the setting step S2. The parameter value C (0 <C <1) in the present invention specifies the ratio of the number of samples included in the quantization target range b to the total number of samples n, and if C = 90%, all samples The lower limit SL and the upper limit SH are determined so that 90% of the number n is included in the quantization target range b and the remaining 10% is included in the lower exclusion range a or the upper exclusion range c. Become.

ここで、もし、母集団の標本値が完全な正規分布をとっており、その平均値Mおよび標準偏差σが算出されていたとすれば、図13の対応テーブルを利用して、任意のパラメータ値Cに応じた下限値SLおよび上限値SHを決定することが可能である。すなわち、図13の対応テーブルを利用して、指定されたパラメータ値Cに等しい累積分布関数値f(z)に対応する標準化スコアzを求め、下限値SL=M−zσ、上限値SH=M+zσとして計算すればよい。完全な正規分布をとる母集団であれば、図10に示すように、(M−zσ)〜(M+zσ)の範囲内に標本値が入るサンプル数の全サンプル数に対する割合は、累積分布関数値f(z)で与えられるので、所望のパラメータ値Cに等しい累積分布関数値f(z)を用いて算出された(M−zσ)〜(M+zσ)の範囲内に標本値が入るサンプル数の全サンプル数に対する割合は、指定されたパラメータ値Cに等しくなる。   Here, if the sample values of the population have a perfectly normal distribution and the average value M and the standard deviation σ are calculated, an arbitrary parameter value can be obtained using the correspondence table of FIG. It is possible to determine the lower limit SL and the upper limit SH according to C. That is, the standardized score z corresponding to the cumulative distribution function value f (z) equal to the designated parameter value C is obtained using the correspondence table of FIG. 13, and the lower limit value SL = M−zσ and the upper limit value SH = M + zσ. Calculate as follows. In the case of a population having a complete normal distribution, as shown in FIG. 10, the ratio of the number of samples having sample values within the range of (M−zσ) to (M + zσ) to the total number of samples is the cumulative distribution function value. Since it is given by f (z), the number of samples whose sample values fall within the range of (M−zσ) to (M + zσ) calculated using the cumulative distribution function value f (z) equal to the desired parameter value C The ratio to the total number of samples is equal to the specified parameter value C.

たとえば、パラメータ値C=90%(0.9)という指定がなされた場合、図13のテーブルを引くことにより、f(z)=0.9に対応する標準化スコアz=1.645が得られる。したがって、上下限決定ステップS4Aでは、ステップS3Aで求めた平均値Mおよび標準偏差σを用いて、下限値SL=M−1.645σ、上限値SH=M+1.645σなる式により、下限値SLおよび上限値SHを求めることができる。   For example, when the parameter value C = 90% (0.9) is designated, the standardized score z = 1.645 corresponding to f (z) = 0.9 is obtained by drawing the table of FIG. . Therefore, in the upper / lower limit determination step S4A, the lower limit value SL and the upper limit value SH = M + 1.645σ are calculated by using the average value M and the standard deviation σ obtained in step S3A, and the upper limit value SH = M + 1.645σ. The upper limit value SH can be obtained.

要するに、ステップS4Aでは、一般的な正規分布において、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)がパラメータ値Cに等しくなる標準化スコアzを求め、平均値Mおよび標準偏差σならびに標準化スコアzを用いて、上限値SH=M+zσおよび下限値SL=M−zσを決定すればよい。具体的には、一般的な正規分布における標準化スコアをzとしたときに、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)と標準化スコアzとの対応関係を示す対応テーブル(図13に示すような対応テーブル)を予めコンピュータ内に用意しておき、この対応テーブルを参照することにより、パラメータ値Cに等しい累積分布関数値f(z)に対応する標準化スコアzを求めるようにすればよい。   In short, in step S4A, in a general normal distribution, the cumulative distribution function value f (z) indicating the proportion of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation”. ) Is equal to the parameter value C, and the upper limit SH = M + zσ and the lower limit SL = M−zσ may be determined using the average value M, the standard deviation σ, and the standardized score z. Specifically, when the standardized score in a general normal distribution is set to z, the ratio of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation” is shown. A correspondence table (correspondence table as shown in FIG. 13) indicating the correspondence between the cumulative distribution function value f (z) and the standardized score z is prepared in advance in the computer, and the parameter is obtained by referring to this correspondence table. A standardized score z corresponding to the cumulative distribution function value f (z) equal to the value C may be obtained.

以上、量子化対象となる母集団の標本値が完全な正規分布をとっていると仮定した場合に、図9のステップS3A,S4Aの処理が、図5のステップS3,S4の処理と等価になることを説明した。すなわち、母集団の標本値が完全な正規分布の場合には、§3で述べたソート処理を行うことなしに、計算によって、パラメータ値Cに等しい累積分布関数値f(z)を得ることができる数値範囲(M−zσ)〜(M+zσ)、すなわち、上限値SHおよび下限値SLを決定することができる。   As described above, when it is assumed that the sample values of the population to be quantized have a complete normal distribution, the processing in steps S3A and S4A in FIG. 9 is equivalent to the processing in steps S3 and S4 in FIG. I explained that. That is, when the sample value of the population is a complete normal distribution, the cumulative distribution function value f (z) equal to the parameter value C can be obtained by calculation without performing the sort process described in §3. The possible numerical range (M−zσ) to (M + zσ), that is, the upper limit value SH and the lower limit value SL can be determined.

ところが、実際に量子化対象として与えられる母集団、すなわち、ステップS1で入力される合計n個のサンプルの標本値の分布は、必ずしも正規分布になっているわけではない。一般的には、正規分布にある程度近い分布をとるケースが多いと考えられるが、実際の標本値の分布形態はケースごとに千差万別であり、正規分布に正確に一致するケースはむしろ稀である。しかしながら、様々なケースに対して図9の流れ図に示す処理手順による量子化法を適用しても、実用上の支障は全く生じない。これは、ステップS4Aで決定する下限値SLおよび上限値SHが、必ずしも絶対的な意味をもっていないためである。   However, the distribution of the sample values of the population actually given as the quantization target, that is, the total n samples input in step S1, is not necessarily a normal distribution. In general, it is considered that there are many cases where the distribution is close to the normal distribution to some extent, but the distribution of actual sample values varies from case to case, and cases that exactly match the normal distribution are rather rare. It is. However, even if the quantization method according to the processing procedure shown in the flowchart of FIG. 9 is applied to various cases, there is no practical problem. This is because the lower limit value SL and the upper limit value SH determined in step S4A do not necessarily have an absolute meaning.

すなわち、下限値SLおよび上限値SHは、下方除外範囲a,量子化対象範囲b,上方除外範囲cの境界としての意味をもつが、これらの境界位置が多少ずれたとしても、量子化処理を行う上で、重大な支障は生じないのである。そもそも、下限値SLおよび上限値SHを決定する要因となるパラメータ値C自体が、オペレータによって任意に設定される値、あるいは、予め設定された任意の値であるから、それ自体、厳密な値に設定すべきものではない。   That is, the lower limit value SL and the upper limit value SH have meanings as boundaries of the lower exclusion range a, the quantization target range b, and the upper exclusion range c. Even if these boundary positions are slightly shifted, the quantization process is performed. There is no significant hindrance in doing this. In the first place, the parameter value C itself that is a factor for determining the lower limit value SL and the upper limit value SH is a value that is arbitrarily set by the operator or an arbitrary value that is set in advance. It should not be set.

実際、母集団が正規分布でなかった場合、ステップS4Aで決定された下限値SL〜上限値SHまでの量子化対象範囲内に含まれるサンプル数の全サンプル数に対する割合は、パラメータ値Cに正確には一致しないことになる。たとえば、パラメータ値C=90%に設定したとしても、実際に量子化対象範囲内に含まれるサンプル数の全サンプル数に対する割合は、92%になったり、87%になったりするであろう。しかしながら、下限値SLおよび上限値SHの値が、指定したパラメータ値Cに応じた正確な値にならなくても、量子化処理それ自体には大きな支障は生じないのである。   Actually, when the population is not a normal distribution, the ratio of the number of samples included in the quantization target range from the lower limit value SL to the upper limit value SH determined in step S4A to the total number of samples is accurate to the parameter value C. Will not match. For example, even if the parameter value C is set to 90%, the ratio of the number of samples actually included in the quantization target range to the total number of samples will be 92% or 87%. However, even if the values of the lower limit value SL and the upper limit value SH do not become accurate values according to the designated parameter value C, the quantization process itself does not have a serious problem.

したがって、図9の流れ図に示す処理手順は、母集団が正規分布でない場合にも、十分に実用性をもった手順になる。そして、この処理手順には、演算負担の大きなソート処理が含まれていないので、汎用パソコンを用いて構成した量子化装置や、デジタルカメラ内蔵用チップによって構成した量子化装置など、それほど高度な演算処理機能をもたない装置へ本発明を適用するには最適である。   Therefore, the processing procedure shown in the flowchart of FIG. 9 is a sufficiently practical procedure even when the population is not normally distributed. And since this processing procedure does not include sort processing with a large calculation burden, it is not so sophisticated such as a quantizer configured using a general-purpose personal computer or a quantizer configured using a chip for a digital camera. It is most suitable for applying the present invention to an apparatus having no processing function.

図14は、上述した実用的実施形態に係る量子化処理装置の構成を示すブロック図である。この装置は、図9の流れ図に示す各ステップを実行する機能を有しており、元データ格納部10,平均・標準偏差演算部80,対応テーブル格納部90,量子化処理部40,上下限決定部50A,条件設定部60,量子化データ格納部70という各ブロック構成要素の集合体からなる。やはり、これらの各構成要素は、コンピュータに専用のプログラムを組み込むことにより実現される。   FIG. 14 is a block diagram showing the configuration of the quantization processing apparatus according to the practical embodiment described above. This apparatus has a function of executing each step shown in the flowchart of FIG. 9, and includes an original data storage unit 10, an average / standard deviation calculation unit 80, a correspondence table storage unit 90, a quantization processing unit 40, upper and lower limits. It consists of a collection of block constituent elements: a determination unit 50A, a condition setting unit 60, and a quantized data storage unit 70. Again, each of these components is realized by incorporating a dedicated program into the computer.

この図14に示す各構成要素のうち、元データ格納部10,量子化処理部40,条件設定部60,量子化データ格納部70の部分は、図6に示す装置における同符号の構成要素と全く同じである。別言すれば、図14に示す実用的実施形態に係る量子化処理装置は、図6に示す基本的実施形態に係る量子化処理装置におけるソート作業部20,ソート処理部30,上下限決定部50を、平均・標準偏差演算部80,対応テーブル格納部90,上下限決定部50Aに置き換えたものと言うことができる。これは、図6に示す装置では、ソート処理によって上下限の決定を行っていたのに対して、図14に示す装置では、平均値Mおよび標準偏差σを用いた計算により上下限の決定を行うためである。   Of the components shown in FIG. 14, the original data storage unit 10, the quantization processing unit 40, the condition setting unit 60, and the quantized data storage unit 70 are the same as the components in the apparatus shown in FIG. Exactly the same. In other words, the quantization processing device according to the practical embodiment shown in FIG. 14 includes the sort operation unit 20, the sort processing unit 30, and the upper and lower limit determination units in the quantization processing device according to the basic embodiment shown in FIG. It can be said that 50 is replaced with the average / standard deviation calculation unit 80, the correspondence table storage unit 90, and the upper and lower limit determination unit 50A. In the apparatus shown in FIG. 6, the upper and lower limits are determined by the sorting process, whereas in the apparatus shown in FIG. 14, the upper and lower limits are determined by calculation using the average value M and the standard deviation σ. To do.

平均・標準偏差演算部80は、元データ格納部10に格納されているn個の標本値について、平均値Mと標準偏差σとを演算する処理機能を有している。具体的には、n個の標本値S1,S2,S3,...,Snについての平均値Mと標準偏差σを、
M=Σi=1〜nSi/n
σ=√((Σi=1〜n(Si−M))/n)
なる式で演算する処理を実行する。演算結果として得られた平均値Mと標準偏差σは、上下限決定部50Aへ引き渡される。
The average / standard deviation calculation unit 80 has a processing function for calculating the average value M and the standard deviation σ for n sample values stored in the original data storage unit 10. Specifically, an average value M and standard deviation σ for n sample values S1, S2, S3,.
M = Σ i = 1 to n Si / n
σ = √ ((Σ i = 1 to n (Si-M) 2 ) / n)
The process which calculates with the type | formula is performed. The average value M and the standard deviation σ obtained as a calculation result are delivered to the upper / lower limit determination unit 50A.

一方、対応テーブル格納部90は、一般的な正規分布において、標準化スコアをzとしたときに、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)と標準化スコアzとの対応関係を示す対応テーブルを格納した構成要素である。具体的には、図13に示すような対応テーブルが格納されることになる。   On the other hand, the correspondence table storage unit 90 has a sample value in the range of “average value−z × standard deviation” to “average value + z × standard deviation” when the standardized score is z in a general normal distribution. It is a component that stores a correspondence table showing the correspondence between the cumulative distribution function value f (z) indicating the proportion of samples and the standardized score z. Specifically, a correspondence table as shown in FIG. 13 is stored.

また、上下限決定部50Aは、図6に示す上下限決定部50と同様に、上限値SHおよび下限値SLを決定する処理を行う構成要素であるが、その決定プロセスは異なっている。すなわち、上下限決定部50Aは、対応テーブル格納部90内の対応テーブルを参照することにより、条件設定部60に設定されたパラメータ値Cに等しい累積分布関数値f(z)に対応する標準化スコアzを求め、平均値Mおよび標準偏差σならびに求めた標準化スコアzを用いて、上限値SH=M+zσおよび下限値SL=M−zσを決定する処理を行うことになる。   The upper / lower limit determination unit 50A is a component that performs processing for determining the upper limit value SH and the lower limit value SL, similarly to the upper / lower limit determination unit 50 shown in FIG. 6, but the determination process is different. In other words, the upper and lower limit determination unit 50A refers to the correspondence table in the correspondence table storage unit 90, and thereby the standardized score corresponding to the cumulative distribution function value f (z) equal to the parameter value C set in the condition setting unit 60. z is obtained, and an upper limit SH = M + zσ and a lower limit SL = M−zσ are determined using the average value M, the standard deviation σ, and the obtained standardized score z.

元データ格納部10内に格納されたn個の標本値S1,S2,S3,...,Snの分布が正規分布をとらない場合には、上下限決定部50Aで決定された上限値SHおよび下限値SLは、パラメータ値Cによって指定された本来の正しい値にはならないが、上述したとおり、実用上は何ら支障は生じない。   When the distribution of the n sample values S1, S2, S3,..., Sn stored in the original data storage unit 10 does not have a normal distribution, the upper limit value SH determined by the upper / lower limit determination unit 50A. The lower limit SL is not the original correct value specified by the parameter value C, but as described above, there is no practical problem.

こうして決定された上限値SHおよび下限値SLを用いて、量子化処理部40による量子化処理が実行され、その結果として得られる量子化値Q1〜Qnが量子化データ格納部70に格納される点は、§3で述べた標準的実施形態に係る装置の動作と全く同様である。   Using the upper limit value SH and the lower limit value SL determined in this way, the quantization processing by the quantization processing unit 40 is executed, and the resulting quantized values Q1 to Qn are stored in the quantized data storage unit 70. The point is exactly the same as the operation of the apparatus according to the standard embodiment described in §3.

従来の一般的な量子化処理の一例を示すヒストグラムである。It is a histogram which shows an example of the conventional general quantization process. 従来の一般的な量子化処理の別な一例を示すヒストグラムである。It is a histogram which shows another example of the conventional general quantization process. 図1に示す例に本発明を適用した場合の量子化処理を示すヒストグラムである。2 is a histogram showing quantization processing when the present invention is applied to the example shown in FIG. 1. 図2に示す例に本発明を適用した場合の量子化処理を示すヒストグラムである。It is a histogram which shows the quantization process at the time of applying this invention to the example shown in FIG. 本発明の基本的実施形態に係る量子化処理方法の手順を示す流れ図である。It is a flowchart which shows the procedure of the quantization processing method which concerns on basic embodiment of this invention. 本発明の基本的実施形態に係る量子化処理装置の構成を示すブロック図である。It is a block diagram which shows the structure of the quantization processing apparatus which concerns on fundamental embodiment of this invention. 図6に示す量子化処理装置で処理される標本値の実例とその量子化プロセスにおける変遷の一例を示す図である。It is a figure which shows the example of the transition in the example of the sample value processed with the quantization processing apparatus shown in FIG. 6, and its quantization process. 図6に示す量子化処理装置で処理される標本値の別な実例とその量子化プロセスにおける変遷の一例を示す図である。It is a figure which shows another example of the sample value processed with the quantization processing apparatus shown in FIG. 6, and an example of the transition in the quantization process. 本発明の実用的実施形態に係る量子化処理方法の手順を示す流れ図である。It is a flowchart which shows the procedure of the quantization processing method which concerns on practical embodiment of this invention. 一般的な正規分布における標準化スコアzと累積分布関数値f(z)との関係を示すグラフである。It is a graph which shows the relationship between the standardization score z and the cumulative distribution function value f (z) in a general normal distribution. 一般的な正規分布における標準化スコアzと累積分布関数値f(z)との関係を示す式である。It is a formula which shows the relationship between the standardized score z and the cumulative distribution function value f (z) in a general normal distribution. 公知の標準正規分布表の一例を示す図である。It is a figure which shows an example of a well-known standard normal distribution table. 一般的な正規分布における標準化スコアzと累積分布関数値f(z)との対応関係を示す対応テーブルを示す図である。It is a figure which shows the corresponding | compatible table which shows the corresponding | compatible relationship between the standardized score z and the cumulative distribution function value f (z) in a general normal distribution. 本発明の実用的実施形態に係る量子化処理装置の構成を示すブロック図である。It is a block diagram which shows the structure of the quantization processing apparatus which concerns on practical embodiment of this invention.

符号の説明Explanation of symbols

10:元データ格納部
20:ソート作業部
30:ソート処理部
40:量子化処理部
50,50A:上下限決定部
60:条件設定部
70:量子化データ格納部
80:平均・標準偏差演算部
90:対応テーブル格納部
a:下方除外範囲
b:量子化対象範囲
c:上方除外範囲
B1,B2:頻度積算バー
C:パラメータ値
D1〜Dn:データ識別コード
f(z):累積分布関数値
M:平均値
m:量子化の段階数
n:サンプルの総数
Q1〜Qn:量子化値
Qi:第i番目の量子化値
S1〜S6,S3A,S4A:流れ図の各ステップ
S1〜Sn:標本値
Si:第i番目の標本値
SH:上限値
SL:下限値
Smax:最大値
Smin:最小値
z:標準化スコア
σ:標準偏差
10: Original data storage unit 20: Sort operation unit 30: Sort processing unit 40: Quantization processing unit 50, 50A: Upper / lower limit determination unit 60: Condition setting unit 70: Quantized data storage unit 80: Average / standard deviation calculation unit 90: correspondence table storage unit a: lower exclusion range b: quantization target range c: upper exclusion range B1, B2: frequency integration bar C: parameter values D1 to Dn: data identification code f (z): cumulative distribution function value M : Average value m: Number of quantization stages n: Total number of samples Q1 to Qn: Quantized value Qi: i-th quantized values S1 to S6, S3A, S4A: Steps S1 to Sn of the flowchart: Sample value Si : I-th sample value SH: upper limit value SL: lower limit value Smax: maximum value Smin: minimum value z: standardized score σ: standard deviation

Claims (10)

所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う方法であって、
コンピュータに対して、n個のサンプルの標本値をデジタルデータとして入力し、所定の記憶場所に格納する入力ステップと、
コンピュータに対して、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定ステップと、
コンピュータが、前記記憶場所に格納されているn個の標本値を大きさの順に並べ替える処理を行うソートステップと、
コンピュータが、前記ソートステップによって大きさの順に並べ替えられたn個の標本値に基づいて、小さい方から第((n×(1−C))/2+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))/2)番目の標本値の値を上限値SHと決定する上下限決定ステップと、
コンピュータが、前記下限値SL〜前記上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める段階決定ステップと、
コンピュータが、前記n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づけ、対応づけた各量子化値を各サンプルに対応する記憶場所に格納する量子化ステップと、
を有し、
前記量子化ステップにおいて、前記n個のサンプルのうち、前記下限値SL未満の標本値を有するサンプルについては、前記下限値SLが所属する段階の量子化値を対応づけ、前記上限値SHを越える標本値を有するサンプルについては、前記上限値SHが所属する段階の量子化値を対応づけることを特徴とする標本値の量子化方法。
A method of performing quantization by associating one of m stages of quantized values with each of n samples having a predetermined sample value,
An input step for inputting a sample value of n samples as digital data to a computer and storing it in a predetermined storage location;
A condition setting step for setting a stage number m (m is a natural number of 2 or more) and a parameter value C (0 <C <1) for the computer;
A sorting step in which the computer performs a process of rearranging the n sample values stored in the storage location in order of size;
The computer sets the value of the ((n × (1-C)) / 2 + 1) -th sample value from the smallest to the lower limit value based on the n sample values rearranged in order of magnitude by the sorting step. An upper and lower limit determination step for determining SL and determining the value of the (n− (n × (1-C)) / 2) -th sample value from the smaller one as the upper limit value SH;
A stage determination step in which a computer divides a numerical range from the lower limit value SL to the upper limit value SH into m stages, and determines a predetermined quantization value for each stage;
A computer that associates, for each of the n samples, a quantization value at a stage to which the sample value belongs, and stores each associated quantization value in a memory location corresponding to each sample;
Have
In the quantization step, among the n samples, a sample having a sample value less than the lower limit SL is associated with a quantized value at a stage to which the lower limit SL belongs, and exceeds the upper limit SH. A sample value quantization method, wherein a sample value having a sample value is associated with a quantized value at a stage to which the upper limit SH belongs.
所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う方法であって、
コンピュータに対して、n個のサンプルの標本値をデジタルデータとして入力し、所定の記憶場所に格納する入力ステップと、
コンピュータに対して、段階数m(mは2以上の自然数)、パラメータ値C(0<C<1)、バランス値P(0≦P≦1)を設定する条件設定ステップと、
コンピュータが、前記記憶場所に格納されているn個の標本値を大きさの順に並べ替える処理を行うソートステップと、
コンピュータが、前記ソートステップによって大きさの順に並べ替えられたn個の標本値に基づいて、小さい方から第((n×(1−C))×P+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))×(1−P))番目の標本値の値を上限値SHと決定する上下限決定ステップと、
コンピュータが、前記下限値SL〜前記上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める段階決定ステップと、
コンピュータが、前記n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づけ、対応づけた各量子化値を各サンプルに対応する記憶場所に格納する量子化ステップと、
を有し、
前記量子化ステップにおいて、前記n個のサンプルのうち、前記下限値SL未満の標本値を有するサンプルについては、前記下限値SLが所属する段階の量子化値を対応づけ、前記上限値SHを越える標本値を有するサンプルについては、前記上限値SHが所属する段階の量子化値を対応づけることを特徴とする標本値の量子化方法。
A method of performing quantization by associating one of m stages of quantized values with each of n samples having a predetermined sample value,
An input step for inputting a sample value of n samples as digital data to a computer and storing it in a predetermined storage location;
A condition setting step for setting a stage number m (m is a natural number of 2 or more), a parameter value C (0 <C <1), and a balance value P (0 ≦ P ≦ 1) for the computer;
A sorting step in which the computer performs a process of rearranging the n sample values stored in the storage location in order of size;
The computer sets the value of the ((n × (1-C)) × P + 1) -th sample value from the smallest to the lower limit value based on the n sample values rearranged in order of magnitude by the sorting step. An upper and lower limit determination step for determining SL and determining the value of the (n− (n × (1-C)) × (1-P))-th sample value from the smaller one as the upper limit value SH;
A stage determination step in which a computer divides a numerical range from the lower limit value SL to the upper limit value SH into m stages, and determines a predetermined quantization value for each stage;
A computer that associates, for each of the n samples, a quantization value at a stage to which the sample value belongs, and stores each associated quantization value in a memory location corresponding to each sample;
Have
In the quantization step, among the n samples, a sample having a sample value less than the lower limit SL is associated with a quantized value at a stage to which the lower limit SL belongs, and exceeds the upper limit SH. A sample value quantization method, wherein a sample value having a sample value is associated with a quantized value at a stage to which the upper limit SH belongs.
所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う方法であって、
コンピュータに対して、n個のサンプルの標本値をデジタルデータとして入力し、所定の記憶場所に格納する入力ステップと、
コンピュータに対して、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定ステップと、
コンピュータが、前記記憶場所に格納されているn個の標本値について、平均値Mと標準偏差σとを演算する平均・標準偏差演算ステップと、
コンピュータが、正規分布において、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)が前記パラメータ値Cに等しくなる標準化スコアzを求め、前記平均値Mおよび前記標準偏差σならびに前記標準化スコアzを用いて、上限値SH=M+zσおよび下限値SL=M−zσを決定する上下限決定ステップと、
コンピュータが、前記下限値SL〜前記上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定める段階決定ステップと、
コンピュータが、前記n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づけ、対応づけた各量子化値を各サンプルに対応する記憶場所に格納する量子化ステップと、
を有し、
前記量子化ステップにおいて、前記n個のサンプルのうち、前記下限値SL未満の標本値を有するサンプルについては、前記下限値SLが所属する段階の量子化値を対応づけ、前記上限値SHを越える標本値を有するサンプルについては、前記上限値SHが所属する段階の量子化値を対応づけることを特徴とする標本値の量子化方法。
A method of performing quantization by associating one of m stages of quantized values with each of n samples having a predetermined sample value,
An input step for inputting a sample value of n samples as digital data to a computer and storing it in a predetermined storage location;
A condition setting step for setting a stage number m (m is a natural number of 2 or more) and a parameter value C (0 <C <1) for the computer;
An average / standard deviation calculation step in which a computer calculates an average value M and a standard deviation σ for n sample values stored in the storage location;
The cumulative distribution function value f (z) indicating the proportion of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation” in the normal distribution is the parameter value C. An upper and lower limit determination step for determining an upper limit SH = M + zσ and a lower limit SL = M−zσ using the average value M, the standard deviation σ, and the standardized score z;
A stage determination step in which a computer divides a numerical range from the lower limit value SL to the upper limit value SH into m stages, and determines a predetermined quantization value for each stage;
A computer that associates, for each of the n samples, a quantization value at a stage to which the sample value belongs, and stores each associated quantization value in a memory location corresponding to each sample;
Have
In the quantization step, among the n samples, a sample having a sample value less than the lower limit SL is associated with a quantized value at a stage to which the lower limit SL belongs, and exceeds the upper limit SH. A sample value quantization method, wherein a sample value having a sample value is associated with a quantized value at a stage to which the upper limit SH belongs.
請求項3に記載の量子化方法において、
正規分布における標準化スコアをzとしたときに、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)と標準化スコアzとの対応関係を示す対応テーブルを予めコンピュータ内に用意しておき、上下限決定ステップでは、前記対応テーブルを参照することにより、パラメータ値Cに等しい累積分布関数値f(z)に対応する標準化スコアzを求めることを特徴とする標本値の量子化方法。
The quantization method according to claim 3, wherein
Cumulative distribution function value f (z) indicating the proportion of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation”, where z is the standardized score in the normal distribution A correspondence table showing the correspondence between the standardized score z and the standardized score z is prepared in advance in the computer, and in the upper and lower limit determination step, the cumulative distribution function value f (z) equal to the parameter value C is referred to by referring to the correspondence table. A sampled-value quantization method characterized by obtaining a standardized score z corresponding to.
請求項1〜4のいずれかに記載の量子化方法において、
量子化段階で、標本値Sをもったサンプルに対して、((S−SL)/(SH−SL))×(m−1)なる演算値を整数値に丸めることにより求まる「0〜(m−1)の範囲内の整数で示される量子化値」を対応づけることにより量子化を行うことを特徴とする標本値の量子化方法。
In the quantization method in any one of Claims 1-4,
In the quantization stage, for a sample having a sample value S, a calculation value of ((S-SL) / (SH-SL)) × (m−1) is rounded to an integer value “0- ( A sample value quantization method, wherein quantization is performed by associating a “quantized value indicated by an integer within a range of m−1)”.
所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う装置であって、
n個のサンプルの標本値をデジタルデータとして入力し、これを格納する元データ格納部と、
予めもしくはオペレータの指示に基づき、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定部と、
前記n個の標本値を並べ替えのために一時的に保持するソート作業部と、
前記元データ格納部に格納されているn個の標本値を複製して、前記ソート作業部に保持させ、これを大きさの順に並べ替える処理を行うソート処理部と、
前記ソート処理部による並べ替え処理が完了した後、前記ソート作業部に大きさの順に並べられているn個の標本値に基づいて、小さい方から第((n×(1−C))/2+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))/2)番目の標本値の値を上限値SHと決定する上下限決定部と、
前記下限値SL〜前記上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、前記n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける量子化処理部と、
前記n個のサンプルについて、それぞれ対応づけられた量子化値をデジタルデータとして格納する量子化データ格納部と、
を有し、
前記量子化処理部が、前記n個のサンプルのうち、前記下限値SL未満の標本値を有するサンプルについては、前記下限値SLが所属する段階の量子化値を対応づけ、前記上限値SHを越える標本値を有するサンプルについては、前記上限値SHが所属する段階の量子化値を対応づけることを特徴とする標本値の量子化装置。
An apparatus for performing quantization by associating one of m stages of quantized values with each of n samples having a predetermined sample value,
An original data storage unit for inputting sample values of n samples as digital data and storing the digital data;
A condition setting unit for setting the number of steps m (m is a natural number of 2 or more) and the parameter value C (0 <C <1) in advance or based on an operator's instruction;
A sorting unit that temporarily holds the n sample values for sorting;
A sort processing unit that duplicates n sample values stored in the original data storage unit, holds the sample value in the sort operation unit, and performs a process of rearranging the sample values in order of size;
After the rearrangement process by the sort processing unit is completed, the ((n × (1-C)) /) from the smallest one is based on the n sample values arranged in order of size in the sort operation unit. The upper and lower limits for determining the value of the (2 + 1) th sample value as the lower limit SL and determining the value of the (n− (n × (1-C)) / 2) th sample value from the smaller value as the upper limit SH A decision unit;
The numerical range from the lower limit value SL to the upper limit value SH is divided into m stages, a predetermined quantization value is determined for each stage, and the quantum value of the stage to which the sample value belongs for each of the n samples. A quantization processing unit for associating quantization values;
A quantized data storage unit that stores quantized values associated with the n samples as digital data;
Have
The quantization processing unit associates a quantized value at a stage to which the lower limit value SL belongs for a sample having a sample value less than the lower limit value SL among the n samples, and sets the upper limit value SH. An apparatus for quantizing a sample value, characterized by associating a quantized value at a stage to which the upper limit SH belongs with respect to a sample having a sample value that exceeds the sample value.
所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う装置であって、
n個のサンプルの標本値をデジタルデータとして入力し、これを格納する元データ格納部と、
予めもしくはオペレータの指示に基づき、段階数m(mは2以上の自然数)、パラメータ値C(0<C<1)、バランス値P(0≦P≦1)を設定する条件設定部と、
前記n個の標本値を並べ替えのために一時的に保持するソート作業部と、
前記元データ格納部に格納されているn個の標本値を複製して、前記ソート作業部に保持させ、これを大きさの順に並べ替える処理を行うソート処理部と、
前記ソート処理部による並べ替え処理が完了した後、前記ソート作業部に大きさの順に並べられているn個の標本値に基づいて、小さい方から第((n×(1−C))×P+1)番目の標本値の値を下限値SLと決定し、小さい方から第(n−(n×(1−C))×(1−P))番目の標本値の値を上限値SHと決定する上下限決定部と、
前記下限値SL〜前記上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、前記n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける量子化処理部と、
前記n個のサンプルについて、それぞれ対応づけられた量子化値をデジタルデータとして格納する量子化データ格納部と、
を有し、
前記量子化処理部が、前記n個のサンプルのうち、前記下限値SL未満の標本値を有するサンプルについては、前記下限値SLが所属する段階の量子化値を対応づけ、前記上限値SHを越える標本値を有するサンプルについては、前記上限値SHが所属する段階の量子化値を対応づけることを特徴とする標本値の量子化装置。
An apparatus for performing quantization by associating one of m stages of quantized values with each of n samples having a predetermined sample value,
An original data storage unit for inputting sample values of n samples as digital data and storing the digital data;
A condition setting unit for setting the step number m (m is a natural number of 2 or more), the parameter value C (0 <C <1), and the balance value P (0 ≦ P ≦ 1) in advance or based on an instruction from the operator;
A sorting unit that temporarily holds the n sample values for sorting;
A sort processing unit that duplicates n sample values stored in the original data storage unit, holds the sample value in the sort operation unit, and performs a process of rearranging the sample values in order of size;
After the rearrangement processing by the sort processing unit is completed, the ((n × (1-C)) × The value of the (P + 1) -th sample value is determined as the lower limit value SL, and the value of the (n− (n × (1-C)) × (1-P))-th sample value from the smaller value is set as the upper limit value SH. An upper / lower limit determination unit to determine;
The numerical range from the lower limit value SL to the upper limit value SH is divided into m stages, a predetermined quantization value is determined for each stage, and the quantum value of the stage to which the sample value belongs for each of the n samples. A quantization processing unit for associating quantization values;
A quantized data storage unit that stores quantized values associated with the n samples as digital data;
Have
The quantization processing unit associates a quantized value at a stage to which the lower limit value SL belongs for a sample having a sample value less than the lower limit value SL among the n samples, and sets the upper limit value SH. An apparatus for quantizing a sample value, characterized by associating a quantized value at a stage to which the upper limit SH belongs with respect to a sample having a sample value that exceeds the sample value.
所定の標本値をもったn個のサンプルのそれぞれに対して、m段階のいずれかの量子化値を対応づけることにより量子化を行う装置であって、
n個のサンプルの標本値をデジタルデータとして入力し、これを格納する元データ格納部と、
予めもしくはオペレータの指示に基づき、段階数m(mは2以上の自然数)およびパラメータ値C(0<C<1)を設定する条件設定部と、
前記元データ格納部に格納されているn個の標本値について、平均値Mと標準偏差σとを演算する平均・標準偏差演算部と、
正規分布における標準化スコアをzとしたときに、標本値が「平均値−z×標準偏差」〜「平均値+z×標準偏差」の範囲に入るサンプルの割合を示す累積分布関数値f(z)と標準化スコアzとの対応関係を示す対応テーブルを格納した対応テーブル格納部と、
前記対応テーブルを参照することにより、前記パラメータ値Cに等しい累積分布関数値f(z)に対応する標準化スコアzを求め、前記平均値Mおよび前記標準偏差σならびに前記標準化スコアzを用いて、上限値SH=M+zσおよび下限値SL=M−zσを決定する上下限決定部と、
前記下限値SL〜前記上限値SHまでの数値範囲をm段階に分割し、各段階にそれぞれ所定の量子化値を定め、前記n個のサンプルのそれぞれについて、その標本値が所属する段階の量子化値を対応づける量子化処理部と、
前記n個のサンプルについて、それぞれ対応づけられた量子化値をデジタルデータとして格納する量子化データ格納部と、
を有し、
前記量子化処理部が、前記n個のサンプルのうち、前記下限値SL未満の標本値を有するサンプルについては、前記下限値SLが所属する段階の量子化値を対応づけ、前記上限値SHを越える標本値を有するサンプルについては、前記上限値SHが所属する段階の量子化値を対応づけることを特徴とする標本値の量子化装置。
An apparatus for performing quantization by associating one of m stages of quantized values with each of n samples having a predetermined sample value,
An original data storage unit for inputting sample values of n samples as digital data and storing the digital data;
A condition setting unit for setting the number of steps m (m is a natural number of 2 or more) and the parameter value C (0 <C <1) in advance or based on an operator's instruction;
An average / standard deviation calculation unit for calculating an average value M and a standard deviation σ for n sample values stored in the original data storage unit;
Cumulative distribution function value f (z) indicating the proportion of samples whose sample values fall within the range of “average value−z × standard deviation” to “average value + z × standard deviation”, where z is the standardized score in the normal distribution A correspondence table storage unit that stores a correspondence table indicating a correspondence relationship between and a standardized score z;
By referring to the correspondence table, a standardized score z corresponding to the cumulative distribution function value f (z) equal to the parameter value C is obtained, and using the average value M, the standard deviation σ, and the standardized score z, An upper and lower limit determination unit for determining an upper limit SH = M + zσ and a lower limit SL = M−zσ;
The numerical range from the lower limit value SL to the upper limit value SH is divided into m stages, a predetermined quantization value is determined for each stage, and the quantum value of the stage to which the sample value belongs for each of the n samples. A quantization processing unit for associating quantization values;
A quantized data storage unit that stores quantized values associated with the n samples as digital data;
Have
The quantization processing unit associates a quantized value at a stage to which the lower limit value SL belongs for a sample having a sample value less than the lower limit value SL among the n samples, and sets the upper limit value SH. An apparatus for quantizing a sample value, characterized by associating a quantized value at a stage to which the upper limit SH belongs with respect to a sample having a sample value that exceeds the sample value.
請求項6〜8のいずれかに記載の量子化装置において、
量子化処理部が、標本値Sをもったサンプルに対して、((S−SL)/(SH−SL))×(m−1)なる演算値を整数値に丸めることにより求まる「0〜(m−1)の範囲内の整数で示される量子化値」を対応づけることにより量子化を行うことを特徴とする標本値の量子化装置。
In the quantization apparatus in any one of Claims 6-8,
The quantization processing unit calculates “(0−S−SL) / (SH−SL)) × (m−1) for the sample having the sample value S by rounding it to an integer value“ 0 ”. A sample value quantization apparatus that performs quantization by associating a “quantized value represented by an integer within a range of (m−1)”.
請求項6〜9のいずれかに記載の標本値の量子化装置としてコンピュータを機能させるためのプログラム。   A program for causing a computer to function as the sample value quantization apparatus according to claim 6.
JP2007290442A 2007-11-08 2007-11-08 Quantization method and quantization device for specimen value Pending JP2009118297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007290442A JP2009118297A (en) 2007-11-08 2007-11-08 Quantization method and quantization device for specimen value

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007290442A JP2009118297A (en) 2007-11-08 2007-11-08 Quantization method and quantization device for specimen value

Publications (1)

Publication Number Publication Date
JP2009118297A true JP2009118297A (en) 2009-05-28

Family

ID=40784908

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007290442A Pending JP2009118297A (en) 2007-11-08 2007-11-08 Quantization method and quantization device for specimen value

Country Status (1)

Country Link
JP (1) JP2009118297A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015032013A (en) * 2013-07-31 2015-02-16 Kddi株式会社 Numeric data analyzer and program
CN105787908A (en) * 2012-08-08 2016-07-20 杜比实验室特许公司 Image Processing For Hdr Images

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08331385A (en) * 1995-05-31 1996-12-13 Konica Corp Radiation image processing method
JPH0998291A (en) * 1995-07-26 1997-04-08 Nec Eng Ltd Automatic sampling device
JPH10198802A (en) * 1996-11-13 1998-07-31 Seiko Epson Corp Image processing apparatus, image processing method, and medium recording image processing program
JP2002288650A (en) * 2001-03-26 2002-10-04 Casio Comput Co Ltd Image processing apparatus and digital camera, image processing method, recording medium
JP2004274641A (en) * 2003-03-12 2004-09-30 Seiko Epson Corp Derivation of the amount of gradation correction according to the degree of dispersion of gradation values

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08331385A (en) * 1995-05-31 1996-12-13 Konica Corp Radiation image processing method
JPH0998291A (en) * 1995-07-26 1997-04-08 Nec Eng Ltd Automatic sampling device
JPH10198802A (en) * 1996-11-13 1998-07-31 Seiko Epson Corp Image processing apparatus, image processing method, and medium recording image processing program
JP2002288650A (en) * 2001-03-26 2002-10-04 Casio Comput Co Ltd Image processing apparatus and digital camera, image processing method, recording medium
JP2004274641A (en) * 2003-03-12 2004-09-30 Seiko Epson Corp Derivation of the amount of gradation correction according to the degree of dispersion of gradation values

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787908A (en) * 2012-08-08 2016-07-20 杜比实验室特许公司 Image Processing For Hdr Images
JP2016197430A (en) * 2012-08-08 2016-11-24 ドルビー ラボラトリーズ ライセンシング コーポレイション Image processing for HDR images
CN105787908B (en) * 2012-08-08 2019-05-14 杜比实验室特许公司 Image processing method, device and storage medium for high dynamic range images
JP2015032013A (en) * 2013-07-31 2015-02-16 Kddi株式会社 Numeric data analyzer and program

Similar Documents

Publication Publication Date Title
US20030206231A1 (en) Method and apparatus for enhancing digital images utilizing non-image data
CN111989897B (en) Measuring index of computer network
JP2009118297A (en) Quantization method and quantization device for specimen value
CN103716050B (en) Random estimation analog-to-digital converter
CN105444708B (en) Method for correcting error in position-measurement device
JP4183432B2 (en) Image data encoding method
CN1996382A (en) Calculation device and method of image histogram with adjustable fineness
JPH0695012B2 (en) Device for a matrix-arranged photodiode array
CN102186020A (en) Image processing apparatus and image processing method
JP2011223244A (en) Data compression device and data decompression device
WO2018173257A1 (en) Information processing device, information processing method, and information processing program
US6671411B1 (en) Image encoding apparatus, method and memory medium therefor
CN114998163A (en) Infrared digital image gray level mapping method
US20040252209A1 (en) Digital programmable gain stage with high resolution for CMOS image sensors
CN114022367A (en) Image quality adjusting method, device, electronic equipment and medium
JP5505639B2 (en) Imaging device adjustment method and imaging device
JP6285711B2 (en) Image processing device
JP2003224740A (en) Nonlinear signal processing apparatus and image signal processing apparatus
JPH0898175A (en) Picture encoding device
CN114184283A (en) Infrared thermal imaging wide dynamic method and system based on temperature partition
JPH07325914A (en) Image processing method
CN109936740B (en) Pixel value prediction method for lossless compression of image
CN111259177B (en) Black-white binary signature picture storage method and system
CN116361967B (en) Three-dimensional model order reduction method and device for engineering machinery and electronic equipment
JPH06187436A (en) Picture data processor

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100721

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110915

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110927

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20120207