JP2002024817A - Image processing method and image processing device - Google Patents

Image processing method and image processing device

Info

Publication number
JP2002024817A
JP2002024817A JP2000208918A JP2000208918A JP2002024817A JP 2002024817 A JP2002024817 A JP 2002024817A JP 2000208918 A JP2000208918 A JP 2000208918A JP 2000208918 A JP2000208918 A JP 2000208918A JP 2002024817 A JP2002024817 A JP 2002024817A
Authority
JP
Japan
Prior art keywords
value
color
gradation
pixel
new
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
JP2000208918A
Other languages
Japanese (ja)
Inventor
Teruhiko Matsuoka
輝彦 松岡
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.)
Sharp Corp
Original Assignee
Sharp Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sharp Corp filed Critical Sharp Corp
Priority to JP2000208918A priority Critical patent/JP2002024817A/en
Publication of JP2002024817A publication Critical patent/JP2002024817A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an image processing method and an image processing device, capable of suppressing generation of color shift or a pseudo-gradation in a color image. SOLUTION: Color conversion processing is executed relative to image data, in order to convert color image data having plural gradations into color image data having the smaller number of gradations and a smaller data quantity than the color image data; the histogram of a gradation level is obtained in a converted color space; a new gradation level is determined corresponding to the distribution state of gradation values on the histogram; and the gradation values of the new gradation level are selected relative to every pixel in local regions, based on the result obtained by dividing the image data into the local regions and detecting the color distribution state and existence of edge in every local position. Hereby, image processing is enabled by executing gradation number conversion having no color shift, no pseudo-gradation and having little deterioration in image quality.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は色ずれや疑似階調の
発生を抑えた階調数変換を実現可能とする画像処理方法
及び画像処理装置に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to an image processing method and an image processing apparatus capable of realizing tone number conversion while suppressing occurrence of color shift and pseudo tone.

【0002】[0002]

【従来の技術】従来から、画像処理の際に階調数を減ら
す方向へ変換する方法として、2階調へ変換を行うディ
ザ法や誤差拡散法、また、3階調以上の多値変換を行う
多値ディザ法や多値誤差拡散法がある。
2. Description of the Related Art Conventionally, a dither method or an error diffusion method for performing conversion to two gradations or a multi-value conversion for three or more gradations has been conventionally used as a method for converting the number of gradations in image processing in a direction to reduce the number of gradations. There are a multi-value dither method and a multi-value error diffusion method.

【0003】これらの方法は予めマトリクスが規定され
ており、処理対象の画像の階調分布に係わらず固定のマ
トリクス演算や誤差の拡散を行っている。そのため、実
際には原画像に存在しない階調値を多用してしまい、誤
差が非常に多く発生するために疑似階調やノイズが発生
したり、カラー画像に対しては色ずれや偽色が発生した
りしてしまう。複数のマトリクスを切り替えて用いる方
法もあるが、この方法もマトリクスは固定値なので、同
様の問題が発生してしまう。
In these methods, a matrix is defined in advance, and fixed matrix calculation and error diffusion are performed irrespective of the gradation distribution of the image to be processed. For this reason, tone values that do not actually exist in the original image are frequently used, and a large number of errors are generated, so that a pseudo tone or noise is generated. Or it will occur. There is also a method of switching between a plurality of matrices, but this method also has the same problem because the matrix is a fixed value.

【0004】これらを解決する方法の一つとして、特公
平5−62863号公報には、中間調再現方法に関する
技術が開示されている。この発明では、画像全体のヒス
トグラムから、ディザマトリクスが表現できる階調数を
定め、全画素数と階調数とから平均画素数を算出して、
画素濃度毎のヒストグラムを順次加算していき、平均画
素数に最も近くなるまでの和を求めて、ヒストグラムの
平滑化を行っていき、境界となる画像濃度値をディザマ
トリクスの閾値として設定していくものである。これに
より、画像毎に最適な中間調画像が得られることにな
る。
[0004] As one method for solving these problems, Japanese Patent Publication No. 5-62863 discloses a technique relating to a halftone reproduction method. In the present invention, the number of gradations that can be expressed by the dither matrix is determined from the histogram of the entire image, and the average number of pixels is calculated from the total number of pixels and the number of gradations.
The histogram for each pixel density is sequentially added, the sum up to the closest to the average number of pixels is obtained, the histogram is smoothed, and the image density value serving as the boundary is set as the threshold of the dither matrix. It goes. As a result, an optimal halftone image can be obtained for each image.

【0005】また、特開平9−154044号公報に
は、画像表示方法及びその装置に関する技術が開示され
ており、エッジ近傍での画素の輝度頻度分布に基づい
て、画素毎に異なる階調変換を行い、コントラストの低
下を防いでいる。
Japanese Patent Application Laid-Open No. 9-154044 discloses a technique relating to an image display method and an apparatus therefor, and performs different gradation conversion for each pixel based on the luminance frequency distribution of the pixel near an edge. To prevent a decrease in contrast.

【0006】[0006]

【発明が解決しようとする課題】先に述べた通り、従来
の方法においては、実際には原画像に存在しない階調値
を多用してしまい、誤差が非常に多く発生するため、疑
似階調やノイズが発生したり、カラー画像に対しては色
ずれや偽色が発生したりしてしまう。
As described above, in the conventional method, grayscale values that do not actually exist in the original image are frequently used, and a great deal of error occurs. And noise, and color misregistration and false colors occur in a color image.

【0007】また、特公平5−62863号公報に開示
された中間調再現方法では、2値記録装置を用いて再生
することができるが、カラー画像については言及されて
いないため、カラー画像の中間調を再現する際に、この
方法をそのまま適用することは難しい。
Further, in the halftone reproducing method disclosed in Japanese Patent Publication No. 5-62863, reproduction can be performed using a binary recording device. However, since a color image is not mentioned, an intermediate color image is not reproduced. It is difficult to apply this method as it is when reproducing the key.

【0008】特開平9−154044号公報に開示され
た画像表示方法及びその装置は、基本的にコントラスト
を改善することを特徴とする発明であり、色みに関して
は言及されておらず、カラーの自然画像からカラーの多
値画像への階調変換としては対応が不十分である。
The image display method and apparatus disclosed in Japanese Patent Application Laid-Open No. 9-154044 is an invention characterized by basically improving the contrast, and does not refer to tint. There is insufficient support for gradation conversion from a natural image to a multi-valued color image.

【0009】このような問題を解決するために、本発明
は、均等色空間を用いて輝度情報から画像全体のヒスト
グラムを作成し、その分布状態から新しい階調レベルを
決定するとともに、画像の局所領域毎に色情報検出とエ
ッジ検出を行い、近傍画素の状態に応じて注目画素の階
調値を決定することにより、カラー画像においても色ず
れや疑似階調の発生を抑える画像処理方法及び画像処理
装置を提供することを目的とする。
In order to solve such a problem, the present invention prepares a histogram of the entire image from luminance information using a uniform color space, determines a new gradation level from the distribution state, and simultaneously determines a local level of the image. An image processing method and an image processing method that performs color information detection and edge detection for each region, and determines the tone value of a target pixel according to the state of neighboring pixels, thereby suppressing the occurrence of color shift and pseudo tone in a color image. It is an object to provide a processing device.

【0010】[0010]

【課題を解決するための手段】この発明は、上記の課題
を解決するための手段として、以下の構成を備えてい
る。
The present invention has the following arrangement as means for solving the above-mentioned problems.

【0011】(1) 複数の階調を有するカラー画像データ
を、該カラー画像データよりも少ない階調数かつ少ない
データ量のカラー画像データに変換する画像処理方法で
あって、画像データに対して色変換処理を行い、変換さ
れた色空間上での階調レベルのヒストグラムを求め、該
ヒストグラム上の階調値の分布状態に応じて新しい階調
レベルを決定するとともに、色変換処理した画像データ
を局所領域に分割し、局所領域毎に色の分布状態及びエ
ッジの有無を検出し、その検出結果に基づいて局所領域
の画素毎に該新しい階調レベルの階調値を選択すること
を特徴とする。
(1) An image processing method for converting color image data having a plurality of gradations into color image data having a smaller number of gradations and a smaller data amount than the color image data. A color conversion process is performed to obtain a histogram of gradation levels in the converted color space, and a new gradation level is determined according to the distribution state of the gradation values on the histogram. Is divided into local regions, the color distribution state and the presence / absence of edges are detected for each local region, and the new gray level value is selected for each pixel of the local region based on the detection result. And

【0012】この構成においては、複数の階調を有する
カラー画像データを、このカラー画像データよりも少な
い階調数かつ少ないデータ量のカラー画像データに変換
するために、画像データに対して色変換処理を行い、変
換された色空間上での階調レベルのヒストグラムを求
め、このヒストグラム上の階調値の分布状態に応じて新
しい階調レベルを決定する。また、色変換処理を行った
画像データを局所領域に分割して、局所領域毎に色の分
布状態及びエッジの有無を検出した結果に基づいて、局
所領域の画素毎に新しい階調レベルの階調値を選択す
る。したがって、上記の画像処理方法を実行すること
で、色ずれや疑似階調などが無く画質劣化の少ない画像
を得ることができる。
In this configuration, in order to convert color image data having a plurality of gradations into color image data having a smaller number of gradations and a smaller data amount than the color image data, color conversion is performed on the image data. Processing is performed to obtain a histogram of the gradation levels in the converted color space, and a new gradation level is determined according to the distribution state of the gradation values on the histogram. Further, the image data subjected to the color conversion processing is divided into local regions, and based on the result of detecting the color distribution state and the presence / absence of an edge for each local region, a new gradation level for each pixel of the local region is obtained. Select a key value. Therefore, by executing the above-described image processing method, it is possible to obtain an image which is free from color shift, pseudo gradation and the like, and has little image quality deterioration.

【0013】(2) 画像データの色変換処理後の色空間と
して、均等色空間を用いることを特徴とする。
(2) A uniform color space is used as a color space after color conversion of image data.

【0014】この構成においては、均等色空間を画像デ
ータの色変換処理後の色空間としている。したがって、
均等色空間の中心点から各周辺画素の位置関係を容易に
求めることが可能となる。
In this configuration, the uniform color space is the color space after the color conversion processing of the image data. Therefore,
The positional relationship of each peripheral pixel can be easily obtained from the center point of the uniform color space.

【0015】(3) 画像全体の輝度情報からヒストグラム
を作成し、所定の新しい階調数と各階調値の頻度とに応
じて現在の階調レベルを複数に分割し、分割された階調
レベル群からそれぞれの代表値を決めて、前記新しい階
調レベルを決定することを特徴とする。
(3) A histogram is created from the luminance information of the entire image, and the current gradation level is divided into a plurality according to a predetermined new number of gradations and the frequency of each gradation value. It is characterized in that each representative value is determined from the group and the new gray level is determined.

【0016】この構成においては、画像全体の輝度情報
からヒストグラムを作成し、所定の新しい階調数と各階
調値の頻度とに応じて複数に分割された階調レベル群か
ら、それぞれの代表値を決定することによって新しい階
調レベルを決定する。したがって、各階調値の頻度に応
じて新しい階調値を決定するので、画像の階調特性に応
じた階調数の削減が可能となる。
In this configuration, a histogram is created from the luminance information of the entire image, and each representative value is obtained from a plurality of divided gradation levels according to a predetermined new number of gradations and the frequency of each gradation value. To determine a new gray level. Therefore, since a new gradation value is determined according to the frequency of each gradation value, it is possible to reduce the number of gradations according to the gradation characteristics of the image.

【0017】(4) 画像データの全画素数を新しい階調レ
ベルの階調数で割った値に一定数を加えた値の画素数分
を1つの階調レベルの範囲として、ヒストグラム上の階
調値の最大値または最小値から該画素数分をカウントし
て分割するとともに、直前のカウントの最終位置から該
一定数以下の所定値を逆向きにカウントした位置から次
のカウントを開始して、順次カウントを行い、該画素数
分の階調値毎に分割して、前記現在の階調レベルを複数
に分割することを特徴とする。
(4) The number of pixels obtained by dividing the total number of pixels of the image data by the number of gradations of the new gradation level and adding a certain number is defined as one gradation level range, While counting and dividing the number of pixels from the maximum value or the minimum value of the tonal value, and starting the next count from the position where the predetermined value equal to or less than the certain number is counted backward from the last position of the previous count, , The current gradation level is divided into a plurality of pixels, and the current gradation level is divided into a plurality of gradation values.

【0018】この構成においては、1つの階調レベルの
範囲を、画像データの全画素数を新しい階調レベルの階
調数で割った値に一定数を加えた値の画素数分とし、こ
の画素数分をヒストグラム上の階調値の最大値または最
小値からカウントし、直前のカウント最終位置から一定
数以下の所定の値を逆向きにカウントした位置から次の
カウントを開始して、順次カウントを行い、画素数分の
階調値毎に分割して、前記現在の階調レベルを複数の階
調レベルに分割する。したがって、頻度の高い階調値付
近ほど細かく分割され、逆に頻度の少ない階調値付近は
広く分割されるようになり、また、分割される部分にお
いて、隣り合う階調同士で重なる部分ができるので、エ
ッジの有無に応じて階調値が選択できるようになり、各
画像において階調値の出現頻度、及び、画像の特徴に応
じた階調数変換が可能となり、画質劣化を抑えることが
可能となる。
In this configuration, the range of one gradation level is the number of pixels of a value obtained by adding a fixed number to the value obtained by dividing the total number of pixels of the image data by the number of gradations of the new gradation level. The number of pixels is counted from the maximum value or the minimum value of the gradation value on the histogram, and the next count is started from the position where the predetermined value equal to or less than a predetermined number is counted in the reverse direction from the last count last position, and sequentially. Counting is performed, and the current gradation level is divided into a plurality of gradation levels by dividing the current gradation level into a plurality of gradation levels. Therefore, nearer grayscale values are more finely divided, while smaller grayscale values are more widely divided, and in the divided portions, adjacent grayscales have overlapping portions. Therefore, the gradation value can be selected according to the presence or absence of the edge, and the frequency of appearance of the gradation value in each image and the number of gradations can be converted according to the characteristics of the image. It becomes possible.

【0019】(5) 前記代表値は、各階調レベル群中の分
布に応じた加重平均値であることを特徴とする。
(5) The representative value is a weighted average value according to a distribution in each gradation level group.

【0020】この構成においては、各階調レベル群中の
分布に応じた加重平均値を、分割された階調レベル群に
おけるそれぞれの代表値とする。したがって、分割され
た階調レベル群における一番平均的な値を代表値として
決定することができる。
In this configuration, a weighted average value according to the distribution in each gradation level group is set as a representative value in each of the divided gradation level groups. Therefore, the most average value in the divided gradation level group can be determined as the representative value.

【0021】(6) 前記代表値は、各階調レベル群中の中
心値であることを特徴とする。
(6) The representative value is a center value in each gradation level group.

【0022】この構成においては、各階調レベル群中の
中心値を、分割された階調レベル群におけるそれぞれの
代表値とする。したがって、簡単な演算で代表値として
決定することが可能となる。
In this configuration, the center value in each gradation level group is set as a representative value in each of the divided gradation level groups. Therefore, it can be determined as a representative value by a simple calculation.

【0023】(7) 前記代表値は、各階調レベル群中の最
大頻度値であることを特徴とする。この構成において
は、各階調レベル群中の最大頻度値を、分割された階調
レベル群におけるそれぞれの代表値とする。したがっ
て、一番頻度の高い値を代表値として選択するだけで簡
単に決定でき、なおかつ、分割された階調レベル群の代
表値として妥当な値とすることが可能となる。
(7) The representative value is a maximum frequency value in each gradation level group. In this configuration, the maximum frequency value in each gradation level group is set as a representative value in each of the divided gradation level groups. Therefore, it is possible to easily determine the value by selecting only the most frequent value as the representative value, and furthermore, it is possible to make the value appropriate as the representative value of the divided gradation level group.

【0024】(8) 前記代表値は、変換された新しい階調
の画像データに付加されることを特徴とする。
(8) The representative value is added to the converted new gradation image data.

【0025】この構成においては、変換された新しい階
調の画像データに、分割された階調レベル群におけるそ
れぞれの代表値は付加される。したがって、本来の輝度
と変換後の階調値の輝度との関係を付加しておくことに
よって、コントラストを変えることなく、各出力装置に
適した色空間上に再変換できるようになる。
In this configuration, each representative value in the divided gradation level group is added to the converted new gradation image data. Therefore, by adding the relationship between the original luminance and the luminance of the converted gradation value, it is possible to re-convert to a color space suitable for each output device without changing the contrast.

【0026】(9) 変換された色空間の色度座標値を用
い、各画素の座標上における原点からの距離から有彩色
または無彩色と判断し、各画素の座標上におけるお互い
の位置関係から同類色か否かを判断してグループ化する
ことで、前記色の分布状態を検出することを特徴とす
る。
(9) Using the chromaticity coordinate values of the converted color space, it is determined that the pixel is a chromatic color or an achromatic color based on the distance from the origin on the coordinates of each pixel. The color distribution state is detected by determining whether the colors are similar or not and grouping the colors.

【0027】この構成においては、色の分布状態を検出
するために、変換された色空間の色度座標上における各
画素の原点からの距離によって有彩色または無彩色と判
断し、座標上における各画素のお互いの位置関係から同
類色か否かを判断してグループ化する。したがって、色
度座標上における原点からの距離とお互いの位置関係と
から容易に有彩色、無彩色及び同類色を判別することが
可能となる。
In this configuration, in order to detect a color distribution state, each pixel is determined to be chromatic or achromatic according to the distance from the origin of each pixel on the chromaticity coordinates of the converted color space, and each pixel on the coordinates is determined. The pixels are grouped by judging whether or not the pixels have the same color based on the mutual positional relationship between the pixels. Therefore, chromatic colors, achromatic colors, and similar colors can be easily determined from the distance from the origin on the chromaticity coordinates and the mutual positional relationship.

【0028】(10)各画素において、色度座標上における
原点からのユークリッド距離が第1の規定値以下である
場合は無彩色と判断し、原点からのユークリッド距離が
該第1の規定値よりも離れている場合は有彩色と判断す
ることを特徴とする。
(10) In each pixel, when the Euclidean distance from the origin on the chromaticity coordinates is equal to or smaller than a first specified value, it is determined that the pixel is achromatic, and the Euclidean distance from the origin is smaller than the first specified value. If they are separated from each other, the color is determined to be chromatic.

【0029】この構成においては、各画素の変換された
色空間の色度座標上における原点からのユークリッド距
離が第1の規定値以下である場合は無彩色と判断し、各
画素の原点からのユークリッド距離が第1の規定値より
も離れている場合は有彩色と判断する。したがって、簡
単な方法で無彩色と有彩色の区別を付けることができ、
また、色の違いがさほど目につかない程度に色のグルー
プ化が可能となる。
In this configuration, when the Euclidean distance from the origin on the chromaticity coordinates of the converted color space of each pixel is equal to or less than the first specified value, it is determined that the pixel is an achromatic color, and the position of each pixel from the origin is determined. If the Euclidean distance is longer than the first specified value, it is determined that the color is chromatic. Therefore, you can easily distinguish between achromatic and chromatic colors,
In addition, it is possible to group colors so that the difference in color is not so noticeable.

【0030】(11)各画素間の色度座標上における原点か
らのユークリッド距離が第2の規定値以下である場合は
同類色と判断することを特徴とする。
(11) When the Euclidean distance from the origin on the chromaticity coordinates between the pixels is equal to or less than a second specified value, it is determined that the pixels are of the same color.

【0031】この構成においては、各画素間の色度座標
上における原点からのユークリッド距離が第2の規定値
以下であると、各画素を同類色と判断する。したがっ
て、簡単な方法で同類色と非同類色の区別を付けること
ができる。
In this configuration, if the Euclidean distance from the origin on the chromaticity coordinates between the pixels is equal to or smaller than the second specified value, the pixels are determined to be of the same color. Therefore, similar colors and non-similar colors can be distinguished by a simple method.

【0032】(12)局所領域の各画素と近傍画素の輝度と
の差を求め、その差の分布を調べることにより、前記エ
ッジの有無を検出することを特徴とする。
(12) The method is characterized in that the difference between the luminance of each pixel in the local area and the luminance of the neighboring pixels is obtained, and the presence or absence of the edge is detected by examining the distribution of the difference.

【0033】この構成においては、エッジの有無は、局
所領域の各画素と近傍画素との輝度差の分布を調べるこ
とで検出する。したがって、局所領域の各画素と近傍画
素との間に輝度差があり、その輝度差が連続していれ
ば、そこにはエッジが存在することになるので、これに
よりエッジの有無を判断することが可能となる。
In this configuration, the presence or absence of an edge is detected by examining the distribution of the luminance difference between each pixel in the local area and the neighboring pixels. Therefore, there is a luminance difference between each pixel in the local region and a neighboring pixel, and if the luminance difference is continuous, an edge exists there. Becomes possible.

【0034】(13)注目画素を含む周辺画素が無彩色かつ
注目画素の階調値が1つの階調レベル群にのみ属する場
合、該階調レベル群の階調値を選択することを特徴とす
る。この構成においては、注目画素を含む周辺画素が無
彩色で注目画素の階調値が1つの階調レベル群にのみ属
する場合は、階調値として、この階調レベル群の階調値
を選択する。したがって、無彩色の場合には色ずれは関
係ないので、単純に階調値を選択することが可能とな
る。
(13) When the peripheral pixels including the target pixel are achromatic and the gradation value of the target pixel belongs to only one gradation level group, the gradation value of the gradation level group is selected. I do. In this configuration, when the peripheral pixels including the target pixel are achromatic and the gradation value of the target pixel belongs to only one gradation level group, the gradation value of this gradation level group is selected as the gradation value. I do. Therefore, in the case of an achromatic color, there is no relation to color shift, and it is possible to simply select a gradation value.

【0035】(14)注目画素を含む周辺画素が無彩色かつ
注目画素の階調値が2つの階調レベル群に属する場合、
エッジが有る時は2つの新しい階調レベルから階調差が
大きくなる方の階調値を選択し、エッジが無い時は2つ
の新しい階調レベルから周辺の新しい階調レベルに近い
方の階調値を選択することを特徴とする。
(14) When the peripheral pixels including the target pixel are achromatic and the gradation values of the target pixel belong to two gradation level groups,
When there is an edge, the tone value with the larger tone difference is selected from the two new tone levels, and when there is no edge, the tone value closer to the neighboring new tone levels from the two new tone levels is selected. The method is characterized in that a key value is selected.

【0036】この構成においては、注目画素を含む周辺
画素が無彩色で注目画素の階調値が2つの階調レベル群
に属する場合、エッジが有ると2つの新しい階調レベル
から階調差が大きくなる方の階調値を選択し、エッジが
無いと2つの新しい階調レベルから周辺の新しい階調レ
ベルに近い方の階調値を選択する。したがって、無彩色
の場合には、色ずれは関係ないので、2つの階調レベル
群に属するときには、エッジの有無だけによって、最適
な階調値を選択することが可能となる。
In this configuration, when the peripheral pixels including the target pixel are achromatic and the gradation values of the target pixel belong to two gradation level groups, if there is an edge, the gradation difference from the two new gradation levels is obtained. The larger gradation value is selected, and if there is no edge, the gradation value closer to the surrounding new gradation levels is selected from the two new gradation levels. Therefore, in the case of an achromatic color, there is no relationship between color shifts. Therefore, when the color belongs to two gradation level groups, an optimum gradation value can be selected only by the presence or absence of an edge.

【0037】(15)注目画素を含む周辺画素が有彩色かつ
注目画素の階調値が1つの階調レベル群にのみ属する場
合、該階調レベル群の階調値を新しい階調値として選択
し、注目画素を含む周辺画素が有彩色かつ注目画素の階
調値が2つの階調レベル群に属する場合、エッジの有無
及び同類色の有無に応じて階調値を選択することを特徴
とする。
(15) If the peripheral pixels including the target pixel are chromatic and the gray level of the target pixel belongs to only one gray level group, the gray level of the gray level group is selected as a new gray level. When the peripheral pixel including the target pixel is a chromatic color and the grayscale value of the target pixel belongs to two grayscale levels, the grayscale value is selected in accordance with the presence / absence of an edge and the presence / absence of a similar color. I do.

【0038】この構成においては、注目画素を含む周辺
画素が有彩色で注目画素の階調値が1つの階調レベル群
にのみ属する場合は、この階調レベル群の階調値を新し
い階調値として選択する。また、注目画素を含む周辺画
素が有彩色で注目画素の階調値が2つの階調レベル群に
属する場合は、エッジの有無及び同類色の有無に応じて
階調値を選択する。したがって、有彩色の場合には、色
ずれも関係するので、エッジの有無だけでなく、同類色
であるかどうかも調べることで、それぞれ最適な階調値
を選択することが可能となる。
In this configuration, when the peripheral pixels including the target pixel are chromatic and the gradation value of the target pixel belongs to only one gradation level group, the gradation value of this gradation level group is changed to a new gradation level. Select as a value. When the peripheral pixel including the target pixel is a chromatic color and the target pixel belongs to two gradation level groups, the gradation value is selected according to the presence or absence of an edge and the presence or absence of a similar color. Therefore, in the case of a chromatic color, since a color shift is also involved, it is possible to select an optimum tone value by checking not only the presence or absence of an edge but also whether or not the color is the same.

【0039】(16)注目画素を含む周辺画素が有彩色かつ
注目画素の階調値が2つの階調レベル群に属する場合、
エッジが有る時には2つの新しい階調レベルから階調差
が大きくなる方の階調値を選択し、エッジが無い時には
注目画素がその周辺画素と同類色であるか否かを調べ、
同類色で無い場合には2つの新しい階調レベルから階調
差が大きくなる方の階調値を選択し、同類色である場合
には2つの新しい階調レベルから周辺の新しい階調レベ
ルに近い方の階調値を選択することを特徴とする。
(16) When the peripheral pixels including the pixel of interest are chromatic and the gradation values of the pixel of interest belong to two gradation level groups,
When there is an edge, a tone value with a larger tone difference is selected from the two new tone levels, and when there is no edge, it is checked whether or not the pixel of interest is the same color as its surrounding pixels,
If the colors are not the same, select the gradation value with the larger gradation difference from the two new gradation levels, and if the colors are the same, change the two new gradation levels to the surrounding new gradation levels. It is characterized in that a nearer gradation value is selected.

【0040】この構成においては、注目画素を含む周辺
画素が有彩色で注目画素の階調値が2つの階調レベル群
に属する場合は、エッジが有ると2つの新しい階調レベ
ルから階調差が大きくなる方の階調値を選択し、エッジ
が無いと注目画素がその周辺画素と同類色であるか否か
を調べ、同類色で無いと2つの新しい階調レベルから階
調差が大きくなる方の階調値を選択し、同類色であると
2つの新しい階調レベルから周辺の新しい階調レベルに
近い方の階調値を選択する。したがって、有彩色の場合
には、色ずれや色による疑似階調も関係するので、エッ
ジの有無と同類色の有無を調べて疑似階調が発生しにく
いような階調値を選択することが可能となる。
In this configuration, if the peripheral pixel including the target pixel is a chromatic color and the target pixel belongs to two gray level groups, if there is an edge, the gray level difference from the two new gray levels is obtained. Is selected, and if there is no edge, it is checked whether or not the pixel of interest is of the same color as its surrounding pixels. If not, the difference between the two new gray levels is large. The tone value that is closer is selected, and if the color is the same, the tone value closer to the surrounding new tone level is selected from the two new tone levels. Therefore, in the case of a chromatic color, a pseudo tone due to a color shift or a color is also involved. Therefore, it is necessary to examine the presence or absence of an edge and a similar color to select a tone value at which a pseudo tone is hardly generated. It becomes possible.

【0041】(17)入力装置から入力された複数階調のカ
ラー画像データを該カラー画像データよりも少ない階調
数かつ少ないデータ量のカラー画像データに変換し、出
力装置に出力する画像処理装置において、該入力装置か
ら入力された画像データに対して、色変換処理を行う色
変換処理部と、該色変換処理部で変換された色空間上で
階調レベルのヒストグラムを求め、ヒストグラム上の階
調値の分布状態に従って新しい階調レベルを決定する階
調レベル決定部と、画像データを局所領域に分割し、局
所領域毎に色の分布状態を検出する色情報検出部と、画
像データを局所領域に分割し、局所領域毎にエッジの有
無を検出するエッジ検出部と、該色情報検出部と該エッ
ジ検出部との検出結果に基づいて該階調レベル決定部の
決定した新しい階調レベルから階調値を選択して該出力
装置へ出力する階調値選択部とを備えたことを特徴とす
る。
(17) An image processing apparatus which converts color image data of a plurality of gradations input from an input device into color image data having a smaller number of gradations and a smaller data amount than the color image data, and outputting the color image data to an output device. A color conversion processing section for performing color conversion processing on the image data input from the input device; and obtaining a histogram of gradation levels in the color space converted by the color conversion processing section. A tone level determining unit that determines a new tone level according to a tone value distribution state, a color information detecting unit that divides image data into local areas, and detects a color distribution state for each local area, An edge detection unit that divides the image into local regions and detects the presence or absence of an edge for each local region; and a new gradation determined by the gradation level determination unit based on detection results of the color information detection unit and the edge detection unit. And a gradation value selecting section for selecting a gradation value from the level and outputting the selected gradation value to the output device.

【0042】この構成においては、画像処理装置は、色
変換処理部と、階調レベル決定部と、色情報検出部と、
エッジ検出部と、階調値選択部とを備え、入力装置から
入力された画像データに対して、色変換処理部で色変換
処理を行い、階調レベル決定部で色変換処理部において
変換された色空間上で階調レベルのヒストグラムを求め
て、ヒストグラム上の階調値の分布状態に従って新しい
階調レベルを決定し、色情報検出部で画像データを局所
領域に分割して、局所領域毎に色の分布状態を検出し、
エッジ検出部で画像データを局所領域に分割して、局所
領域毎にエッジの有無を検出し、階調値選択部で色情報
検出部とエッジ検出部との検出結果に基づいて階調レベ
ル決定部の決定した新しい階調レベルから階調値を選択
して、出力装置へ出力する。したがって、画像全体のヒ
ストグラムの分布状態から階調レベルの決定を行い、ま
た、局所領域の色の分布状態、及びエッジの有無を検出
し、それぞれの結果から前記階調レベルより最適な階調
値を決定することにより、色ずれや疑似階調などが無
く、画質劣化の少ない階調数変換を行う画像処理装置が
実現可能となる。
In this configuration, the image processing apparatus includes a color conversion processing section, a gradation level determination section, a color information detection section,
The image processing apparatus includes an edge detection unit and a gradation value selection unit, performs color conversion processing on image data input from the input device in the color conversion processing unit, and converts the image data in the color conversion processing unit in the gradation level determination unit. A histogram of the gradation level is obtained in the color space obtained, a new gradation level is determined in accordance with the distribution state of the gradation values on the histogram, and the image data is divided into local regions by the color information detecting unit, and each local region is To detect the color distribution,
The image data is divided into local regions by the edge detection unit, and the presence or absence of an edge is detected for each local region. The gradation value selection unit determines the gradation level based on the detection results of the color information detection unit and the edge detection unit. A tone value is selected from the new tone levels determined by the unit and output to the output device. Therefore, the gradation level is determined from the distribution state of the histogram of the entire image, and the color distribution state of the local region and the presence / absence of an edge are detected. By determining the above, it is possible to realize an image processing apparatus that performs tone number conversion without color shift and pseudo tone and with little image quality deterioration.

【0043】[0043]

【発明の実施の形態】画像処理方法である階調数変換方
法の一実施形態を図2乃至図8に基づいて説明する。図
2は、階調数変換方法の一実施形態を示す流れ図であ
る。図3は、全画素のヒストグラムを求める方法を表す
図である。図4は、新しい階調レベルを求める方法を表
す図である。図5は、無彩色領域を抽出する方法を表す
図である。図6は、有彩色領域の同類色を抽出する方法
を表す図である。図7は、エッジを抽出する方法を表す
図である。図8は、新しい輝度レベルへの変換結果を表
す図である。なお、図2では、各色8ビットのRGBカ
ラー画像データを用い、変換する色空間としてL**
* 色空間を用いる場合を示す。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of a gradation number conversion method as an image processing method will be described with reference to FIGS. FIG. 2 is a flowchart illustrating an embodiment of the gradation number conversion method. FIG. 3 is a diagram illustrating a method of obtaining a histogram of all pixels. FIG. 4 is a diagram illustrating a method for obtaining a new gradation level. FIG. 5 is a diagram illustrating a method of extracting an achromatic region. FIG. 6 is a diagram illustrating a method of extracting similar colors in a chromatic color area. FIG. 7 is a diagram illustrating a method of extracting an edge. FIG. 8 is a diagram illustrating a result of conversion to a new luminance level. In FIG. 2, RGB color image data of 8 bits for each color is used, and L * a * is used as a color space to be converted .
The case where a b * color space is used is shown.

【0044】まず、RGBのカラー画像を色変換処理し
て、RGB色空間からL***色空間に変換する
(101)。L*** 色空間は、均等色空間の1つ
であり、等しい大きさに知覚される色差が、空間内の等
しい距離に対応するように意図した色空間となってい
る。これにより、どんな色同士であっても、どのくらい
色が違うのかを平等に比較できる。
First, an RGB color image is subjected to a color conversion process to convert an RGB color space into an L * a * b * color space (101). The L * a * b * color space is one of the uniform color spaces, and is a color space intended to allow color differences perceived to be equal in size to correspond to equal distances in the space. This makes it possible to make an equal comparison of how much the colors are different, regardless of the colors.

【0045】その後、図3に示したように、画像全体の
ヒストグラムを算出するために、全画像データについ
て、輝度情報である各L* 値をカウントする(10
2)。この場合、画像の左上の画素データから右下の画
素データまでを順番にカウントする。L* は0から10
0まで1ステップずつの値で表現されるので、例えば1
01個分の配列変数領域を確保し、L* の0から100
に対応した配列変数にカウントされた値を代入してい
く。
Thereafter, as shown in FIG. 3, in order to calculate a histogram of the entire image, each L * value as luminance information is counted for all image data (10).
2). In this case, the pixel data from the upper left pixel data to the lower right pixel data of the image are counted in order. L * is from 0 to 10
Since it is expressed by the value of each step up to 0, for example, 1
01 array variable areas are secured, and L * 0 to 100
Substitute the counted value into the array variable corresponding to.

【0046】続いて、図4に示したように、全画素数を
予め定めた所定値である新しい階調数で割った値からそ
の値に一定数を加えた値までを1つの階調レベルの範囲
とし、ヒストグラム上の最大値または最小値から前記画
素分をカウントして分割する。また、直前のカウントを
終了した位置から直前のカウントの際に加えた一定数以
下の値の分だけ逆向きにカウントした位置を、次のカウ
ント開始位置として、順次カウントを行っていく(10
3)。これにより、頻度の高い階調値付近ほど細かく分
割され、逆に頻度の少ない階調値付近は広く分割される
ようになる。また、分割される部分において、隣り合う
階調同士で重なる部分ができるので、エッジの有無に応
じて階調値が選択できるようになり、各画像において階
調値の出現頻度、及び、画像の特徴に応じた階調数変換
が可能となり、画質劣化を抑えることが可能となる。
Subsequently, as shown in FIG. 4, the range from the value obtained by dividing the total number of pixels by a new predetermined number of gradations, which is a predetermined value, to a value obtained by adding a certain number to the value is one gradation level. And the pixel is counted and divided from the maximum value or the minimum value on the histogram. In addition, counting is performed sequentially from the position where the previous count was completed to the position counted in the opposite direction by a value equal to or less than a certain number added at the time of the previous count as the next count start position (10).
3). As a result, the vicinity of a frequently used tone value is finely divided, while the vicinity of a less frequently used tone value is broadly divided. Further, in the divided portion, an overlapping portion is formed between adjacent gradations, so that a gradation value can be selected according to the presence or absence of an edge, and the appearance frequency of the gradation value and the image The conversion of the number of gradations according to the feature becomes possible, and the deterioration of the image quality can be suppressed.

【0047】なお、階調レベル群の分割に際しては、画
素数のカウントを行って、ある階調値の途中で規定値に
達した場合には、カウントを開始した階調値から現在の
階調値までを1つの階調レベル群として分割する。ま
た、規定値がある階調値における画素数と同数であった
ときに、それ以降の階調値の画素数が0の場合、そのカ
ウントが無い階調値も含めて1つの階調レベル群とし
て、最後まで分割する。
In dividing the gradation level group, the number of pixels is counted, and when the specified value is reached in the middle of a certain gradation value, the current gradation is counted from the counted gradation value. The values up to the value are divided as one gradation level group. Further, when the specified value is the same as the number of pixels at a certain gradation value, if the number of pixels at the subsequent gradation values is 0, one gradation level group including the gradation value without the count is included. And divide until the end.

【0048】次に、分割された階調レベル群毎にその代
表値を算出する(104)。算出する代表値としては、
例えば、図2では階調レベル群内の加重平均値を用いて
いるが、それ以外に、階調レベル群の中心値や、最大頻
度値を用いてもよい。このようにして求められた代表値
を新しい階調レベルとして配列変数などに代入してお
く。
Next, a representative value is calculated for each of the divided gradation level groups (104). As the representative value to be calculated,
For example, in FIG. 2, a weighted average value in the gradation level group is used, but a center value of the gradation level group or a maximum frequency value may be used. The representative value obtained in this way is substituted into an array variable or the like as a new gradation level.

【0049】この新しい階調レベルの算出と並行して、
RGB色空間からL*** 色空間に変換した画像に
対して、局所画像の抽出を行う(111)。ここでは、
例として8×8画素の局所領域を抽出することとする。
In parallel with the calculation of the new gradation level,
A local image is extracted from the image converted from the RGB color space to the L * a * b * color space (111). here,
As an example, a local region of 8 × 8 pixels is extracted.

【0050】次に、抽出された局所領域の画像データに
対して2つの処理を行う。すなわち、1つは色情報の検
出、もう1つはエッジ情報の検出である。
Next, two processes are performed on the extracted image data of the local region. That is, one is detection of color information and the other is detection of edge information.

【0051】まず、色情報の検出では図5に示したよう
に、局所領域における各画素のa*及びb* の値を呼出
し、原点からのユークリッド距離D1 を以下の式で求め
る(113)。 D1 (n)=√(a*2+b*2) ‥‥(1) ここで、nは局所領域における各画素の番号とする。局
所領域が8×8画素の場合、画素数は64画素なので、
仮に左上を0としたとき、右方向に番号を付けて行き、
一番右上を7とした後、次の行の左端を8として順次番
号を付けていくと一番右下が63となる。
First, in the detection of color information, as shown in FIG. 5, the values of a * and b * of each pixel in the local area are called, and the Euclidean distance D 1 from the origin is obtained by the following equation (113). . D 1 (n) = {(a * 2 + b * 2 ) } (1) Here, n is the number of each pixel in the local area. If the local area is 8 × 8 pixels, the number of pixels is 64, so
Assuming that the upper left is 0, numbering is done in the right direction,
After the top right is set to 7 and the left end of the next line is numbered sequentially to 8, the bottom right becomes 63.

【0052】そして、画素毎に、この値が第1の規定値
を超えているかどうかを判断し、有彩色か無彩色かを判
断する。例えば、ユークリッド距離が30以下である場
合には無彩色、30よりも大きいときは有彩色と判断す
ることに決めておく。
Then, for each pixel, it is determined whether or not this value exceeds a first specified value, and it is determined whether the color is chromatic or achromatic. For example, when the Euclidean distance is 30 or less, it is determined that the color is determined to be achromatic, and when it is greater than 30, it is determined to be chromatic.

【0053】次に、図6に示したように、a* −b*
面において、隣接画素間のユークリッド距離を求める
(114)。最初に、局所領域内の各画素に対して順番
に、上下左右の隣接画素とのユークリッド距離D2 を以
下の式により求める。
Next, as shown in FIG. 6, the Euclidean distance between adjacent pixels on the a * -b * plane is determined (114). First, in order for each pixel in the local region, obtained by the following equation Euclidean distance D 2 between the upper and lower left and right adjacent pixels.

【0054】 D2 (n1 ,n2 )=√((a1 * −a2 *2 +(b1 * −b2 *2 ) ‥‥(2) 式(2)において、(a1 * ,b1 * )は注目画素の色
度座標値を表す。また、(a2 * ,b2 * )はその他の
画素の色度座標値を表す。さらに、n1 は注目画素の番
号を表し、n2 はその他の画素の番号を表す。
D 2 (n 1 , n 2 ) = {((a 1 * −a 2 * ) 2 + (b 1 * −b 2 * ) 2 ) } (2) In the equation (2), (a) 1 * , b 1 * ) represent the chromaticity coordinate values of the pixel of interest. (A 2 * , b 2 * ) represents the chromaticity coordinate values of the other pixels. Further, n 1 represents the number of the target pixel, and n 2 represents the numbers of the other pixels.

【0055】局所領域が8×8画素の場合、D2 (0,
1)、D2 (0,2)、‥‥‥‥、D2 (0,8)、D
2 (1,9)、‥‥‥、D2 (8,9)、D2 (9,1
0)、‥‥‥‥、D2 (61,62)、D2 (62,6
3)となり、全部で112個のユークリッド距離を求め
ることになる。
When the local area is 8 × 8 pixels, D 2 (0,
1), D 2 (0, 2), ‥‥‥‥, D 2 (0, 8), D
2 (1, 9), ‥‥‥, D 2 (8, 9), D 2 (9, 1
0), ‥‥‥‥, D 2 (61, 62), D 2 (62, 6)
3), and a total of 112 Euclidean distances are obtained.

【0056】そして、画素毎にこの値が第2の規定値を
超えているかどうかを判断し、同類色かどうかを判断す
る(114)。例えば、ユークリッド距離が10以下で
ある場合には同類色であり、10よりも大きいときは同
類色では無いと判断することに決めておく。このように
して、色情報の検出を行っていく。
Then, it is determined whether or not this value exceeds the second specified value for each pixel, and it is determined whether or not the pixel is of the same color (114). For example, when the Euclidean distance is 10 or less, it is determined that the color is the same color, and when the distance is more than 10, it is determined that the color is not the same color. In this way, color information is detected.

【0057】もう1つのエッジ情報の検出では図7に示
したように、まず、局所領域における各画素のL* の値
を呼出し、今度は各画素における各近傍画素との輝度差
を以下の式で求める(121)。
In the detection of another edge information, as shown in FIG. 7, first, the value of L * of each pixel in the local area is called, and the luminance difference between each pixel and each neighboring pixel is calculated by the following equation. (121).

【0058】 dL(1)=dL(9)=P(x,y)−P(x−1,y−1) dL(2)=P(x,y)−P(x,y−1) dL(3)=P(x,y)−P(x+1,y−1) dL(4)=P(x,y)−P(x+1、y) ‥‥(3) dL(5)=P(x,y)−P(x+1、y+1) dL(6)=P(x,y)−P(x,y+1) dL(7)=P(x,y)−P(x−1、y+1) dL(8)=dL(0)=P(x,y)−P(x−1,y) そして、このdL(1)〜dL(8)において、それぞ
れの値のうち、ある一定値以上のものを抽出し、その前
後の結果との比較を行う(121)。例えば、dL
(3)が一定値を超えていた場合、dL(2)とdL
(4)とが、dL(3)とどのくらい違うかを比較する
ことになる。dL(2)との差とdL(4)との差がそ
れぞれ一定の範囲内であれば、その方向にエッジが存在
することになる。このようにして、画素毎に、近傍画素
の輝度の差を求め、その差の分布を調べることによっ
て、エッジの有無とエッジの方向を検出しておく。
DL (1) = dL (9) = P (x, y) −P (x−1, y−1) dL (2) = P (x, y) −P (x, y−1) dL (3) = P (x, y) -P (x + 1, y-1) dL (4) = P (x, y) -P (x + 1, y) (3) dL (5) = P ( x, y) -P (x + 1, y + 1) dL (6) = P (x, y) -P (x, y + 1) dL (7) = P (x, y) -P (x-1, y + 1) dL (8) = dL (0) = P (x, y) -P (x-1, y) And, among the values of dL (1) to dL (8), those having a certain value or more Is extracted and compared with the results before and after (121). For example, dL
If (3) exceeds a certain value, dL (2) and dL
(4) is compared with dL (3). If the difference between dL (2) and dL (4) is within a certain range, an edge exists in that direction. In this way, the presence or absence of an edge and the direction of the edge are detected in advance for each pixel by determining the difference in luminance between neighboring pixels and examining the distribution of the difference.

【0059】そして、図8に示したように、色情報検出
とエッジ情報検出の2つの検出結果から局所領域におけ
る各画素の新しい階調値を前記配列変数などに代入して
おいた新しい階調レベルから選択する(131)。これ
により、分割された階調レベル群毎の代表値が新しい階
調の画像データに付加されることとなる。図8では、輝
度値100レベルのものを16レベルに変換する例を示
している。
Then, as shown in FIG. 8, a new gradation value of each pixel in the local area is substituted into the array variable or the like from two detection results of color information detection and edge information detection. Select from levels (131). As a result, the representative value of each divided gradation level group is added to the new gradation image data. FIG. 8 shows an example in which a luminance value of 100 levels is converted into 16 levels.

【0060】ここで、新しい階調値を選択する方法とし
て、注目画素を含む周辺画素が無彩色で、注目画素の階
調値が2つの階調レベル群に属さずに、1つの階調レベ
ル群にのみ属する場合、その階調レベル群の階調値を選
択する。また、注目画素の階調値が2つの階調レベル群
に属する場合、エッジの有無に応じて、エッジのある時
には、よりエッジ部で階調差が出るように2つの新しい
階調レベルから階調差が大きくなる方の階調値を選択す
る。一方、エッジの無い場合には、2つの新しい階調レ
ベルから周辺の新しい階調レベルに近い方の階調値を選
択する。
Here, as a method of selecting a new gradation value, the peripheral pixels including the target pixel are achromatic, and the gradation value of the target pixel does not belong to the two gradation level groups, but one gradation level. If it belongs to only the group, the gradation value of the gradation level group is selected. Further, when the gradation value of the target pixel belongs to two gradation level groups, depending on the presence / absence of an edge, when there is an edge, the gradation value is increased from two new gradation levels so that a gradation difference appears at an edge portion. Select the tone value with the larger difference. On the other hand, if there is no edge, a tone value closer to the new tone levels in the vicinity is selected from the two new tone levels.

【0061】注目画素を含む周辺画素が有彩色で、注目
画素の階調値が2つの階調レベル群に属さず1つの階調
レベル群に属する場合は、その階調レベル群の階調値を
選択する。また、注目画素の階調値が2つの階調レベル
群に属する場合、エッジの有無に応じて、エッジのある
時には、よりエッジ部で階調差が出るように、2つの新
しい階調レベルから階調差が大きくなる方の階調値を選
択する。一方、エッジの無い時には、注目画素がその周
辺画素と同類色であるかを調べる。そして、同類色で無
い場合には、より階調差が出るように2つの新しい階調
レベルから階調差が大きくなる方の階調値を選択する。
また、同類色である場合には、2つの新しい階調レベル
から周辺の新しい階調レベルに近い方の階調値を選択す
る。
When the peripheral pixel including the target pixel is a chromatic color, and the gradation value of the target pixel does not belong to two gradation level groups but belongs to one gradation level group, the gradation value of the gradation level group Select Further, when the gradation value of the pixel of interest belongs to two gradation level groups, two new gradation levels are set according to the presence / absence of an edge so that when there is an edge, a gradation difference appears at an edge portion. Select the gradation value with the larger gradation difference. On the other hand, when there is no edge, it is checked whether the target pixel has the same color as the surrounding pixels. If the colors are not the same, the tone value with the larger tone difference is selected from the two new tone levels so that the tone difference is greater.
If the colors are the same, a tone value closer to the new tone levels in the vicinity is selected from the two new tone levels.

【0062】このようにして全画像分の局所領域につい
て同様の処理を繰り返し行い、全画素の処理が終了した
時点で出力用の画像となる(132)。この出力用の画
像はシステム上で、例えば8ビットのデータに固定され
ているとすると、まず、その画像データの前にヘッダ部
分が存在し、このヘッダ部分には新しい階調レベルがイ
ンデックスデータとして挿入されている。具体的には、
新しい階調レベルが、例えば16レベルの場合、その値
に1を加えたデータサイズがヘッダに割り当てられ、新
しい階調レベル数、及び、新しい階調レベルに対応する
元の階調レベルにおける値が順番に入っている。
In this way, the same processing is repeated for the local area for all the images, and when the processing for all the pixels is completed, the image is output (132). Assuming that the output image is fixed to, for example, 8-bit data in the system, first, a header portion exists before the image data, and a new gradation level is included in the header portion as index data. Has been inserted. In particular,
If the new gradation level is, for example, 16 levels, a data size obtained by adding 1 to the value is assigned to the header, and the number of new gradation levels and the value of the original gradation level corresponding to the new gradation level are changed. It is in order.

【0063】図8の例で言うと、ヘッダのデータは、最
初の1バイト目に16という数値が入り、続いて、0,
9,13,20,25,29,33,36,41,4
7,49,52,55,63,70,79が挿入され
る。その後には、階調変換された値に対応するインデッ
クスデータをビット表現して8ビット毎に区切ったもの
を、バイト単位で表した値が続く。
In the example of FIG. 8, the header data has a numerical value of 16 in the first byte, followed by 0,
9,13,20,25,29,33,36,41,4
7, 49, 52, 55, 63, 70 and 79 are inserted. After that, a value that expresses the index data corresponding to the gradation-converted value in bits and divides the data into units of 8 bits, followed by a byte unit, follows.

【0064】例えば、33,79,20,36,49と
いう階調値があった時、各階調値をそれぞれ対応するイ
ンデックスデータである6,15,3,7,10に置き
換える。そして、それぞれをビット単位で表すと、”0
110”,”1111”,”0011”,”011
1”,”1010”となる。これを繋げて並べると、”
01101111001101111010”となるの
で、この値を8ビット単位でもう一度区切り、”011
01111”=0x6F=111,”0011011
1”=0x37=55,‥‥としてデータ化する。これ
により、2画素分のデータが、1バイトで表せたことに
なる。このようにして、画像データを作成する。
For example, when there are gradation values of 33, 79, 20, 36, and 49, each gradation value is replaced with the corresponding index data of 6, 15, 3, 7, and 10, respectively. Then, when each is expressed in bit units, “0”
110 "," 1111 "," 0011 "," 011
1 "," 1010 ". When these are connected and arranged,"
011011111001101111010 ", the value is again divided into 8-bit units, and
01111 "= 0x6F = 111," 0011011
1 ″ = 0x37 = 55, ‥‥. This means that data for two pixels can be represented by one byte. Thus, image data is created.

【0065】次に、上記の画像処理を実行する画像処理
装置の一実施形態を説明する。図1は画像処理装置の構
成を示すブロック図である。画像処理装置2は、入力装
置1から出力された画像データを画像処理して、出力装
置3に出力する。画像処理装置2は、色変換処理部4、
階調レベル決定部5、色情報検出部6、エッジ検出部7
及び階調値選択部8を備えている。
Next, an embodiment of an image processing apparatus for executing the above image processing will be described. FIG. 1 is a block diagram illustrating a configuration of the image processing apparatus. The image processing device 2 performs image processing on the image data output from the input device 1 and outputs the processed image data to the output device 3. The image processing device 2 includes a color conversion processing unit 4,
Tone level determination unit 5, color information detection unit 6, edge detection unit 7
And a gradation value selection unit 8.

【0066】入力装置1から入力された原画像データ
は、画像処理装置2の色変換処理部4において色空間の
変換を行い、均等色空間に変換される。次いで、階調レ
ベル決定部5において均等色空間の輝度情報を用いて、
画像全体のヒストグラムを求め、さらに、求めたヒスト
グラムの分布状態から新しい階調レベルを決定するため
に、ヒストグラムを分布状態に応じた範囲で所定数に分
割する。その後、分割されたヒストグラムの範囲毎に新
しい階調レベルを決定する。色情報検出部6では画像デ
ータを局所領域に分割し、局所領域毎に、均等色空間の
色度情報を用いて色の分布状態を検出する。同様に、エ
ッジ検出部7でも、局所領域毎に、輝度情報を用いてエ
ッジの有無を検出する。階調値選択部8では、これらの
検出結果に応じて、局所領域の画素毎に最適な階調値を
新しい階調レベルから選択する。また、局所領域毎に画
像全体の処理が終わるまで順次検出と階調値決定を行
い、最後に出力画像として出力装置3に出力する。出力
装置3では、階調値選択部8から出力された画像データ
のヘッダ部分の情報をもとに、出力装置3に合った色空
間へ変換を行い、出力処理を行う。
The original image data input from the input device 1 is converted into a uniform color space by the color conversion in the color conversion processing section 4 of the image processing device 2. Next, using the luminance information of the uniform color space in the gradation level determination unit 5,
The histogram of the entire image is obtained, and further, in order to determine a new gradation level from the obtained distribution state of the histogram, the histogram is divided into a predetermined number within a range corresponding to the distribution state. Thereafter, a new gradation level is determined for each of the divided ranges of the histogram. The color information detection unit 6 divides the image data into local areas, and detects the color distribution state using chromaticity information in a uniform color space for each local area. Similarly, the edge detection unit 7 detects the presence or absence of an edge using luminance information for each local region. The gradation value selection unit 8 selects an optimum gradation value for each pixel in the local area from a new gradation level according to these detection results. Further, detection and gradation value determination are sequentially performed until the processing of the entire image is completed for each local region, and finally, the output image is output to the output device 3. The output device 3 performs conversion to a color space suitable for the output device 3 based on the information of the header portion of the image data output from the tone value selection unit 8, and performs output processing.

【0067】続いて、上記階調値変換方法を用いた画像
処理装置2の各部について具体的な実施例を用いて詳細
に説明する。図9は、RGB、LABのテーブルデータ
を表す図である。図10は、選択されたテーブルデータ
と変換対象データの関係を表す図である。
Next, each part of the image processing apparatus 2 using the above-described gradation value conversion method will be described in detail using specific embodiments. FIG. 9 is a diagram illustrating table data of RGB and LAB. FIG. 10 is a diagram illustrating a relationship between the selected table data and the conversion target data.

【0068】ここでは例として、入力画像として512
×512画素の画像サイズで各色8ビットのRGBカラ
ーデータを用い、変換する色空間としてL***
空間を用いる例を示す。
Here, as an example, it is assumed that 512
An example will be described in which 8-bit RGB color data is used for each color with an image size of × 512 pixels and an L * a * b * color space is used as a color space to be converted.

【0069】まず、色変換処理部4では、入力されたR
GBデータをL*** データに変換する。RGB色
空間のデータをL*** 色空間に変換するために
は、予め、RGB色空間とL*** 色空間との関係
をいくつかの代表色についてテーブル化しておき、入力
画素値に近い代表色のテーブルデータを用いて補間演算
を行うことにより色空間の変換が行える。このため、R
GB色空間において、R値、G値、B値のそれぞれが一
定間隔値毎に並ぶように代表色を選択する。そして、そ
れをカラーパッチとしてL*** 表色系で測色して
おき、図9に示すようなルックアップテーブルとしてメ
モリに格納しておく。
First, in the color conversion processing section 4, the input R
Convert GB data to L * a * b * data. To convert the data in the RGB color space to L * a * b * color space, preliminarily a table the relationship between the RGB color space and the L * a * b * color space for a number of representative colors, The color space can be converted by performing an interpolation operation using table data of a representative color close to the input pixel value. Therefore, R
In the GB color space, the representative color is selected such that the R value, the G value, and the B value are arranged at regular intervals. Then, the color patch is measured in the L * a * b * color system as a color patch, and stored in a memory as a look-up table as shown in FIG.

【0070】具体的に説明すると、例えば、RGB色空
間における座標が(r,g,b)で表される入力画素の
データをL*** 色空間のデータに色変換する場
合、上記入力画素値に最も近い代表色を選択する。上記
代表色は、RGBの各色を軸とする3次元空間を均等間
隔で区切って得られる立方体の頂点に対応する点であ
る。図10に示したように、入力画素値を点p(r,
g,b)で表した場合、点pをその内部に含む立方体の
各頂点p000 ,p111 が代表色として選択される。ここ
で、(r,g,b)=(150,104,32)である
とすると、図9のテーブルデータに基づけば、上記点p
000 −p111 の座標において、r0 =128,r1 =1
92,g0 =64,g1 =128,b0 =0,b1 =6
4である。
More specifically, for example, when the color of the input pixel data whose coordinates in the RGB color space are represented by (r, g, b) is converted into the data of the L * a * b * color space, The representative color closest to the input pixel value is selected. The representative color is a point corresponding to a vertex of a cube obtained by dividing a three-dimensional space around each color of RGB at equal intervals. As shown in FIG. 10, the input pixel value is changed to a point p (r,
When represented by g, b), the vertices p 000 , p 111 of the cube including the point p therein are selected as the representative colors. Here, assuming that (r, g, b) = (150, 104, 32), based on the table data in FIG.
In the coordinates of 000 -p 111, r 0 = 128 , r 1 = 1
92, g 0 = 64, g 1 = 128, b 0 = 0, b 1 = 6
4.

【0071】こうして選択された各代表色のデータは、
図9に示したテーブルデータに基づいてL***
空間のデータに変換される。例えば、点p000 (r0
0 ,b0 )=(128,64,0)は、(L* ,a
* ,b* )=(61.54,13.78,61.72)
に変換される。選択された他の代表色についても同様に
色変換される。
The data of each representative color selected in this way is
The data is converted into data in the L * a * b * color space based on the table data shown in FIG. For example, the point p 000 (r 0 ,
g 0 , b 0 ) = (128,64,0) is (L * , a
* , B * ) = (61.54, 13.78, 61.72)
Is converted to The other selected representative colors are similarly converted.

【0072】そして、入力画素値の変換後のデータは、
次式(4)にて表される。なお、次式におけるqは、上
記pを色変換した後のL*** 色空間上での対応点
を示すものであり、座標(L* ,a* ,b* )で表され
る。
The converted data of the input pixel value is
It is expressed by the following equation (4). Here, q in the following equation indicates a corresponding point on the L * a * b * color space after the above p is color-converted, and is represented by coordinates (L * , a * , b * ). .

【0073】 q(L* ,a* ,b* )=c0 +c1 △r+c2 △g+c3 △b +c4 △r△g+c5 △r△b+c6 △g△b+c7 △r△g△b‥‥(4) ここで、△r=r−r0 =150−128=22, △g=g−g0 =104−64=40, △b=b−b0 =32−0=32, c0 =p000 , c1 =(p100 −p000 )/(r1 −r0 ), c2 =(p010 −p000 )/(g1 −g0 ), c3 =(p001 −p000 )/(b1 −b0 ),c4
(p110 −p010 −p100 +p000 )/[(r1 −r
0 )(g1 −g0 )], c5 =(p101 −p001 −p100 +p000 )/[(r1
−r0 )(b1 −b0 )], c6 =(p011 −p001 −p010 +p000 )/[(g1
−g0 )(b1 −b0 )], c7 =(p111 −p011 −p101 −p110 +p100 +p
001 −p000 )/[(r1 −r0 )(g1 −g0 )(b
1 −b0 )] である。これにより、RGB色空間上で(150,10
4,32)の入力画素値は、L*** 色空間上で
(72.85,8.44,69.70)の座標で表され
る。このような処理を入力画像データの全ての入力画素
について行う。
Q (L * , a * , b * ) = c 0 + c 1 Δr + c 2 Δg + c 3 Δb + c 4 Δr △ g + c 5 Δr △ b + c 6 Δg △ b + c 7 Δr △ g △ b ‥‥ (4) where, △ r = r-r 0 = 150-128 = 22, △ g = g-g 0 = 104-64 = 40, △ b = b-b 0 = 32-0 = 32, c 0 = p 000, c 1 = (p 100 -p 000) / (r 1 -r 0), c 2 = (p 010 -p 000) / (g 1 -g 0), c 3 = (p 001 −p 000 ) / (b 1 −b 0 ), c 4 =
(P 110 -p 010 -p 100 + p 000) / [(r 1 -r
0) (g 1 -g 0) ], c 5 = (p 101 -p 001 -p 100 + p 000) / [(r 1
−r 0 ) (b 1 −b 0 )], c 6 = (p 011 −p 001 −p 010 + p 000 ) / [(g 1
−g 0 ) (b 1 −b 0 )], c 7 = (p 111 −p 011 −p 101 −p 110 + p 100 + p
001 -p 000 ) / [(r 1 -r 0 ) (g 1 -g 0 ) (b
1− b 0 )]. Thereby, (150, 10) on the RGB color space
The input pixel value of (4, 32) is represented by coordinates (72.85, 8.44, 69.70) in the L * a * b * color space. Such processing is performed for all input pixels of the input image data.

【0074】階調レベル決定部5では、まず画像全体の
ヒストグラムを算出するために全画像データ分の輝度情
報である各L* 値をカウントする。この場合、画像の左
上の画素データから右下の画素データまでを順番にカウ
ントする。L* は整数値だけで表現すると0から100
まで1ステップずつの101レベルで表現される。その
ため、例えば101個分の配列変数領域を確保し、L*
の0から100に対応した配列変数アドレスにおいて、
輝度値をカウントする毎に対応するアドレスの値を順次
加算していく。
The tone level determining section 5 first counts each L * value which is luminance information for all image data in order to calculate a histogram of the entire image. In this case, the pixel data from the upper left pixel data to the lower right pixel data of the image are counted in order. L * is 0 to 100 when expressed only by integer values
Up to 101 levels, one step at a time. Therefore, for example, an array variable area for 101 pieces is secured and L *
In the array variable address corresponding to 0 to 100 of
Each time the luminance value is counted, the value of the corresponding address is sequentially added.

【0075】続いて、全画素数を予め定めた新しい階調
数で割り、その値に一定数を加えた値を1つの階調レベ
ルの範囲とし、ヒストグラム上の最大値または最小値か
ら前記画素分をカウントして分割する。また、次のカウ
ントの開始位置を前記カウントの最終画素の次画素から
前記加えた一定数以下の値を逆方向にカウントした位置
とし、順次カウントを行っていく。なお、階調レベル群
の分割に際しては、画素数のカウントを行って、ある階
調値の途中で規定値に達した場合には、カウントを開始
した階調値から現在の階調値までを1つの階調レベル群
として分割する。
Subsequently, the total number of pixels is divided by a predetermined new number of gradations, and a value obtained by adding a certain number to the value is defined as one gradation level range. Count and divide the minutes. Further, the next count start position is set as a position where the value of the added fixed number or less is counted in the reverse direction from the pixel next to the last pixel of the count, and counting is sequentially performed. At the time of dividing the gradation level group, the number of pixels is counted, and when the specified value is reached in the middle of a certain gradation value, the count from the gradation value at which counting started to the current gradation value is performed. It is divided as one gradation level group.

【0076】例えば、新しい階調数を51レベル、一定
数を1000、逆にカウントする一定数以下の値を一定
数の1/2である500とする。前記階調レベルの範囲
の値は、512×512/51+1000=6140と
なる。ここで、計算結果は小数点第一位を四捨五入して
いる。仮にL* の最小値が0だとすると、ヒストグラム
上の0から6140画素分のカウントを行い、0から6
140画素目の階調レベルまでを新しい階調レベルの1
つの範囲として設定する。そして、6141画素目から
逆にカウントする値500を引いた値である5641画
素目を次の階調レベルの開始位置として、そこから61
40画素分のカウントを開始する。これを繰り返し、新
しい階調レベル群として分割を行っていく。
For example, the new gradation number is set to 51 levels, the fixed number is set to 1000, and the value equal to or smaller than the fixed number to be counted is set to 500 which is 1/2 of the fixed number. The value of the range of the gradation level is 512 × 512/51 + 1000 = 6140. Here, the calculation result is rounded off to the first decimal place. If the minimum value of L * is 0, counting from 0 to 6140 pixels on the histogram is performed, and 0 to 6140 pixels are counted.
A new gradation level of 1 up to the gradation level of the 140th pixel
Set as one range. Then, the 5641th pixel, which is a value obtained by subtracting the value 500 to be counted in reverse from the 6141th pixel, is set as the start position of the next gradation level.
The counting for 40 pixels is started. This is repeated to perform division as a new gradation level group.

【0077】最後まで分割できたら、次に前記分割され
た階調レベル群毎にその代表値を算出する。ここで算出
する代表値として、加重平均値を用いた場合、仮に45
〜51までが1つの新しい階調レベルの範囲とし、レベ
ル45が500画素、46が2100画素、47が11
00画素、48が800画素、49が900画素、50
が500画素、51が240画素とすると、代表値は、
(45×500+46×2100+
47×1100+48×800+49×900+50×
500+51×240)/6140=47となる。ここ
で計算結果は、小数点第一位を四捨五入している。
After the division to the end, the representative value is calculated for each of the divided gradation level groups. When a weighted average value is used as the representative value calculated here, it is assumed that 45
To 51 are one new gradation level range, level 45 is 500 pixels, 46 is 2100 pixels, 47 is 11
00 pixels, 48 are 800 pixels, 49 is 900 pixels, 50
Is 500 pixels and 51 is 240 pixels, the representative value is
(45 × 500 + 46 × 2100 +
47 × 1100 + 48 × 800 + 49 × 900 + 50 ×
(500 + 51 × 240) / 6140 = 47. Here, the calculation result is rounded off to the first decimal place.

【0078】このようにして求めた代表値を、新しい階
調レベルとして予め定められたメモリアドレスに格納し
ておく。なお、代表値として中心値を用い場合では、
(51−45)/2+45=48となる。また、代表値
として最大頻度値を用いた場合、2100画素の46と
なる。
The representative value thus obtained is stored as a new gradation level at a predetermined memory address. In the case where the center value is used as the representative value,
(51−45) / 2 + 45 = 48. When the maximum frequency value is used as the representative value, the number is 46 of 2100 pixels.

【0079】次に、色情報検出部6では抽出された局所
画像毎に、色情報についての特徴抽出を行う。ここでは
局所画像領域として8×8画素の領域の一部分を例に挙
げる。最初に局所領域における各画素のa* 及びb*
値を呼出し、原点からのユークリッド距離D1 を前記
(1)式を用いて求める。
Next, the color information detecting section 6 performs feature extraction on the color information for each extracted local image. Here, a part of an 8 × 8 pixel area is taken as an example of the local image area. First calling the value of a * and b * of each pixel in a local area, Euclidean distance D 1 of the from the origin using the equation (1).

【0080】 x1 (a1 * ,b1 * )=(11,23), x2 (a2 * ,b2 * )=(39,−45), x3 (a3 * ,b3 * )=(42,−40)とすると、 D1 (x1 )=√(a1 * 2 +b1 * 2 )=25, D1 (x2 )=60, D1 (x3 )=58となる。そして、画素毎にこの値が
第1の規定値を超えているかどうかを判断し、有彩色か
無彩色かを判断する。例えば、ユークリッド距離が、3
0以下である場合には無彩色、30よりも大きいときは
有彩色と、判断することに決めておくと、x1 は無彩
色、x2 ,x3 は無彩色ということになる。
X 1 (a 1 * , b 1 * ) = (11, 23), x 2 (a 2 * , b 2 * ) = (39, −45), x 3 (a 3 * , b 3 *) ) = (42, −40), D 1 (x 1 ) = √ (a 1 * 2 + b 1 * 2 ) = 25, D 1 (x 2 ) = 60, D 1 (x 3 ) = 58 Become. Then, it is determined whether or not this value exceeds the first specified value for each pixel, and whether it is a chromatic color or an achromatic color is determined. For example, if the Euclidean distance is 3
If it is 0 or less achromatic and chromatic colors is greater than 30, the previously decided to determine, x 1 is achromatic, x 2, x 3 will be referred to as achromatic.

【0081】さらに、a* −b* 平面において、画素間
のユークリッド距離を求める。最初に局所領域内の各画
素に対して順番に、その他の画素とのユークリッド距離
2を前記(2)式により求める。すると、 D2 (x1 ,x2 )=√((a1 * −a2 *2 +(b1 * −b2 *2 ) =74, D2 (x2 ,x3 )=6, D2 (x1 ,x3 )=70となる。そして、画素毎に、
このユークリッド距離D2 が第2の規定値を超えている
かどうかを判断し、同類色か否かを判断する。
Further, the Euclidean distance between pixels on the a * -b * plane is obtained. First in order for each pixel in the local region, the Euclidean distance D 2 between the other pixel determined by the equation (2). Then, D 2 (x 1 , x 2 ) = √ ((a 1 * −a 2 * ) 2 + (b 1 * −b 2 * ) 2 ) = 74, D 2 (x 2 , x 3 ) = 6 , D 2 (x 1 , x 3 ) = 70. And for each pixel,
The Euclidean distance D 2 is to determine whether it exceeds a second predetermined value, it is determined whether similar color.

【0082】例えば、ユークリッド距離が、10以下で
ある場合には同類色、10よりも大きいときは同類色で
は無いと、判断することに決めておくと、上記3画素の
最終的な検出結果としてはx1 は無彩色、x2 とx3
有彩色で同類色ということになる。
For example, if the Euclidean distance is 10 or less, it is determined that it is not the same color when the Euclidean distance is larger than 10, it is not the same color. the x 1 is achromatic, x 2 and x 3 is the fact that similar colors in a chromatic color.

【0083】次に、エッジ検出部7では、抽出された局
所画像毎に、エッジ情報についての特徴抽出を行う。こ
こでは、局所画像領域として8×8画素の領域の一部分
を例に挙げる。
Next, the edge detection unit 7 performs feature extraction on edge information for each extracted local image. Here, a part of an area of 8 × 8 pixels is taken as an example of the local image area.

【0084】まず、局所領域における各画素のL* の値
を呼出し、今度は各画素における各近傍画素との輝度差
を前記(3)式により求める。
First, the value of L * of each pixel in the local area is called, and the luminance difference between each pixel and each neighboring pixel is obtained by the above equation (3).

【0085】L* (x0,y0),L* (x1,y
0),‥‥,L* (x6,y7),L*(x7,y7)
が図7のようになっているときに、(3)式のP(x,
y)が、L* (x1,y1)とすると、dL(1)=d
L(9)=59,dL(2)=35,dL(3)=3
5,dL(4)=4,dL(5)=13,dL(6)=
5,dL(7)=31,dL(8)=dL(0)=38
となる。
L * (x0, y0), L * (x1, y
0), ‥‥, L * (x6, y7), L * (x7, y7)
Is as shown in FIG. 7, P (x,
y) is L * (x1, y1), dL (1) = d
L (9) = 59, dL (2) = 35, dL (3) = 3
5, dL (4) = 4, dL (5) = 13, dL (6) =
5, dL (7) = 31, dL (8) = dL (0) = 38
Becomes

【0086】そして、このdL(1)〜dL(8)にお
いて、それぞれの値のうち、ある一定値以上のもの(例
えばdL(n))を抽出し、その前後の結果(dL(n
−1)及びdL(n+1))との比較を行う。
Then, of the values dL (1) to dL (8), those having a certain value or more (for example, dL (n)) are extracted from the respective values, and the results before and after (dL (n)) are extracted.
-1) and dL (n + 1)).

【0087】例えば、一定値を25以上とすると、dL
(1)が一定値を超えているので、dL(0)とdL
(2)とが、dL(1)とどのくらい違うかを比較する
ことになる。dL(0)との差とdL(2)との差が、
それぞれ一定の範囲内であれば、その方向にエッジが存
在することになる。この一定の範囲として、仮に±15
としておく。このとき、dL(0)とdL(1)との差
は21、dL(2)とdL(1)との差は24となり、
dL(2)の方向にはエッジは無いと判断する。同様に
dL(2)が一定値を超えているので、dL(1)とd
L(3)との差を比較すると、dL(1)とdL(2)
との差は24、dL(2)とdL(3)との差は0とな
り、dL(2)−dL(3)方向にエッジがあると判断
する。同様に、dL(7)−dL(8)方向にもエッジ
があると判断される。このように、画素毎に、エッジの
有無とエッジの方向を検出していく。
For example, if the fixed value is 25 or more, dL
Since (1) exceeds a certain value, dL (0) and dL
(2) is compared with dL (1). The difference between dL (0) and dL (2) is
If each is within a certain range, an edge exists in that direction. Assuming that this fixed range is ± 15
And keep it. At this time, the difference between dL (0) and dL (1) is 21, the difference between dL (2) and dL (1) is 24,
It is determined that there is no edge in the direction of dL (2). Similarly, since dL (2) exceeds a certain value, dL (1) and dL (1)
Comparing the difference with L (3), dL (1) and dL (2)
Is 24, and the difference between dL (2) and dL (3) is 0, and it is determined that there is an edge in the direction dL (2) -dL (3). Similarly, it is determined that there is an edge in the dL (7) -dL (8) direction. Thus, the presence or absence of an edge and the direction of the edge are detected for each pixel.

【0088】次に、階調値選択部8では、色情報検出と
エッジ情報検出の2つの検出結果から局所領域における
各画素の新しい階調値を前記配列変数などに代入してお
いた新しい階調レベルから選択する。
Next, the tone value selecting section 8 assigns a new tone value of each pixel in the local area to the array variable or the like from the two detection results of color information detection and edge information detection. Select from key levels.

【0089】例えば、新しい階調値を選択する方法とし
て、注目画素を含む周辺画素が無彩色の場合、注目画素
の階調値が2つの階調レベル群に属さない時は、対応す
る階調値を選択し、注目画素の階調値が2つの階調レベ
ル群に属する時は、エッジの有無に応じて、エッジがあ
る場合には、よりエッジ部で階調差が出るように2つの
新しい階調レベルから階調差が大きくなる方の階調値を
選択し、エッジが無い場合には、2つの新しい階調レベ
ルから周辺の新しい階調レベルに近い方の階調値を選択
する。
For example, as a method of selecting a new gradation value, when the peripheral pixels including the target pixel are achromatic, when the gradation value of the target pixel does not belong to the two gradation level groups, the corresponding gradation is selected. When the tone value of the pixel of interest belongs to two tone level groups, if there is an edge, two tone levels are set so that a tone difference appears at the edge portion. From the new gradation level, select the gradation value with the larger gradation difference, and if there is no edge, select the gradation value closer to the surrounding new gradation levels from the two new gradation levels. .

【0090】また、注目画素を含む周辺画素が有彩色の
場合には、注目画素の階調値が2つの階調レベル群に属
さない時は、対応する階調値を選択し、注目画素の階調
値が2つの階調レベル群に属する時は、エッジの有無に
応じて、エッジのある場合には、よりエッジ部で階調差
が出るように2つの新しい階調レベルから階調差が大き
くなる方の階調値を選択し、エッジの無い場合、注目画
素がその周辺画素と同類色であるか否かを調べる。そし
て、同類色で無い場合には、より階調差が出るように2
つの新しい階調レベルから階調差が大きくなる方の階調
値を選択し、同類色である場合には、2つの新しい階調
レベルから周辺の新しい階調レベルに近い方の階調値を
選択する。
When the peripheral pixel including the target pixel is a chromatic color, and the gradation value of the target pixel does not belong to two gradation level groups, the corresponding gradation value is selected, and When the tone value belongs to two tone level groups, the tone difference is changed from two new tone levels so that a tone difference appears at the edge part when there is an edge, depending on the presence or absence of the edge. Is selected, and if there is no edge, it is checked whether or not the pixel of interest has the same color as its surrounding pixels. If the colors are not the same, the color difference is set to 2
A tone value with a larger tone difference is selected from the two new tone levels, and if the colors are similar, a tone value closer to the neighboring new tone levels from the two new tone levels is selected. select.

【0091】このようにして全画像分の局所領域につい
て同様の処理を繰り返し行い、全画素の処理が終了した
時点で出力用の画像となる。そして、最後にこの出力用
の画像データの先頭部分にヘッダ情報として新しい階調
レベルのインデックスデータが挿入される。
In this way, the same processing is repeated for the local area of all the images, and when the processing of all the pixels is completed, the image is output. Finally, index data of a new gradation level is inserted as header information at the head of the output image data.

【0092】最後に出力装置3において、前記画像デー
タのヘッダ部分であるインデックスデータを参照し、出
力装置3に適した出力フォーマットに変換し、出力媒体
に出力する。
Finally, the output device 3 refers to the index data, which is the header portion of the image data, converts the image data into an output format suitable for the output device 3, and outputs the converted data to an output medium.

【0093】なお、本実施例においては、変換する色空
間としてL*** 色空間を用いたが、均等色空間で
あればL*** 色空間以外でも良いことは言うまで
もない。エッジ検出についても、比較する画素は近傍8
画素に限定されるものではなく、8画素以下や8画素以
上であっても構わない。
In the present embodiment, the L * a * b * color space is used as the color space to be converted. However, it goes without saying that the color space other than the L * a * b * color space may be used as long as it is a uniform color space. . For edge detection, the pixels to be compared are in the neighborhood of 8
It is not limited to pixels, and may be 8 pixels or less or 8 pixels or more.

【0094】さらに、無彩色・有彩色の判定や同類色の
判定において例に挙げた数値以外でも構わないことは言
うまでもない。また、色空間の変換方法としては、テー
ブルデータによる変換ではなく、マトリクス演算による
変換でも良く、また、テーブル変換の際の補間値を求め
る方法として、本実施形態においては、色空間を立方体
に区切ったが、三角柱や三角錐などの他の形に区切った
ものでも構わない。
Further, it goes without saying that the determination of achromatic / chromatic colors and the determination of similar colors may be other than the numerical values given in the examples. The color space may be converted not by table data but by matrix operation. In addition, in the present embodiment, the color space is divided into cubes as a method of obtaining an interpolation value at the time of table conversion. However, it may be divided into other shapes such as a triangular prism or a triangular pyramid.

【0095】以上のような階調数変換方法も用いた画像
処理方法により、色ずれや疑似階調などの問題が無く、
データ量を削減しつつ、画質劣化の少ない階調数変換が
可能となる。
By the image processing method using the above-mentioned gradation number conversion method, there is no problem such as color shift and pseudo gradation.
It is possible to reduce the amount of data and convert the number of gradations with less deterioration in image quality.

【0096】また、前記の画像処理方法を実行する画像
処理装置を用いることで、入力装置から入力された入力
画像に対して、色ずれや疑似階調などが無くデータ量を
削減しつつ画質劣化の少ない階調数変換を行い、出力装
置へ従来よりも高画質な画像を出力することができるよ
うになる。
In addition, by using an image processing apparatus that executes the above-described image processing method, the input image input from the input device is free from color shift, pseudo gradation, and the like, and is reduced in image quality while reducing the data amount. This makes it possible to perform the conversion of the number of gradations with less and output an image of higher image quality to the output device than before.

【0097】[0097]

【発明の効果】本発明によれば、以下の効果が得られ
る。
According to the present invention, the following effects can be obtained.

【0098】(1) 複数の階調を有するカラー画像データ
を、このカラー画像データよりも少ない階調数かつ少な
いデータ量のカラー画像データに変換するために、画像
データに対して色変換処理を行い、変換された色空間上
での階調レベルのヒストグラムを求め、このヒストグラ
ム上の階調値の分布状態に応じて新しい階調レベルを決
定し、また、色変換処理を行った画像データを局所領域
に分割して、局所領域毎に色の分布状態及びエッジの有
無を検出した結果に基づいて、局所領域の画素毎に新し
い階調レベルの階調値を選択するので、上記の画像処理
方法を実行することで、色ずれや疑似階調などが無く画
質劣化の少ない画像を得ることができる。
(1) In order to convert color image data having a plurality of gradations into color image data having a smaller number of gradations and a smaller data amount than the color image data, color conversion processing is performed on the image data. To obtain a histogram of the gradation levels in the converted color space, determine a new gradation level according to the distribution state of the gradation values on the histogram, and convert the image data subjected to the color conversion processing. Since the image is divided into local areas and a new gray level value is selected for each pixel of the local area based on the result of detecting the color distribution state and the presence / absence of an edge for each local area, the above-described image processing is performed. By executing the method, it is possible to obtain an image having no image quality deterioration without color shift or pseudo gradation.

【0099】(2) 均等色空間を画像データの色変換処理
後の色空間としているので、均等色空間の中心点から各
周辺画素の位置関係を容易に求めることができる。
(2) Since the uniform color space is the color space after the color conversion processing of the image data, the positional relationship of each peripheral pixel can be easily obtained from the center point of the uniform color space.

【0100】(3) 画像全体の輝度情報からヒストグラム
を作成し、所定の新しい階調数と各階調値の頻度とに応
じて複数に分割された階調レベル群から、それぞれの代
表値を決定することによって新しい階調レベルを決定す
るため、各階調値の頻度に応じて新しい階調値を決定す
るので、画像の階調特性に応じた階調数の削減が実行で
きる。
(3) A histogram is created from the luminance information of the entire image, and respective representative values are determined from a plurality of divided gradation level groups according to a predetermined new number of gradations and the frequency of each gradation value. By doing so, a new gradation level is determined, so that a new gradation value is determined according to the frequency of each gradation value, so that the number of gradations can be reduced according to the gradation characteristics of the image.

【0101】(4) 1つの階調レベルの範囲を、画像デー
タの全画素数を新しい階調レベルの階調数で割った値に
一定数を加えた値の画素数分とし、この画素数分をヒス
トグラム上の階調値の最大値または最小値からカウント
し、直前のカウントの最終位置から一定数以下の所定の
値を逆向きにカウントした位置から次のカウントを開始
して、順次カウントを行い、画素数分の階調値毎に分割
して、前記現在の階調レベルを複数の階調レベルに分割
することによって、頻度の高い階調値付近ほど細かく分
割され、逆に頻度の少ない階調値付近は広く分割される
ようになり、また、分割される部分において、隣り合う
階調同士で重なる部分ができるので、エッジの有無に応
じて階調値が選択できるようになり、各画像において階
調値の出現頻度、及び、画像の特徴に応じた階調数変換
が可能となり、画質劣化を抑えることができる。
(4) The range of one gradation level is the number of pixels of a value obtained by adding a fixed number to a value obtained by dividing the total number of pixels of image data by the number of gradations of the new gradation level. The minute is counted from the maximum value or the minimum value of the gradation value on the histogram, the next count starts from the position where the predetermined value less than a certain number is counted backward from the last position of the previous count, and the count is sequentially performed. Is performed, and the current gradation level is divided into a plurality of gradation levels by dividing the current gradation level into a plurality of gradation levels. In the vicinity of a small number of gradation values, the gradation is broadly divided, and in the divided portion, there is a portion where adjacent gradations overlap, so that the gradation value can be selected according to the presence or absence of an edge, Frequency of appearance of gradation values in each image In addition, the number of gradations can be converted according to the characteristics of the image, and the deterioration of the image quality can be suppressed.

【0102】(5) 各階調レベル群中の分布に応じた加重
平均値を、分割された階調レベル群におけるそれぞれの
代表値とすることによって、分割された階調レベル群に
おける一番平均的な値を代表値として決定することがで
きる。
(5) By setting the weighted average value according to the distribution in each gradation level group as a representative value in each of the divided gradation level groups, the most average value in the divided gradation level groups can be obtained. Value can be determined as a representative value.

【0103】(6) 各階調レベル群中の中心値を、分割さ
れた階調レベル群におけるそれぞれの代表値とするの
で、簡単な演算で代表値として決定することができる。
(6) Since the central value in each gradation level group is set as a representative value in each of the divided gradation level groups, it can be determined as a representative value by a simple calculation.

【0104】(7) 各階調レベル群中の最大頻度値を、分
割された階調レベル群におけるそれぞれの代表値とする
ことにより、一番頻度の高い値を代表値として選択する
だけで簡単に決定でき、なおかつ、分割された階調レベ
ル群の代表値として妥当な値とすることができる。
(7) By setting the maximum frequency value in each gradation level group as a representative value in each of the divided gradation level groups, simply selecting the value with the highest frequency as the representative value is simple. It can be determined and can be set to a value appropriate as a representative value of the divided gradation level group.

【0105】(8) 変換された新しい階調の画像データ
に、分割された階調レベル群におけるそれぞれの代表値
を付加することによって、本来の輝度と変換後の階調値
の輝度との関係を付加しておくことによって、コントラ
ストを変えることなく、各出力装置に適した色空間上に
再変換できる。
(8) By adding each representative value of the divided gradation level group to the converted new gradation image data, the relationship between the original luminance and the luminance of the converted gradation value is obtained. Can be reconverted into a color space suitable for each output device without changing the contrast.

【0106】(9) 色の分布状態を検出するために、変換
された色空間の色度座標上における各画素の原点からの
距離によって有彩色または無彩色と判断し、座標上にお
ける各画素のお互いの位置関係から同類色か否かを判断
してグループ化するので、色度座標上における原点から
の距離とお互いの位置関係とから容易に有彩色、無彩色
及び同類色を判別することができる。
(9) In order to detect a color distribution state, each pixel is determined to be chromatic or achromatic according to the distance from the origin of each pixel on the chromaticity coordinates of the converted color space, and each pixel on the coordinates is determined. Since it is determined whether or not the colors are similar from each other based on their positional relationship, they are grouped, so it is easy to determine chromatic, achromatic, and similar colors from the distance from the origin on the chromaticity coordinates and their positional relationship. it can.

【0107】(10)各画素の変換された色空間の色度座標
上における原点からのユークリッド距離が第1の規定値
以下である場合は無彩色と判断し、各画素の原点からの
ユークリッド距離が第1の規定値よりも離れている場合
は有彩色と判断するため、簡単な方法で無彩色と有彩色
の区別を付けることができ、また、色の違いがさほど目
につかない程度に色をグループ化できる。
(10) If the Euclidean distance from the origin on the chromaticity coordinates of the converted color space of each pixel is less than or equal to the first specified value, it is determined that the pixel is achromatic, and the Euclidean distance of each pixel from the origin is determined. If it is more than the first specified value, it is determined to be a chromatic color, so it is possible to distinguish between an achromatic color and a chromatic color by a simple method. Can be grouped.

【0108】(11)各画素間の色度座標上における原点か
らのユークリッド距離が第2の規定値以下であると、各
画素を同類色と判断するので、簡単な方法で同類色と非
同類色の区別を付けることができる。
(11) If the Euclidean distance from the origin on the chromaticity coordinates between the pixels is equal to or smaller than the second specified value, each pixel is determined to be of the same color, so that the same color and non-similar color are determined by a simple method. Colors can be distinguished.

【0109】(12)エッジの有無は、局所領域の各画素と
近傍画素の輝度差の分布を調べることで検出するので、
局所領域の各画素と近傍画素との間に輝度差があり、そ
の輝度差が連続していれば、そこにはエッジが存在する
ことになるので、これによりエッジの有無を容易に判断
できる。
(12) The presence or absence of an edge is detected by examining the distribution of the luminance difference between each pixel in the local area and the neighboring pixels.
If there is a luminance difference between each pixel in the local region and a neighboring pixel, and if the luminance difference is continuous, an edge exists there, so that the presence or absence of the edge can be easily determined.

【0110】(13)注目画素を含む周辺画素が無彩色で注
目画素の階調値が1つの階調レベル群にのみ属する場合
は、階調値として、この階調レベル群の階調値を選択す
るので、無彩色の場合には色ずれは関係ないので、単純
に階調値を選択することができる。
(13) If the peripheral pixels including the target pixel are achromatic and the gradation value of the target pixel belongs to only one gradation level group, the gradation value of this gradation level group is used as the gradation value. Since the color shift does not matter in the case of an achromatic color, the gradation value can be simply selected.

【0111】(14)注目画素を含む周辺画素が無彩色で注
目画素の階調値が2つの階調レベル群に属する場合、エ
ッジが有ると2つの新しい階調レベルから階調差が大き
くなる方の階調値を選択し、エッジが無いと2つの新し
い階調レベルから周辺の新しい階調レベルに近い方の階
調値を選択するため、無彩色の場合には、色ずれは関係
ないので、2つの階調レベル群に属するときには、エッ
ジの有無だけによって、最適な階調値を選択することが
できる。
(14) When the peripheral pixel including the target pixel is an achromatic color and the gradation value of the target pixel belongs to two gradation level groups, the presence of an edge increases the gradation difference from the two new gradation levels. In the case of an achromatic color, there is no color misregistration because the grayscale value is selected, and if there is no edge, the grayscale value closer to the new grayscale level is selected from the two new grayscale levels. Therefore, when belonging to two gradation level groups, an optimum gradation value can be selected only by the presence or absence of an edge.

【0112】(15)注目画素を含む周辺画素が有彩色で注
目画素の階調値が1つの階調レベル群にのみ属する場合
は、この階調レベル群の階調値を新しい階調値として選
択し、また、注目画素を含む周辺画素が有彩色で注目画
素の階調値が2つの階調レベル群に属する場合は、エッ
ジの有無及び同類色の有無に応じて階調値を選択するの
で、有彩色の場合には、色ずれも関係するので、エッジ
の有無だけでなく、同類色であるかどうかも調べること
で、それぞれ最適な階調値を選択することができる。
(15) If the peripheral pixels including the target pixel are chromatic and the gradation value of the target pixel belongs to only one gradation level group, the gradation value of this gradation level group is set as a new gradation value. If the peripheral pixel including the pixel of interest is a chromatic color and the gradation value of the pixel of interest belongs to two gradation level groups, the gradation value is selected according to the presence / absence of an edge and the presence / absence of a similar color. Therefore, in the case of a chromatic color, a color shift is also involved, so that not only the presence or absence of an edge but also whether or not it is a similar color can be checked to select an optimum tone value for each.

【0113】(16)注目画素を含む周辺画素が有彩色で注
目画素の階調値が2つの階調レベル群に属する場合は、
エッジが有ると2つの新しい階調レベルから階調差が大
きくなる方の階調値を選択し、エッジが無いと注目画素
がその周辺画素と同類色であるか否かを調べ、同類色で
無いと2つの新しい階調レベルから階調差が大きくなる
方の階調値を選択し、同類色であると2つの新しい階調
レベルから周辺の新しい階調レベルに近い方の階調値を
選択するので、有彩色の場合には、色ずれや色による疑
似階調も関係するので、エッジの有無と同類色の有無を
調べて疑似階調が発生しにくいような階調値を選択する
ことができる。
(16) When the peripheral pixels including the target pixel are chromatic and the gradation values of the target pixel belong to two gradation level groups,
If there is an edge, a tone value with a larger tone difference is selected from the two new tone levels, and if there is no edge, it is checked whether or not the target pixel is the same color as its surrounding pixels. If there is not, select the tone value with the larger tone difference from the two new tone levels, and if it is the same color, select the tone value closer to the surrounding new tone levels from the two new tone levels Since the selection is made, in the case of a chromatic color, a pseudo tone due to color misregistration or color is also involved. Therefore, the presence or absence of an edge and the presence of a similar color are checked, and a tone value that makes it difficult to generate a pseudo tone is selected. be able to.

【0114】(17)画像処理装置は、色変換処理部と、階
調レベル決定部と、色情報検出部と、エッジ検出部と、
階調値選択部とを備え、入力装置から入力された画像デ
ータに対して、色変換処理部で色変換処理を行い、階調
レベル決定部で色変換処理部において変換された色空間
上で階調レベルのヒストグラムを求めて、ヒストグラム
上の階調値の分布状態に従って新しい階調レベルを決定
し、色情報検出部で画像データを局所領域に分割して、
局所領域毎に色の分布状態を検出し、エッジ検出部で画
像データを局所領域に分割して、局所領域毎にエッジの
有無を検出し、階調値選択部で色情報検出部とエッジ検
出部との検出結果に基づいて階調レベル決定部の決定し
た新しい階調レベルから階調値を選択して、出力装置へ
出力するため、画像全体のヒストグラムの分布状態から
階調レベルの決定を行い、また、局所領域の色の分布状
態、及びエッジの有無を検出し、それぞれの結果から前
記階調レベルより最適な階調値を決定することにより、
色ずれや疑似階調などが無く、画質劣化の少ない階調数
変換を行う画像処理装置が実現可能となる。
(17) The image processing apparatus includes a color conversion processing section, a gradation level determination section, a color information detection section, an edge detection section,
A tone value selection unit, which performs color conversion processing on image data input from the input device in a color conversion processing unit, and performs a color conversion process on a color space converted in a color conversion processing unit in a tone level determination unit. A histogram of the gradation level is obtained, a new gradation level is determined according to the distribution state of the gradation values on the histogram, and the color information detecting unit divides the image data into local regions,
The color distribution state is detected for each local area, the image data is divided into local areas by the edge detection section, the presence or absence of an edge is detected for each local area, and the color information detection section and the edge detection are detected by the gradation value selection section. To select a gradation value from the new gradation level determined by the gradation level determination unit based on the detection result with the unit and output it to the output device, the gradation level is determined from the distribution state of the histogram of the entire image. By detecting the distribution state of the color of the local region and the presence or absence of an edge, and determining an optimum gradation value from the gradation level from each result,
It is possible to realize an image processing apparatus that performs tone number conversion without color shift or pseudo tone and with little image quality deterioration.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明における画像処理装置の構成を表すブロ
ック図である。
FIG. 1 is a block diagram illustrating a configuration of an image processing apparatus according to the present invention.

【図2】本発明における階調数変換方法の一実施形態を
示す流れ図である。
FIG. 2 is a flowchart showing an embodiment of a gradation number conversion method according to the present invention.

【図3】全画素のヒストグラムを求める方法を表す図で
ある。
FIG. 3 is a diagram illustrating a method of obtaining histograms of all pixels.

【図4】新しい階調レベルを求める方法を表す図であ
る。
FIG. 4 is a diagram illustrating a method for obtaining a new gradation level.

【図5】無彩色領域を抽出する方法を表す図である。FIG. 5 is a diagram illustrating a method of extracting an achromatic region.

【図6】有彩色領域の同類色を抽出する方法を表す図で
ある。
FIG. 6 is a diagram illustrating a method of extracting similar colors in a chromatic color area.

【図7】エッジを抽出する方法を表す図である。FIG. 7 is a diagram illustrating a method of extracting an edge.

【図8】新しい輝度レベルへの変換結果を表す図であ
る。
FIG. 8 is a diagram illustrating a result of conversion to a new luminance level.

【図9】RGB、LABのテーブルデータを表す図であ
る。
FIG. 9 is a diagram illustrating table data of RGB and LAB.

【図10】選択されたテーブルデータと変換対象データ
の関係を表す図である。
FIG. 10 is a diagram illustrating a relationship between selected table data and conversion target data.

【符号の説明】[Explanation of symbols]

1−入力装置 2−画像処理装置 3−出力装置 4−色変換処理部 5−階調レベル決定部 6−色情報検出部 7−エッジ検出部 8−階調値選択部 9−変換対象データを囲むテーブルデータ 10−変換対象データ Reference Signs List 1-input device 2-image processing device 3-output device 4-color conversion processing unit 5-gradation level determination unit 6-color information detection unit 7-edge detection unit 8-gradation value selection unit 9-conversion target data Surrounding table data 10-Conversion target data

フロントページの続き Fターム(参考) 5B057 CA01 CA08 CA12 CA16 CB01 CB08 CB12 CB16 CC01 CE11 CE17 DA17 DB02 DB06 DB09 DC16 DC19 5C077 MP01 MP08 NN02 PP36 PP37 PP39 PP47 PQ08 PQ12 PQ17 PQ18 PQ19 PQ23 RR06 5C079 LA01 LA02 LA03 LA10 LA11 LA12 LA24 LA31 LB11 NA02 5L096 AA02 AA06 FA06 FA15 FA37 FA66 GA28 GA41 GA43 MA07Continued on front page F-term (reference) 5B057 CA01 CA08 CA12 CA16 CB01 CB08 CB12 CB16 CC01 CE11 CE17 DA17 DB02 DB06 DB09 DC16 DC19 5C077 MP01 MP08 NN02 PP36 PP37 PP39 PP47 PQ08 PQ12 PQ17 PQ18 PQ19 PQ23 LA01 LA10 LA01 LA01 LA10 LA01 LA10 LA01 LA10 LA01 LA31 LB11 NA02 5L096 AA02 AA06 FA06 FA15 FA37 FA66 GA28 GA41 GA43 MA07

Claims (17)

【特許請求の範囲】[Claims] 【請求項1】 複数の階調を有するカラー画像データ
を、該カラー画像データよりも少ない階調数かつ少ない
データ量のカラー画像データに変換する画像処理方法で
あって、 画像データに対して色変換処理を行い、変換された色空
間上での階調レベルのヒストグラムを求め、該ヒストグ
ラム上の階調値の分布状態に応じて新しい階調レベルを
決定するとともに、色変換処理した画像データを局所領
域に分割し、局所領域毎に色の分布状態及びエッジの有
無を検出し、その検出結果に基づいて局所領域の画素毎
に該新しい階調レベルの階調値を選択することを特徴と
する画像処理方法。
1. An image processing method for converting color image data having a plurality of gradations into color image data having a smaller number of gradations and a smaller amount of data than the color image data, comprising: A conversion process is performed to obtain a histogram of gradation levels in the converted color space, a new gradation level is determined according to the distribution state of the gradation values on the histogram, and the color-converted image data is Dividing into local areas, detecting a color distribution state and the presence or absence of an edge for each local area, and selecting the new gray level value for each pixel of the local area based on the detection result. Image processing method.
【請求項2】 画像データの色変換処理後の色空間とし
て、均等色空間を用いることを特徴とする請求項1に記
載の画像処理方法。
2. The image processing method according to claim 1, wherein a uniform color space is used as a color space after color conversion processing of the image data.
【請求項3】 画像全体の輝度情報からヒストグラムを
作成し、所定の新しい階調数と各階調値の頻度とに応じ
て現在の階調レベルを複数に分割し、分割された階調レ
ベル群からそれぞれの代表値を決めて、前記新しい階調
レベルを決定することを特徴とする請求項1に記載の画
像処理方法。
3. A histogram is created from luminance information of the entire image, and a current gradation level is divided into a plurality of parts according to a predetermined new number of gradations and a frequency of each gradation value. 2. The image processing method according to claim 1, wherein each of the representative values is determined from the following, and the new gradation level is determined.
【請求項4】 画像データの全画素数を新しい階調レベ
ルの階調数で割った値に一定数を加えた値の画素数分を
1つの階調レベルの範囲として、ヒストグラム上の階調
値の最大値または最小値から該画素数分をカウントして
分割するとともに、直前のカウントの最終位置から該一
定数以下の所定値を逆向きにカウントした位置から次の
カウントを開始して、順次カウントを行い、該画素数分
の階調値毎に分割して、前記現在の階調レベルを複数に
分割することを特徴とする請求項3に記載の画像処理方
法。
4. A gradation on a histogram, wherein the number of pixels of a value obtained by adding a fixed number to a value obtained by dividing the total number of pixels of image data by the number of gradations of a new gradation level is defined as one gradation level range. While counting and dividing the number of pixels from the maximum value or the minimum value of the value, and starting the next count from the position where the predetermined value equal to or less than the predetermined number is counted backward from the last position of the previous count, 4. The image processing method according to claim 3, wherein counting is performed sequentially, and the current gradation level is divided into a plurality of gradation values corresponding to the number of pixels.
【請求項5】 前記代表値は、各階調レベル群中の分布
に応じた加重平均値であることを特徴とする請求項3に
記載の画像処理方法。
5. The image processing method according to claim 3, wherein the representative value is a weighted average value according to a distribution in each gradation level group.
【請求項6】 前記代表値は、各階調レベル群中の中心
値であることを特徴とする請求項3に記載の画像処理方
法。
6. The image processing method according to claim 3, wherein the representative value is a center value in each gradation level group.
【請求項7】 前記代表値は、各階調レベル群中の最大
頻度値であることを特徴とする請求項3に記載の画像処
理方法。
7. The image processing method according to claim 3, wherein the representative value is a maximum frequency value in each gradation level group.
【請求項8】 前記代表値は、変換された新しい階調の
画像データに付加されることを特徴とする請求項5乃至
7のいずれかに記載の画像処理方法。
8. The image processing method according to claim 5, wherein the representative value is added to the converted new gradation image data.
【請求項9】 変換された色空間の色度座標値を用い、
各画素の座標上における原点からの距離から有彩色また
は無彩色と判断し、各画素の座標上におけるお互いの位
置関係から同類色か否かを判断してグループ化すること
で、前記色の分布状態を検出することを特徴とする請求
項1に記載の画像処理方法。
9. Using the chromaticity coordinate values of the converted color space,
By judging a chromatic or achromatic color from the distance from the origin on the coordinates of each pixel, judging whether or not they are the same color from the mutual positional relationship on the coordinates of each pixel and grouping them, the color distribution The image processing method according to claim 1, wherein the state is detected.
【請求項10】 各画素において、色度座標上における
原点からのユークリッド距離が第1の規定値以下である
場合は無彩色と判断し、原点からのユークリッド距離が
該第1の規定値よりも離れている場合は有彩色と判断す
ることを特徴とする請求項9に記載の画像処理方法。
10. In each pixel, when the Euclidean distance from the origin on the chromaticity coordinates is equal to or less than a first specified value, the pixel is determined to be achromatic, and the Euclid distance from the origin is smaller than the first specified value. The image processing method according to claim 9, wherein when it is distant, it is determined that the color is chromatic.
【請求項11】 各画素間の色度座標上における原点か
らのユークリッド距離が第2の規定値以下である場合は
同類色と判断することを特徴とする請求項9に記載の画
像処理方法。
11. The image processing method according to claim 9, wherein when the Euclidean distance from the origin on the chromaticity coordinates between the pixels is equal to or smaller than a second specified value, the pixels are determined to be similar colors.
【請求項12】 局所領域の各画素と近傍画素の輝度と
の差を求め、その差の分布を調べることにより、前記エ
ッジの有無を検出することを特徴とする請求項1に記載
の画像処理方法。
12. The image processing apparatus according to claim 1, wherein the presence or absence of the edge is detected by determining a difference between the luminance of each pixel in the local area and the luminance of a neighboring pixel, and examining the distribution of the difference. Method.
【請求項13】 注目画素を含む周辺画素が無彩色かつ
注目画素の階調値が1つの階調レベル群にのみ属する場
合、該階調レベル群の階調値を選択することを特徴とす
る請求項1に記載の画像処理方法。
13. When the peripheral pixels including the target pixel are achromatic and the gradation value of the target pixel belongs to only one gradation level group, the gradation value of the gradation level group is selected. The image processing method according to claim 1.
【請求項14】 注目画素を含む周辺画素が無彩色かつ
注目画素の階調値が2つの階調レベル群に属する場合、
エッジが有る時は2つの新しい階調レベルから階調差が
大きくなる方の階調値を選択し、エッジが無い時は2つ
の新しい階調レベルから周辺の新しい階調レベルに近い
方の階調値を選択することを特徴とする請求項1に記載
の画像処理方法。
14. When the peripheral pixels including the target pixel are achromatic and the gradation values of the target pixel belong to two gradation level groups,
When there is an edge, the tone value with the larger tone difference is selected from the two new tone levels, and when there is no edge, the tone value closer to the neighboring new tone levels from the two new tone levels is selected. The image processing method according to claim 1, wherein a tone value is selected.
【請求項15】 注目画素を含む周辺画素が有彩色かつ
注目画素の階調値が1つの階調レベル群にのみ属する場
合、該階調レベル群の階調値を新しい階調値として選択
し、注目画素を含む周辺画素が有彩色かつ注目画素の階
調値が2つの階調レベル群に属する場合、エッジの有無
及び同類色の有無に応じて階調値を選択することを特徴
とする請求項1に記載の画像処理方法。
15. When a peripheral pixel including a target pixel is a chromatic color and the target pixel belongs to only one gray level group, the gray level of the gray level group is selected as a new gray level value. When the peripheral pixel including the target pixel is a chromatic color and the target pixel belongs to two gray level groups, the gray value is selected according to the presence / absence of an edge and the presence / absence of a similar color. The image processing method according to claim 1.
【請求項16】 注目画素を含む周辺画素が有彩色かつ
注目画素の階調値が2つの階調レベル群に属する場合、
エッジが有る時には2つの新しい階調レベルから階調差
が大きくなる方の階調値を選択し、エッジが無い時には
注目画素がその周辺画素と同類色であるか否かを調べ、
同類色でない場合には2つの新しい階調レベルから階調
差が大きくなる方の階調値を選択し、同類色である場合
には2つの新しい階調レベルから周辺の新しい階調レベ
ルに近い方の階調値を選択することを特徴とする請求項
1に記載の画像処理方法。
16. When a peripheral pixel including the target pixel is a chromatic color and the gradation value of the target pixel belongs to two gradation level groups,
When there is an edge, a tone value with a larger tone difference is selected from the two new tone levels, and when there is no edge, it is checked whether or not the pixel of interest is the same color as its surrounding pixels,
If the colors are not the same, select the tone value with the larger tone difference from the two new tone levels, and if the colors are the same, the two new tone levels are closer to the surrounding new tone levels. 2. The image processing method according to claim 1, wherein one of the gradation values is selected.
【請求項17】 入力装置から入力された複数階調のカ
ラー画像データを該カラー画像データよりも少ない階調
数かつ少ないデータ量のカラー画像データに変換し、出
力装置に出力する画像処理装置において、 該入力装置から入力された画像データに対して、色変換
処理を行う色変換処理部と、該色変換処理部で変換され
た色空間上で階調レベルのヒストグラムを求め、ヒスト
グラム上の階調値の分布状態に従って新しい階調レベル
を決定する階調レベル決定部と、画像データを局所領域
に分割し、局所領域毎に色の分布状態を検出する色情報
検出部と、画像データを局所領域に分割し、局所領域毎
にエッジの有無を検出するエッジ検出部と、該色情報検
出部と該エッジ検出部との検出結果に基づいて該階調レ
ベル決定部の決定した新しい階調レベルから階調値を選
択して該出力装置へ出力する階調値選択部とを備えたこ
とを特徴とする画像処理装置。
17. An image processing apparatus for converting color image data of a plurality of gradations input from an input device into color image data having a smaller number of gradations and a smaller data amount than the color image data, and outputting the color image data to an output device. A color conversion processing unit for performing color conversion processing on the image data input from the input device; and obtaining a histogram of gradation levels in the color space converted by the color conversion processing unit. A gradation level determination unit that determines a new gradation level according to a distribution state of a tonal value, a color information detection unit that divides image data into local regions, and detects a color distribution state for each local region, An edge detection unit that divides the image into regions and detects the presence or absence of an edge for each local region; and a new floor determined by the gradation level determination unit based on detection results of the color information detection unit and the edge detection unit. The image processing apparatus characterized by comprising a gradation value selecting section that outputs from the level select the tone value to the output device.
JP2000208918A 2000-07-10 2000-07-10 Image processing method and image processing device Pending JP2002024817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000208918A JP2002024817A (en) 2000-07-10 2000-07-10 Image processing method and image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000208918A JP2002024817A (en) 2000-07-10 2000-07-10 Image processing method and image processing device

Publications (1)

Publication Number Publication Date
JP2002024817A true JP2002024817A (en) 2002-01-25

Family

ID=18705415

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000208918A Pending JP2002024817A (en) 2000-07-10 2000-07-10 Image processing method and image processing device

Country Status (1)

Country Link
JP (1) JP2002024817A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109135A (en) * 2017-12-06 2018-06-01 贵阳朗玛信息技术股份有限公司 A kind of method and device for obtaining image gray levels distribution
CN114972348A (en) * 2022-08-01 2022-08-30 山东尚雅建材有限公司 Seam beautifying effect detection method based on image processing
CN115802056A (en) * 2023-01-31 2023-03-14 南通凯沃智能装备有限公司 User data compression storage method for mobile terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109135A (en) * 2017-12-06 2018-06-01 贵阳朗玛信息技术股份有限公司 A kind of method and device for obtaining image gray levels distribution
CN114972348A (en) * 2022-08-01 2022-08-30 山东尚雅建材有限公司 Seam beautifying effect detection method based on image processing
CN114972348B (en) * 2022-08-01 2022-09-30 山东尚雅建材有限公司 Seam beautifying effect detection method based on image processing
CN115802056A (en) * 2023-01-31 2023-03-14 南通凯沃智能装备有限公司 User data compression storage method for mobile terminal
CN115802056B (en) * 2023-01-31 2023-05-05 南通凯沃智能装备有限公司 User data compression storage method for mobile terminal

Similar Documents

Publication Publication Date Title
JP3268512B2 (en) Image processing apparatus and image processing method
US6748108B2 (en) Method of selecting colors for pixels within blocks for block truncation encoding
EP0550243A1 (en) Color image processing
JPH0750752A (en) Method and device for converting picture density
JP3253125B2 (en) Color image reading correction device
JP2001268378A (en) Method and apparatus for processing image
JP3862374B2 (en) Image processing apparatus and method
JP5151708B2 (en) Image processing apparatus and image processing program
JPH09200554A (en) Image processor
JP2002024817A (en) Image processing method and image processing device
JP3452212B2 (en) Color image processing device that performs color reduction processing
JP4197900B2 (en) A method for representing digital color images using a set of palette colors.
JPH07152904A (en) Image processor
JP2003309725A (en) Image processing method, image processing apparatus, and image forming apparatus provided therewith
JP3455078B2 (en) Image processing apparatus and image processing method
JP4622762B2 (en) Image data compression / decompression method
JP3215156B2 (en) Color image processing method
JP2004236157A (en) Image processing device, image processing method, and image processing program
JP2001076120A (en) Image processor and method for image processing
JPH01276970A (en) Picture signal processor
JP2001352453A (en) Image-reproducing device
JPH0630275A (en) Image processor
JP2003116014A (en) Image processing equipment and method therefor, computer program and computer readable storage medium
JP4971880B2 (en) Image encoding apparatus, image decoding apparatus, and control method thereof
JP3190527B2 (en) Color image processing equipment