JPH0744709A - Color discrimination device - Google Patents

Color discrimination device

Info

Publication number
JPH0744709A
JPH0744709A JP5188454A JP18845493A JPH0744709A JP H0744709 A JPH0744709 A JP H0744709A JP 5188454 A JP5188454 A JP 5188454A JP 18845493 A JP18845493 A JP 18845493A JP H0744709 A JPH0744709 A JP H0744709A
Authority
JP
Japan
Prior art keywords
color
image
colors
area
color image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP5188454A
Other languages
Japanese (ja)
Other versions
JP3483912B2 (en
Inventor
Hiroshi Takahashi
博 高橋
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP18845493A priority Critical patent/JP3483912B2/en
Publication of JPH0744709A publication Critical patent/JPH0744709A/en
Application granted granted Critical
Publication of JP3483912B2 publication Critical patent/JP3483912B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To provide a color discrimination device which discriminates colors and reduces the colors when the point distributions of picture elements in a color space are linear ones straddling several clusters and when the discrimination of the number of the colors is difficult. CONSTITUTION:The linear point distributions (101-103) in the color space are detected by Hough-transforming, the point distributions on the color space, which are obtained by mapping the picture elements of a color picture in a specified area on the color space, so as to obtain the number of the colors. The main components of the point distributions on the color space is analyzed and the first main component (104) and the second main component (105) are used. Thus, the number of the colors in the color picture area is obtained. The point distributions on the color space, which are obtained by mapping the respective picture elements of the color picture area where the colors are to be reduced on the color space, are Hough-transformed. Thus, the linear point distributions (101-103) on the color space are detected, and the colors are reduced by using the colors for the number of the clusters obtained by clustering the linear point distributions.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、カラー画像の特定領域
内の色の数を求める色判別装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a color discriminating apparatus for obtaining the number of colors in a specific area of a color image.

【0002】[0002]

【従来の技術】従来、カラー画像の特定領域内の色の数
を求める場合、領域内の各画素をある色空間上に写像す
ることによって得られる点分布をクラスタリングし、ク
ラスタの数を求めることで色数を求めていた。
2. Description of the Related Art Conventionally, when obtaining the number of colors in a specific area of a color image, a point distribution obtained by mapping each pixel in the area onto a certain color space is clustered to obtain the number of clusters. I was looking for the number of colors.

【0003】このようなクラスタリングの方法として
は、例えば、特開平4−61558号公報に開示されて
いるように、カラー画像を色空間に写像し、主成分分析
と距離比較等を用いてクラスタリングするものが知られ
ている。図19にクラスタリングの一例を示す。この図
では、白色、黒色、赤色、および青色の存在するカラー
画像をRGB色空間上に写像し、分布をクラスタリング
した結果を示している。図中の黒点は、カラー画像の各
画素がRGB色空間上に写像された点を示し、円で囲ん
だ領域が1つのクラスタを成している。この例では、4
つのクラスタに分かれていることから、カラー画像の色
数は「4」となる。
As such a clustering method, for example, as disclosed in Japanese Unexamined Patent Publication No. 4-61558, color images are mapped into a color space, and clustering is performed using principal component analysis and distance comparison. Things are known. FIG. 19 shows an example of clustering. This figure shows the result of mapping color images in which white, black, red, and blue exist on the RGB color space and clustering the distribution. The black dots in the figure indicate the points where each pixel of the color image is mapped in the RGB color space, and the area surrounded by the circle forms one cluster. In this example, 4
Since it is divided into two clusters, the number of colors in the color image is “4”.

【0004】また、このクラスタリングされた各領域内
の色を1つの色に置き換えることで少色化が実現でき
る。すなわち、例えば、図19に示すようなクラスタ内
の各点が表す画素値を、その分布の重心や平均色に置き
換えると図20に示すようになる。この操作により、図
20では4色しか存在しないカラー画像に変換される。
Further, it is possible to reduce the number of colors by replacing the color in each of the clustered areas with one color. That is, for example, when the pixel value represented by each point in the cluster as shown in FIG. 19 is replaced with the center of gravity of the distribution or the average color, it becomes as shown in FIG. By this operation, a color image having only four colors in FIG. 20 is converted.

【0005】[0005]

【発明が解決しようとする課題】領域内の各画素をある
色空間上に写像することによって得られる点分布をクラ
スタリングする方法として、さまざまな方法が提案され
ているが、汎用的な手法は存在せず、点分布の状態によ
ってクラスタリング方法を選択しているのが現状であ
る。また、点分布によってはクラスタリングが困難な場
合がある。クラスタリングが困難な例として、例えば図
5のように点分布が幾つかのクラスタにまたがって分布
してしまう場合がある。
Various methods have been proposed as a method for clustering a point distribution obtained by mapping each pixel in a region on a certain color space, but there is a general-purpose method. At present, the clustering method is selected according to the state of the point distribution. Clustering may be difficult depending on the point distribution. As an example in which clustering is difficult, for example, the point distribution may be distributed over several clusters as shown in FIG.

【0006】たとえば、白色301と赤色303の分布
がつながってしまう理由として、カラー画像読取り時
に、図21(a)のように下地の白色401と下地に書
かれた赤色402の境界をカラーセンサ403の画素4
05が読取り、この2色が混ざった色が生じてしまうた
め、あるいは図21(b)のように下地の白色401で
反射した光と、下地に書かれた赤色402で反射した光
の両方を同時にカラーセンサ403の画素406が読み
取るために生じるものと推測される。
For example, the reason why the distributions of the white color 301 and the red color 303 are connected to each other is that when a color image is read, the boundary between the white color 401 of the background and the red color 402 written on the color of the color sensor 403 as shown in FIG. Pixel 4
No. 05 reads, and a color in which these two colors are mixed is generated, or both the light reflected by the white color 401 of the background and the light reflected by the red color 402 written on the ground as shown in FIG. At the same time, it is presumed that this occurs because the pixel 406 of the color sensor 403 reads.

【0007】また、白色301と黒色302の分布がつ
ながっていしまう原因としては、上記以外に下地の折れ
曲がりやしわなどで影が生じ、これらを読み取ることに
よって白色が黒色がかった色となることも考えられる。
In addition to the above, as a cause of the distribution of the white color 301 and the black color 302 being connected to each other, it is considered that shadows are generated due to the bending and wrinkles of the base, and the white color becomes blackish when these are read. To be

【0008】これらの理由により、図5のような分布の
つながりが生じ、クラスタリングが困難にる。クラスタ
リングを間違えると、抽出される色数が違ってしまい、
少色化にも影響する。例えば、図5では本来4色として
判定されるべきであるが、クラスタリングにより破線の
ように1色として判定されてしまう恐れがあり、少色化
では1色のカラー画像となってしまう。
For these reasons, the distributions are connected as shown in FIG. 5, making clustering difficult. If you make a mistake in clustering, the number of colors extracted will be different,
It also affects color reduction. For example, in FIG. 5, the color should originally be determined to be four colors, but there is a risk that it will be determined to be one color as indicated by the broken line due to clustering, and if the number of colors is reduced, one color image will be obtained.

【0009】そこで、本発明は、色空間での画素の点分
布が幾つかのクラスタにまたがる直線状の分布で、色数
の判別が困難な場合において、色空間上の直線状の点分
布の位置の検出と、直線上の点分布の主成分分析によ
り、カラー画像の特定領域内の色数の判別と少色化を可
能とする色判別装置を提供することを目的とする。
Therefore, according to the present invention, the point distribution of pixels in the color space is a linear distribution that extends over several clusters, and when it is difficult to determine the number of colors, the linear point distribution of the color space An object of the present invention is to provide a color discriminating apparatus capable of discriminating the number of colors in a specific region of a color image and reducing the number of colors by detecting a position and analyzing a principal component of a point distribution on a straight line.

【0010】[0010]

【課題を解決するための手段】本発明の色判別装置は、
カラー画像を入力するカラー画像入力手段と、前記カラ
ー画像に対して色数を求める画像領域を指定する領域指
定手段と、この領域指定手段により指定された画像領域
を前記カラー画像入力手段により入力されたカラー画像
から切り出す切出手段と、この切出手段により切り出さ
れた画像領域の各画素を色空間上に写像する写像手段
と、この写像手段により写像された前記画素の色空間上
の点分布から色数を判別する色数判別手段と、この色数
判別手段により判別された色数を出力する色数出力手段
とを具備している。
The color discriminating apparatus of the present invention comprises:
A color image input means for inputting a color image, an area designating means for designating an image area for obtaining the number of colors for the color image, and an image area designated by the area designating means are inputted by the color image input means. Cutting means for cutting out from the color image, mapping means for mapping each pixel of the image area cut out by the cutting means on a color space, and point distribution of the pixels mapped by the mapping means on the color space It is provided with a color number discriminating means for discriminating the number of colors and a color number outputting means for outputting the color number discriminated by the color number discriminating means.

【0011】また、本発明の色判別装置は、カラー画像
を入力するカラー画像入力手段と、前記カラー画像に対
して色数を求める画像領域を指定する領域指定手段と、
この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、この切出手段により切り出された画像領
域の各画素を色空間上に写像する写像手段と、この写像
手段により写像された画素の色空間上の各点をハフ(H
ough)変換する変換手段と、この変換手段によりハ
フ変換された前記色空間上の各点の分布から、この分布
の極大点を検出することにより色数を判別する色数判別
手段と、この色数判別手段により判別された色数を出力
する色数出力手段とを具備している。
Further, the color discriminating apparatus of the present invention comprises a color image input means for inputting a color image, and an area designating means for designating an image area for obtaining the number of colors for the color image.
Cutting out means for cutting out the image area designated by the area designating means from the color image input by the color image inputting means, and mapping for mapping each pixel of the image area cut out by the cutting out means onto a color space. Means and each point on the color space of the pixel mapped by this mapping means is Hough (H
a conversion means for performing a conversion, a color number discrimination means for discriminating the number of colors by detecting the maximum point of this distribution from the distribution of each point on the color space Hough-transformed by this conversion means, and this color The color number output means outputs the number of colors determined by the number determination means.

【0012】また、本発明の色判別装置は、カラー画像
を入力するカラー画像入力手段と、前記カラー画像に対
して色数を求める画像領域を指定する領域指定手段と、
この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、この切出手段により切り出された画像領
域の各画素を色空間上に写像する写像手段と、この写像
手段により写像された画素の色空間上の点分布を主成分
分析する主成分分析手段と、この主成分分析手段により
得られた第1主成分の値をあらかじめ設定される所定値
と比較することにより色数を求める第1主成分比較手段
と、前記主成分分析手段により得られた第2主成分の値
をあらかじめ設定された所定値と比較することにより色
数を求める第2主成分比較手段と、前記第1主成分比較
手段、および第2主成分比較手段により求められた色数
を出力する色数出力手段とを具備している。
Further, the color discriminating apparatus of the present invention comprises a color image input means for inputting a color image, and an area designating means for designating an image area for obtaining the number of colors for the color image,
Cutting out means for cutting out the image area designated by the area designating means from the color image input by the color image inputting means, and mapping for mapping each pixel of the image area cut out by the cutting out means onto a color space. Means, a principal component analysis means for principal component analysis of the point distribution in the color space of the pixels mapped by this mapping means, and a value of the first principal component obtained by this principal component analysis means is preset. A first principal component comparing means for obtaining the number of colors by comparing it with a value, and a first principal component comparing means for obtaining the number of colors by comparing the value of the second principal component obtained by the principal component analyzing means with a preset predetermined value. It comprises two principal component comparing means, a first principal component comparing means, and a color number outputting means for outputting the number of colors obtained by the second principal component comparing means.

【0013】また、本発明の色判別装置は、カラー画像
を入力するカラー画像入力手段と、前記カラー画像に対
して色数を求める画像領域を指定する領域指定手段と、
この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、この切出手段により切り出された画像領
域の各画素を色空間上に写像する写像手段と、この写像
手段により色空間上に写像された画像領域を少色化する
少色化手段と、この少色化手段により少色化された画像
領域のカラー画像を出力する画像出力手段とを具備して
いる。
Further, the color discriminating apparatus of the present invention comprises a color image input means for inputting a color image, and an area designating means for designating an image area for obtaining the number of colors for the color image.
Cutting out means for cutting out the image area designated by the area designating means from the color image input by the color image inputting means, and mapping for mapping each pixel of the image area cut out by the cutting out means onto a color space. Means, a color reducing means for reducing the color of the image area mapped on the color space by the mapping means, and an image output means for outputting a color image of the image area reduced by the color reducing means. It is equipped with.

【0014】また、本発明の色判別装置は、カラー画像
を入力するカラー画像入力手段と、前記カラー画像に対
して色数を求める画像領域を指定する領域指定手段と、
この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、この切出手段により切り出された画像領
域の各画素を色空間上に写像する写像手段と、この写像
手段により写像された画素の色空間上の各点をハフ(H
ough)変換する変換手段と、この変換手段によりハ
フ変換された前記色空間上の各点の分布から、この分布
の極大点を検出する極大点検出手段と、この極大点検出
手段により検出された極大点から色空間上での直線状の
点分布の位置を検出する直線成分検出手段と、この直線
成分検出手段によりっ検出された色空間の直線状の点分
布を分割する直線成分分割手段と、この直線成分分割手
段により分割された色空間の直線状の点分布を含めて色
空間上の点分布のクラスタリングを行うクラスタリング
手段と、このクラスタリング手段によりクラスタリング
された各クラスタ内の色を1つの色で置き換えることに
より少色化するデータ置換え手段と、このデータ置換え
手段により少色化された画像領域のカラー画像を出力す
る画像出力手段とを具備している。
Further, the color discriminating apparatus of the present invention comprises a color image input means for inputting a color image, and an area designating means for designating an image area for obtaining the number of colors for the color image,
Cutting out means for cutting out the image area designated by the area designating means from the color image input by the color image inputting means, and mapping for mapping each pixel of the image area cut out by the cutting out means onto a color space. Means and each point on the color space of the pixel mapped by this mapping means is Hough (H
from the distribution of each point on the color space Hough-transformed by this conversion means, the maximum point detection means for detecting the maximum point of this distribution, and the maximum point detection means. A linear component detecting means for detecting the position of the linear point distribution on the color space from the maximum point, and a linear component dividing means for dividing the linear point distribution of the color space detected by the linear component detecting means. , Clustering means for clustering the point distribution on the color space including the linear point distribution of the color space divided by the linear component dividing means, and one color in each cluster clustered by this clustering means. Data replacing means for reducing the number of colors by replacing with a color, and image output means for outputting a color image of the image area reduced in color by the data replacing means It is provided.

【0015】[0015]

【作用】色数を求めたい画像領域を設定し、この指定さ
れた画像領域の各画素を色空間上に写像して得られた色
空間上の点分布をハフ変換し、色空間の直線状の点分布
の位置を検出することにより、指定された画像領域内の
色数が求められる。
[Function] An image area for which the number of colors is desired to be set is set, and the point distribution on the color space obtained by mapping each pixel of the specified image area on the color space is subjected to Hough transform to obtain a linear shape of the color space. By detecting the position of the point distribution of, the number of colors in the designated image area can be obtained.

【0016】また、色空間上に写像された指定された画
像領域の各画素の点分布を主成分分析し、その第1主成
分および第2主成分を用いることにより、指定された画
像領域内の色数を求めることができる。
Further, by performing a principal component analysis on the point distribution of each pixel of the designated image area mapped onto the color space and using the first principal component and the second principal component thereof, The number of colors of can be calculated.

【0017】さらに、少色化したい画像領域を指定し、
この指定された画像領域の各画素を色空間上に写像して
得られた色空間上の点分布をハフ変換することにより、
色空間の直線状の点分布の位置を検出し、この直線状の
点分布をクラスタリングして得られたクラスタの数の色
を用いて画像を表示する少色化が実現できる。
Further, by designating an image area to be reduced in color,
By Hough transforming the point distribution on the color space obtained by mapping each pixel of the specified image area on the color space,
It is possible to reduce the number of colors in which an image is displayed using the number of clusters obtained by detecting the position of a linear point distribution in the color space and clustering the linear point distribution.

【0018】[0018]

【実施例】以下、本発明の一実施例について図面を参照
して説明する。図2は、本発明の一実施例に係る色判別
装置の構成を示すものである。図において、全体的な制
御を司るCPU201には、CPUバス202を介し
て、CPU201の作業用メモリである記憶装置20
3、本色判別装置を制御する制御プログラム等が格納さ
れている主記憶部204、外部からのデータまたは指示
入力を行うキーボード等のデータ入力装置205が接続
されている。主記憶部204内には、プログラム格納領
域とテンポラリ記憶領域があり、プログラム格納領域に
はあらかじめプログラムが格納されており、テンポラリ
記憶領域はCPU501の一時記憶領域として使われ
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 2 shows the configuration of a color discriminating apparatus according to an embodiment of the present invention. In the figure, a CPU 201 which controls the entire control is connected to a storage device 20 which is a working memory of the CPU 201 via a CPU bus 202.
3. A main storage unit 204 in which a control program for controlling the color discrimination apparatus and the like are stored, and a data input device 205 such as a keyboard for inputting data or instructions from the outside are connected. The main storage unit 204 has a program storage area and a temporary storage area. A program is stored in the program storage area in advance, and the temporary storage area is used as a temporary storage area of the CPU 501.

【0019】また、CPU201には、CPUバス20
2を介して、入力インタフェイス装置206および出力
インタフェイス装置207が接続されている。入力イン
タフェイス装置206には、画像入力装置208が接続
されていて、画像入力装置208が、あらかじめ用意さ
れたカラー画像を読み取ると、このカラー画像は、入力
インタフェイス装置206、CPUバス202を通っ
て、記憶装置203に送られ、ここに蓄えられるように
なっている。
The CPU 201 has a CPU bus 20.
An input interface device 206 and an output interface device 207 are connected via the interface 2. An image input device 208 is connected to the input interface device 206. When the image input device 208 reads a color image prepared in advance, this color image passes through the input interface device 206 and the CPU bus 202. Then, it is sent to the storage device 203 and stored there.

【0020】出力インタフェイス装置207には、画像
出力装置209が接続されていて、記憶装置203に蓄
えられたカラー画像は、CPUバス202、出力インタ
フェイス装置207を通り、画像出力装置209へと送
られ、任意のデバイスに出力されるようになっている。
An image output device 209 is connected to the output interface device 207, and the color image stored in the storage device 203 passes through the CPU bus 202 and the output interface device 207 to the image output device 209. It is sent and output to any device.

【0021】次に、上記のような構成において、本装置
の処理の流れについて図3に示すフローチャートを参照
して説明する。CPU201から画像入力要求の命令が
出力されると、画像入力装置208があらかじめ用意さ
れたカラー画像を読取り、記憶装置203にそのカラー
画像を蓄える(ステップ601)。
Next, the flow of processing of this apparatus having the above-mentioned structure will be described with reference to the flow chart shown in FIG. When the image input request command is output from the CPU 201, the image input device 208 reads a color image prepared in advance and stores the color image in the storage device 203 (step 601).

【0022】色の数を判別したい画像領域は、データ入
力装置205から入力して指定することにより、記憶装
置203に蓄えられたカラー画像から指定された画像領
域を切り出し(ステップ602)、その画像領域の各画
素を色空間上に写像する(ステップ603)。すなわ
ち、色空間としてRGB3次元色空間を用いて、カラー
画像の各画素値が赤成分、緑成分および青成分で与えら
れているものとすると、RGB3次元色空間上に写像す
るには、この画素値を赤(R)成分、緑(G)成分およ
び青(B)成分で構成されるRGB3次元色空間上の対
応する位置に写像すればよい。このような方法で、指定
された画像領域内のすべての画素を色空間上に写像する
と、指定領域内の画素は色空間内では点分布で表され
る。
The image area for which the number of colors is desired to be determined is input and specified from the data input device 205 to cut out the specified image area from the color image stored in the storage device 203 (step 602). Each pixel of the area is mapped on the color space (step 603). That is, assuming that the RGB three-dimensional color space is used as the color space and each pixel value of the color image is given by the red component, the green component and the blue component, this pixel is mapped to the RGB three-dimensional color space. The values may be mapped to corresponding positions on the RGB three-dimensional color space composed of the red (R) component, the green (G) component and the blue (B) component. When all the pixels in the designated image area are mapped on the color space by such a method, the pixels in the designated area are represented by a point distribution in the color space.

【0023】次に、色数判別処理(ステップ604)に
おいて、ステップ603により求められた色空間上の点
分布から色数を求め、この色数を任意のデバイスに出力
する(ステップ605)。
Next, in the color number discrimination process (step 604), the color number is obtained from the point distribution on the color space obtained in step 603, and this color number is output to an arbitrary device (step 605).

【0024】色数判別処理(ステップ604)は、さら
に図4に示すフローチャートのような処理に分けられ
る。ここでの処理は、色空間上の点分布において、図1
(a)に示すように直線成分(101〜103)の数を
求めることである。ステップ603で求められた画素の
色空間上の点分布は、ハフ(Hough)変換により、
さらに別の空間に写像される(ステップ701)。この
空間をここではハフ変換空間と呼ぶ。ハフ変換は、直線
などの図形を画像中から検出するための手法であり、こ
こでは、最も広く使われている直線検出法について述べ
る(Dudaand Hartの方法:田村秀行 コン
ピュータ画像処理入門 総研出版1985 より抜
粋)。
The color number discrimination process (step 604) is further divided into the processes shown in the flowchart of FIG. The process here is based on the point distribution in the color space shown in FIG.
This is to obtain the number of linear components (101 to 103) as shown in (a). The point distribution on the color space of the pixel obtained in step 603 is obtained by Hough transform.
It is mapped to another space (step 701). This space is called the Hough transform space here. The Hough transform is a method for detecting a figure such as a straight line from an image. Here, the most widely used straight line detection method will be described (Duda and Hart's method: Hideyuki Tamura, Computer Image Processing Introduction: Research Institute Publishing 1985. Excerpt).

【0025】直線を、 ρ=x cosθ+y sinθ ………(1) で表現し、直線を記述するためのパラメータとして、
(ρ、θ)を用いる。ここでρは原点から下ろした垂線
の長さ、θは垂線とx軸とのなす角である。この直線が
画像上の点(x0 、y0 )を通るとすると、 ρ=x0 cosθ+y0 sinθ ………(2) の関係が成り立つ。この関係はパラメータ空間ρ−θ上
ではサイン曲線となる。すなわち、x−y空間の1点は
ρ−θ空間の1本の軌跡に対応し、逆に式(2)で表さ
れるρ−θの軌跡は、x−y空間において(x0 、y
0 )を通る全ての直線群を表していることになる。従っ
て、x−y空間上で1本の直線上の点をρ−θ空間に写
像した場合、これらの点から作れるρ−θ空間上での軌
跡は1点で交わることになる。
A straight line is expressed by ρ = x cos θ + y sin θ (1), and as a parameter for describing the straight line,
(Ρ, θ) is used. Here, ρ is the length of the perpendicular line drawn from the origin, and θ is the angle between the perpendicular line and the x axis. If this straight line passes through the point (x 0 , y 0 ) on the image, the relationship of ρ = x 0 cos θ + y 0 sin θ (2) holds. This relationship is a sine curve on the parameter space ρ-θ. That is, one point in the xy space corresponds to one locus in the ρ-θ space, and conversely, the locus of ρ-θ expressed by the equation (2) is (x 0 , y in the xy space.
It means that all straight lines passing through 0 ) are represented. Therefore, when a point on a straight line in the xy space is mapped to the ρ-θ space, the locus in the ρ-θ space created from these points intersects at one point.

【0026】ここで、ハフ変換処理の具体例として、図
5に示すような色空間内の点分布を基に説明する。ま
ず、RGB3次元色空間における分布をRG、RB、G
Bのいずれかの2次元空間に置き換える。置き換える方
法としては、例えばRGB3次元色空間上の各点をR
G、RB、GBそれぞれの面から見た点へ写像し、R
G、RB、GB面の中で最も分布の広がりが大きい面、
あるいは、目視により全ての直線成分がはっきりと現れ
ている面を抽出する。例えば、図5に示すRGB3次元
色空間における分布を2次元空間に置き換えるには、直
線成分のはっきり現れているRB面にデータを写像すれ
ばよい。RG面へ写像すると、白色301から赤色30
3へ延びる直線が現れず、GB面へ写像すると、白色3
01から青色304へ延びる直線が現れなくなるためで
ある。図5の分布をRB面に写像すると、図1(a)の
ような分布となる。
Here, a specific example of the Hough transform process will be described based on the point distribution in the color space as shown in FIG. First, the distribution in the RGB three-dimensional color space is RG, RB, G
Replace with any two-dimensional space of B. As a replacement method, for example, each point on the RGB three-dimensional color space is R
Map to the point seen from each surface of G, RB, GB, and R
The surface with the widest distribution among G, RB, and GB surfaces,
Alternatively, a surface in which all straight line components are clearly visible is extracted by visual inspection. For example, in order to replace the distribution in the RGB three-dimensional color space shown in FIG. 5 with the two-dimensional space, the data may be mapped onto the RB plane where the straight line component clearly appears. When mapped to the RG plane, white 301 to red 30
When a straight line extending to 3 does not appear and is mapped to the GB plane, white 3
This is because the straight line extending from 01 to blue 304 does not appear. Mapping the distribution of FIG. 5 on the RB plane results in the distribution as shown in FIG.

【0027】次に、図1(a)のRB空間に写像された
各点を、式(1)によりρ−θ空間(ハフ変換空間)上
に写像する。以下、図1(a)の分布を細線化等の処理
により直線で近似した様子を示した図6を用いて説明す
る。図6における各点(A、B、C、D、E、F、G)
をρ−θ空間(ハフ変換空間)上に写像した様子を示し
たものが図7である。
Next, each point mapped in the RB space of FIG. 1A is mapped in the ρ-θ space (Hough transform space) by the equation (1). In the following, description will be given with reference to FIG. 6 showing a state in which the distribution of FIG. 1A is approximated by a straight line by a process such as thinning. Each point in FIG. 6 (A, B, C, D, E, F, G)
FIG. 7 shows a state in which is mapped on the ρ-θ space (Hough transform space).

【0028】図6に示すようなRB色空間において、白
色分布領域と赤色分布領域を結ぶ直線801上の任意の
3点をA、B、C、白色分布領域と黒色分布領域を結ぶ
直線802上の任意の3点をA、D、E、白色分布領域
と青色分布領域を結ぶ直線803上の任意の3点をA、
F、Gとする。
In the RB color space as shown in FIG. 6, three arbitrary points on the straight line 801 connecting the white distribution region and the red distribution region are A, B and C, and on the straight line 802 connecting the white distribution region and the black distribution region. , A, D, E, and arbitrary three points on a straight line 803 connecting the white distribution region and the blue distribution region are A,
F and G.

【0029】点A(x0 、y0 )をハフ変換した場合、
図6において、原点からA点を通る直線803に下ろし
た垂線の長さをρ、その角をθとすると、式(2)か
ら、この2変数の組み合わせはρ−θ空間上で図7に示
すように1本のサイン曲線(807)で表される。これ
を点B〜Gについても同様に行い、ρ−θ空間上に各点
のサイン曲線を求める。色空間内で直線状に分布してい
る点があれば、ρ−θ空間上では、その点に対応するサ
イン曲線は1点で交わるため、図6における点A、B、
Cの各サイン曲線は図7の点α、図6における点A、
D、Eの各サイン曲線は図7の点β、図6における点
A、F、Gの各サイン曲線は図7の点γで交わる。すな
わち、色空間内に直線状の点分布が存在すれば、ρ−θ
空間上では、直線状に分布した各点に対応するサイン曲
線が互いに交わった交点が、1点に集中することにな
る。
When the Hough transform is applied to the point A (x 0 , y 0 ),
In FIG. 6, assuming that the length of the perpendicular line drawn from the origin to the straight line 803 passing through the point A is ρ and its angle is θ, the combination of these two variables is shown in FIG. It is represented by a single sine curve (807) as shown. This is similarly performed for the points B to G, and the sine curve of each point is obtained on the ρ-θ space. If there is a point that is linearly distributed in the color space, the sine curves corresponding to that point intersect at one point in the ρ-θ space, so points A, B, and
Each sine curve of C is the point α in FIG. 7, the point A in FIG.
The sine curves of D and E intersect at a point β in FIG. 7, and the sine curves of points A, F, and G in FIG. 6 intersect at a point γ of FIG. That is, if a linear point distribution exists in the color space, ρ−θ
In the space, the intersections where the sine curves corresponding to the linearly distributed points intersect with each other are concentrated at one point.

【0030】以上により、ハフ変換空間が求められたの
で、続いて、ハフ変換空間においてサイン曲線の交点が
集中したピーク点を検出する(ステップ702)。図6
では分布を直線で近似して説明したのでρ−θ空間では
単純にピークを検出すればよいが、実際には図1(a)
のように完全な直線ではなく、ある程度のばらつきがあ
る。そこで、例えば、次のようなピーク検出法を用い
る。ピークの検出は、分布状態の山を見つければよく、
例えば、図8に示すフローチャートのような処理が考え
られる。
Since the Hough transform space has been obtained as described above, the peak points where the intersections of the sine curves are concentrated are detected in the Hough transform space (step 702). Figure 6
Since the distribution has been approximated by a straight line in the above description, it is sufficient to simply detect the peak in the ρ-θ space.
There is some variation, not a perfect straight line. Therefore, for example, the following peak detection method is used. To detect peaks, just find the distribution peaks,
For example, a process like the flowchart shown in FIG. 8 can be considered.

【0031】まず、2次元空間における分布状態を横方
向に検索していき、左右の分布状態が現在位置の分布状
態より小さいかどうかを判定し、横方向の山を見つける
処理を行う(ステップ901)。次に、横方向の山が見
つかったら、縦方向の検索を行い、上下の分布状態が現
在位置の分布状態より小さいかどうかを判定して、縦方
向の山を見つける処理を行う(ステップ902)。この
様にして、横と縦の山が見つかったら、その点をピーク
点として出力する(ステップ903)。ここでは、ピー
ク点は1つということで説明したが、ピーク点はいくつ
あってもかまわない。この場合、ピーク点全てを抽出し
出力する。
First, the distribution state in the two-dimensional space is searched in the horizontal direction, it is determined whether the left and right distribution states are smaller than the distribution state at the current position, and processing for finding the horizontal peaks is performed (step 901). ). Next, when a horizontal mountain is found, a vertical search is performed to determine whether the vertical distribution state is smaller than the current position distribution state, and the vertical mountain is found (step 902). . In this way, when horizontal and vertical peaks are found, those points are output as peak points (step 903). Although it has been described here that there is one peak point, it does not matter how many peak points there are. In this case, all peak points are extracted and output.

【0032】そして、最後に、ステップ702で上記の
処理等により検出されたピーク点をカウントして色数を
判別する(ステップ703)。ここでカウントされた数
は、色空間上での直線の数を示しており、求める色数
は、一様な下地に色が存在するカラー画像の場合には、
この直線の数に「1」を加えた数となる。
Finally, in step 702, the number of peaks detected by the above processing is counted to determine the number of colors (step 703). The number counted here indicates the number of straight lines in the color space, and the number of colors to be obtained is, in the case of a color image in which colors exist on a uniform background,
This is the number obtained by adding "1" to the number of this straight line.

【0033】カラー画像の特定領域内の色数の判別が1
色か2色か3色以上かを判定するだけで十分な場合に
は、色数判別処理(ステップ604)として、図9に示
すフローチャートのような処理が適用できる。まず、主
成分処理(ステップ1001)では、色空間における分
布の主成分分析を行う。主成分分析とは、多変量の測定
値が与えられたとき、線形変換によって変量間の相関を
なくし、より少ない変量によって測定対象の特徴を記述
しようという変換である。
The determination of the number of colors in a specific area of a color image is 1
When it is sufficient to determine whether there are two colors, three colors or more, the color number determination process (step 604) can be performed by the process shown in the flowchart of FIG. First, in the principal component processing (step 1001), the principal component analysis of the distribution in the color space is performed. Principal component analysis is a transformation in which, when multivariate measurement values are given, the correlation between the variables is eliminated by linear transformation, and the characteristics of the measurement target are described with fewer variables.

【0034】具体例として、色空間における分布が図1
0に示すとおりであるとすると、分布1601の一番広
がっている方向成分を第1主成分1602、それと直行
する方向成分を第2主成分1603、さらにそれと直行
する方向成分を第3主成分1604、…というように、
大量のデータを、これら数種類の成分で表現しようとす
る分析方法である。
As a concrete example, the distribution in the color space is shown in FIG.
As shown in FIG. 0, the direction component having the largest spread of the distribution 1601 is the first principal component 1602, the direction component orthogonal thereto is the second principal component 1603, and the direction component orthogonal thereto is the third principal component 1604. , ...
This is an analysis method that attempts to express a large amount of data with these several types of components.

【0035】次に、第1主成分がしきい値θ1 よりも大
きいかどうかを判定する(ステップ1002)。第1主
成分がしきい値θ1 よりも小さい場合には、この画像領
域の色数は「1」と判定する(ステップ1003)。第
1主成分がしきい値θ1 よりも大きい場合には、さらに
第2主成分がしきい値θ2 よりも大きいかどうかを判定
する(ステップ1004)。ここで、第2主成分がしき
い値θ2 よりも小さい場合には、この画像領域の色数は
「2」と判定する(ステップ1005)。第2主成分が
しきい値θ2 よりも大きい場合には、色数は「3」以上
と判定する(ステップ1006)。
Next, it is determined whether the first principal component is larger than the threshold value θ 1 (step 1002). If the first principal component is smaller than the threshold θ 1 , the number of colors in this image area is determined to be “1” (step 1003). If the first principal component is larger than the threshold θ 1 , it is further determined whether the second principal component is larger than the threshold θ 2 (step 1004). Here, when the second principal component is smaller than the threshold value θ 2 , it is determined that the number of colors of this image region is “2” (step 1005). If the second principal component is larger than the threshold value θ 2 , it is determined that the number of colors is “3” or more (step 1006).

【0036】主成分分析による色数判別の具体例を図1
1、12、13に示す。図11は、第1主成分が小さい
場合の分布であり、これは例えば下地のみである色数1
の色分布を示す。図12は、第1主成分は大きいが、第
2主成分は小さい場合の分布であり、これは例えば下地
の他に1色が存在する画像の色数2の色分布を示す。図
13は、第1主成分、第2主成分が共に大きい場合の分
布であり、これは例えば下地の他に2色が存在する画像
の色数「3」の色分布を示す。
FIG. 1 shows a specific example of color number discrimination by principal component analysis.
1, 12, and 13 are shown. FIG. 11 shows a distribution when the first principal component is small.
Shows the color distribution of. FIG. 12 shows a distribution in which the first principal component is large, but the second principal component is small, and this shows a color distribution of two colors in an image in which one color is present in addition to the background. FIG. 13 shows a distribution when both the first principal component and the second principal component are large, and this shows a color distribution of the number of colors “3” in an image in which two colors are present in addition to the background, for example.

【0037】さらに、色空間上の点分布が直線状である
場合、主成分分析による色数判別の具体例を図1(b)
に示す。この図は、図1(a)と同様にRGB3次元空
間上の分布を、RG、RB、GBのいずれかの2次元空
間に置き換えた図である。第1主成分軸104及び第2
主成分軸105は図のようになり、第1主成分、第2主
成分の値がともに大きいことから、色数は「3」以上と
判定される。しきい値θ1 、θ2 は、例えば、カラー画
像の画素値の分解能が256階調だとすると、θ1
「128」、θ2 は「20」程度となる。
Further, when the point distribution on the color space is linear, a specific example of the number of colors determination by the principal component analysis is shown in FIG. 1 (b).
Shown in. This figure is a diagram in which the distribution in the RGB three-dimensional space is replaced with a two-dimensional space of any of RG, RB, and GB as in FIG. 1A. First principal component axis 104 and second
The principal component axis 105 is as shown in the figure, and since the values of both the first principal component and the second principal component are large, the number of colors is determined to be “3” or more. Threshold theta 1, theta 2 is, for example, when the resolution of the pixel values of the color image is that it 256 gradations, theta 1 is "128", theta 2 becomes about "20".

【0038】このように、カラー画像の特定領域内の色
の数を求めることにより、例えば、図14(a)のよう
な一様な背景に赤色の英字1101、花1102、人物
1103及び黒色の日付1104が書かれているカラー
画像から、それぞれの領域を図14(b)に示すよう
に、赤色の単色1105、多色(A)1106、多色
(B)1107及び黒色の単色1108と識別すること
ができる。
By thus determining the number of colors in the specific area of the color image, for example, a red alphabet 1101, a flower 1102, a person 1103, and a black character are displayed on a uniform background as shown in FIG. From the color image in which the date 1104 is written, each area is identified as a red single color 1105, a multicolor (A) 1106, a multicolor (B) 1107, and a black single color 1108, as shown in FIG. 14B. can do.

【0039】以上述べてきたように、色空間上の直線状
分布の位置の検出、または、直線状分布の成分分析によ
りカラー画像の特定領域内の色数が求められるが、さら
に、色数の判別方法と同様な処理により、色空間上での
直線状分布を検出した後、直線状分布を2分することに
より、色空間上の分布をクラスタリングし、少色化も実
現できる。その一例を図15に示すフローチャートを参
照して説明する。
As described above, the number of colors in the specific area of the color image is obtained by detecting the position of the linear distribution on the color space or analyzing the components of the linear distribution. After the linear distribution in the color space is detected by the same processing as the discrimination method, the linear distribution is divided into two, whereby the distribution in the color space is clustered and the color reduction can be realized. An example thereof will be described with reference to the flowchart shown in FIG.

【0040】画像入力装置208からカラー画像を入力
し、記憶装置203に蓄える(ステップ1201)。次
に、少色化したい画像領域をデータ入力装置205から
入力して指定することにより、記憶装置203に蓄えら
れたカラー画像から指定された画像領域を切り出した後
(ステップ1202)、その指定された画像領域の各画
素を色空間上に写像する(ステップ1203)。ここで
は、色空間としてRGB3次元色空間を用いて説明す
る。カラー画像の各画素値が赤成分、緑成分及び青成分
で与えられているものとすると、RGB3次元色空間に
写像するには、この画素値を赤成分、緑成分及び青成分
で構成されるRGB3次元色空間上に対応する位置に写
像すればよい。この操作を指定された画像領域内のすべ
ての画素について行うことで、得られた色空間分布から
カラー画像の少色化を行う(ステップ1204)。そし
て、少色化されたカラー画像を画像出力装置209へ出
力する(ステップ1205)。
A color image is input from the image input device 208 and stored in the storage device 203 (step 1201). Next, after the image area to be reduced in color is input and specified from the data input device 205, the specified image area is cut out from the color image stored in the storage device 203 (step 1202), and then the specified area is specified. Each pixel of the image area is mapped on the color space (step 1203). Here, an RGB three-dimensional color space will be used as the color space for description. If each pixel value of a color image is given by a red component, a green component and a blue component, this pixel value is composed of a red component, a green component and a blue component in order to map it in an RGB three-dimensional color space. It suffices to map to a corresponding position in the RGB three-dimensional color space. By performing this operation for all the pixels in the designated image area, the color of the color image is reduced from the obtained color space distribution (step 1204). The color-reduced color image is output to the image output device 209 (step 1205).

【0041】次に、少色化処理(ステップ1204)
は、さらに図16に示すフローチャートのような処理に
分けられる。まず、色数判別処理(ステップ1301)
では、前述した図4のステップ701〜703と同様な
処理を行う。そして、ハフ変換空間で検出されたピーク
点から色空間上での直線状分布の位置を求める(ステッ
プ1302)。すなわち、例えば図7のピーク点α(8
06)は、式(1)により図6の色空間上の直線803
として求められる。
Next, color reduction processing (step 1204)
Is further divided into the processes shown in the flowchart of FIG. First, color number discrimination processing (step 1301)
Then, the same processing as steps 701 to 703 in FIG. 4 described above is performed. Then, the position of the linear distribution in the color space is obtained from the peak points detected in the Hough transform space (step 1302). That is, for example, the peak point α (8
06) is a straight line 803 on the color space of FIG.
Is required as.

【0042】次に、ステップ1302により求められた
直線状分布を2分する(ステップ1303)。具体的に
説明すると、例えば図1(a)における色空間の直線状
分布101が、実際には図17(a)の分布曲線140
1であったとする。この分布を2分する方法としては、
例えばモード法が挙げられる。モード法とは、図17
(b)のようなデータ分布があるとすると、2つの山1
404及び1405の間の谷1403のところで2分す
るという方法である。
Next, the linear distribution obtained in step 1302 is divided into two (step 1303). More specifically, for example, the linear distribution 101 in the color space in FIG. 1A is actually the distribution curve 140 in FIG.
Suppose it was 1. To divide this distribution into two,
For example, there is a modal method. The modal method is shown in FIG.
If there is a data distribution as shown in (b), two mountains 1
It is a method of bisecting at a valley 1403 between 404 and 1405.

【0043】色空間のそれぞれの直線状分布を2分した
ら、次に色空間上の分布のクラスタリングを行なう(ス
テップ1304)。色空間分布の例として図5に示すよ
うな分布を色空間上の直線状分布の位置の検出、また
は、直線上の分布の解析によりクラスタリングすると、
図18に示すようになる。白色1501と赤色1502
の分布を結んだ直線状分布がステップ1303において
分割点1505で分割され、白色と赤色が分離されてい
ることがわかる。同様に、白色1501と黒色1503
が分割点1506で分割され、また、白色1501と青
色1504が分割点1507で分割されている。そし
て、最終的に図18のように4つの領域(1501、1
502、1503、1504)にクラスタリングされ
る。
After dividing each linear distribution in the color space into two, clustering of the distribution in the color space is performed (step 1304). As an example of the color space distribution, when the distribution shown in FIG. 5 is clustered by detecting the position of the linear distribution on the color space or by analyzing the distribution on the straight line,
As shown in FIG. White 1501 and red 1502
It can be seen that the linear distribution connecting the distributions of 1 and 2 is divided at the division point 1505 in step 1303, and white and red are separated. Similarly, white 1501 and black 1503
Is divided at a division point 1506, and white 1501 and blue 1504 are divided at a division point 1507. Finally, as shown in FIG. 18, four areas (1501, 1
502, 1503, 1504).

【0044】そして、ステップ1304にてクラスタリ
ングされた各クラスタ内の画素値を、例えばそのクラス
タ内の平均の色に置き換えることにより少色化が実現で
きる(ステップ1305)。すなわち、図18に示すよ
うにクラスタリングされた各クラスタ内の画素値を、そ
のクラスタ内の平均の色で置き換えて少色化を行うと、
4色に少色化される。
Then, the pixel value in each cluster clustered in step 1304 is replaced with, for example, the average color in the cluster, whereby the color reduction can be realized (step 1305). That is, when the pixel values in each cluster clustered as shown in FIG. 18 are replaced with the average color in the cluster to reduce the number of colors,
Reduced to 4 colors.

【0045】このように、色空間上に写像された指定さ
れた画像領域の各画素の点分布を、ハフ変換、または、
主成分分析をすることにより、指定された画像領域内の
色数を求めたり、また、クラスタリングが行える。さら
に、色数がわかることにより、カラー画像の領域分割、
領域識別にも利用できる。また、クラスタリングによ
り、カラー画像を表示する際にディスプレイの表示色数
が限られている場合、求められたクラスタの数の色を用
いて画像を表示する少色化や、画像の領域分割を色で行
う際の分割領域数を知ることができ、カラー画像データ
を圧縮する際の最低限必要な色の数としてデータ圧縮に
利用することができる。
As described above, the point distribution of each pixel in the designated image area mapped on the color space is Hough transformed, or
By performing the principal component analysis, the number of colors in the designated image area can be obtained and clustering can be performed. Furthermore, by knowing the number of colors, the area division of the color image,
It can also be used for area identification. In addition, when the number of display colors on the display is limited when displaying a color image due to clustering, the number of colors of the obtained cluster is used to reduce the number of colors used to display the image, and the image is divided into regions. It is possible to know the number of divided areas when performing the above-mentioned step, and it can be used for data compression as the minimum required number of colors when compressing color image data.

【0046】尚、前記実施例では、RGB3次元空間を
RB2次元空間に置き換えたが、RGBの3次元空間の
ままハフ変換を行い、直線を抽出することも可能であ
る。また、色空間としてRGB色空間だけでなく、HV
C色空間、CMY色空間、L***色空間などを用い
て解析することも可能である。
In the above embodiment, the RGB three-dimensional space is replaced with the RB two-dimensional space, but it is also possible to carry out Hough transformation in the RGB three-dimensional space and extract straight lines. Also, not only the RGB color space but also the HV
It is also possible to analyze using a C color space, a CMY color space, an L * a * b * color space, and the like.

【0047】[0047]

【発明の効果】以上詳述したように本発明によれば、デ
ータ分布が幾つかのクラスタにまたがって分布してしま
うような色数の判別が困難な場合において、色空間上の
直線状分布の位置の検出、または、直線状分布の主成分
分析により、カラー画像の特定領域内の色数の判別と少
色化を可能とする色判別装置を提供できる。
As described above in detail, according to the present invention, when it is difficult to determine the number of colors such that the data distribution is distributed over several clusters, a linear distribution on the color space is obtained. It is possible to provide a color discriminating apparatus capable of discriminating the number of colors in a specific region of a color image and reducing the number of colors by detecting the position of or the principal component analysis of the linear distribution.

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

【図1】本発明の一実施例に係る色判別装置の色数判別
法を説明する図。
FIG. 1 is a diagram illustrating a color number determination method of a color determination device according to an embodiment of the present invention.

【図2】本発明の一実施例に係る色数判別装置の構成を
概略的に示すブロック図。
FIG. 2 is a block diagram schematically showing a configuration of a color number determination device according to an embodiment of the present invention.

【図3】色数判別方法を説明するフローチャート。FIG. 3 is a flowchart illustrating a color number determination method.

【図4】色空間の直線状分布の検出による色数判別処理
を説明するフローチャート。
FIG. 4 is a flowchart illustrating a color number determination process by detecting a linear distribution in a color space.

【図5】色空間上のクラスタリングが従来の方法では困
難な場合の色分布の一例を示した図。
FIG. 5 is a diagram showing an example of a color distribution when clustering on a color space is difficult by a conventional method.

【図6】ハフ変換による色空間の直線状分布の検出処理
を説明する図。
FIG. 6 is a diagram illustrating a detection process of a linear distribution in a color space by Hough transform.

【図7】ハフ変換による色空間の直線状分布の検出処理
を説明する図。
FIG. 7 is a diagram illustrating a detection process of a linear distribution in a color space by Hough transform.

【図8】ピーク点検出処理を説明するフローチャート。FIG. 8 is a flowchart illustrating peak point detection processing.

【図9】主成分分析による色数判別処理を説明するフロ
ーチャート。
FIG. 9 is a flowchart illustrating a color number determination process based on principal component analysis.

【図10】主成分分析を説明する図。FIG. 10 is a diagram illustrating principal component analysis.

【図11】主成分分析による色数判別処理により色数が
判別された(色数1)分布の例を示す図。
FIG. 11 is a diagram showing an example of a distribution in which the number of colors is discriminated (the number of colors is 1) by the color number discrimination processing by the principal component analysis.

【図12】主成分分析による色数判別処理により色数が
判別された(色数2)分布の例を示す図。
FIG. 12 is a diagram showing an example of a distribution in which the number of colors is discriminated (the number of colors is 2) by the color number discrimination processing by the principal component analysis.

【図13】主成分分析による色数判別処理により色数が
判別された(色数3)分布の例を示す図。
FIG. 13 is a diagram showing an example of a distribution in which the number of colors is discriminated (the number of colors is 3) by the number-of-colors discrimination processing by the principal component analysis.

【図14】カラー画像の領域識別の一例を示す図。FIG. 14 is a diagram showing an example of area identification of a color image.

【図15】クラスタリングによる少色化を説明するフロ
ーチャート。
FIG. 15 is a flowchart illustrating color reduction by clustering.

【図16】図15の少色化処理を説明するフローチャー
ト。
16 is a flowchart for explaining the color reduction processing of FIG.

【図17】直線状分布の分割方法について説明する図。FIG. 17 is a diagram illustrating a method of dividing a linear distribution.

【図18】直線状の点分布をクラスタリングする一例を
示した図。
FIG. 18 is a diagram showing an example of clustering a linear point distribution.

【図19】色空間にクラスタリングされた色分布の一例
を示した図。
FIG. 19 is a diagram showing an example of color distribution clustered in a color space.

【図20】少色化の一例を示した図。FIG. 20 is a diagram showing an example of color reduction.

【図21】色分布のつながりの原因を説明する図。FIG. 21 is a diagram illustrating a cause of connection of color distributions.

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

101〜103…直線状点分布、104…第1主成分
軸、105…第2主成分軸、201…CPU、202…
CPUバス、203…記憶装置、204…主記憶装置、
205…データ入力装置、206…入力インタフェイス
装置、207…出力インタフェイス装置、208…画像
入力装置、209…画像出力装置。
101 to 103 ... Linear point distribution, 104 ... First principal component axis, 105 ... Second principal component axis, 201 ... CPU, 202 ...
CPU bus, 203 ... Storage device, 204 ... Main storage device,
205 ... Data input device, 206 ... Input interface device, 207 ... Output interface device, 208 ... Image input device, 209 ... Image output device.

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 庁内整理番号 FI 技術表示箇所 H04N 1/60 1/46 4226−5C H04N 1/40 D 4226−5C 1/46 Z ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 6 Identification code Office reference number FI Technical display location H04N 1/60 1/46 4226-5C H04N 1/40 D 4226-5C 1/46 Z

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 カラー画像の特定領域内の色数を求める
色判別装置において、 前記カラー画像を入力するカラー画像入力手段と、 前記カラー画像に対して色数を求める画像領域を指定す
る領域指定手段と、 この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、 この切出手段により切り出された画像領域の各画素を色
空間上に写像する写像手段と、 この写像手段により写像された前記画素の色空間上の点
分布から色数を判別する色数判別手段と、 この色数判別手段により判別された色数を出力する色数
出力手段と、 を具備することを特徴とする色判別装置。
1. A color discriminating apparatus for obtaining the number of colors in a specific area of a color image, and a color image input means for inputting the color image, and an area designation for specifying an image area for obtaining the number of colors for the color image. Means, cropping means for cropping the image area designated by the area designating means from the color image input by the color image input means, and each pixel of the image area sliced by the cropping means on a color space. Mapping means for mapping, color number discriminating means for discriminating the color number from the point distribution on the color space of the pixels imaged by the mapping means, and color number for outputting the color number discriminated by the color number discriminating means. A color discrimination device comprising: an output unit.
【請求項2】 カラー画像の特定領域内の色数を求める
色判別装置において、 前記カラー画像を入力するカラー画像入力手段と、 前記カラー画像に対して色数を求める画像領域を指定す
る領域指定手段と、 この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、 この切出手段により切り出された画像領域の各画素を色
空間上に写像する写像手段と、 この写像手段により写像された画素の色空間上の各点を
ハフ(Hough)変換する変換手段と、 この変換手段によりハフ変換された前記色空間上の各点
の分布から、この分布の極大点を検出することにより色
数を判別する色数判別手段と、 この色数判別手段により判別された色数を出力する色数
出力手段と、 を具備することを特徴とする色判別装置。
2. A color discriminating apparatus for obtaining the number of colors in a specific area of a color image, and a color image input means for inputting the color image, and an area designation for specifying an image area for obtaining the number of colors for the color image. Means, cropping means for cropping the image area designated by the area designating means from the color image input by the color image input means, and each pixel of the image area sliced by the cropping means on a color space. From the mapping means for mapping, the transforming means for Hough transforming each point in the color space of the pixel mapped by this mapping means, and the distribution of each point in the color space Hough transformed by this transforming means A color number discriminating means for discriminating the color number by detecting the maximum point of this distribution, and a color number outputting means for outputting the color number discriminated by the color number discriminating means. Color discrimination and wherein the.
【請求項3】 カラー画像の特定領域内の色数を求める
色判別装置において、 前記カラー画像を入力するカラー画像入力手段と、 前記カラー画像に対して色数を求める画像領域を指定す
る領域指定手段と、 この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、 この切出手段により切り出された画像領域の各画素を色
空間上に写像する写像手段と、 この写像手段により写像された画素の色空間上の点分布
を主成分分析する主成分分析手段と、 この主成分分析手段により得られた第1主成分の値をあ
らかじめ設定される所定値と比較することにより色数を
求める第1主成分比較手段と、 前記主成分分析手段により得られた第2主成分の値をあ
らかじめ設定された所定値と比較することにより色数を
求める第2主成分比較手段と、 前記第1主成分比較手段、および第2主成分比較手段に
より求められた色数を出力する色数出力手段と、 を具備することを特徴とする色判別装置。
3. A color discriminating apparatus for obtaining the number of colors in a specific area of a color image, and a color image input means for inputting the color image, and an area designation for specifying an image area for obtaining the number of colors for the color image. Means, clipping means for clipping the image area designated by the area designating means from the color image input by the color image input means, and each pixel of the image area clipped by the clipping means in the color space. Mapping means for mapping, principal component analysis means for principal component analysis of the point distribution in the color space of the pixels mapped by this mapping means, and the value of the first principal component obtained by this principal component analysis means is set in advance. A first principal component comparing unit that obtains the number of colors by comparing it with a predetermined value, and a second preset principal component value obtained by the principal component analyzing unit. A second principal component comparing means for obtaining the number of colors by comparing; and a first and second principal component comparing means, and a color number outputting means for outputting the number of colors obtained by the second principal component comparing means. A color discrimination device characterized by.
【請求項4】 カラー画像の特定領域内の色数を求める
色判別装置において、 前記カラー画像を入力するカラー画像入力手段と、 前記カラー画像に対して色数を求める画像領域を指定す
る領域指定手段と、 この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、 この切出手段により切り出された画像領域の各画素を色
空間上に写像する写像手段と、 この写像手段により色空間上に写像された画像領域を少
色化する少色化手段と、 この少色化手段により少色化された画像領域のカラー画
像を出力する画像出力手段と、 を具備することを特徴とする色判別装置。
4. A color discriminating apparatus for obtaining the number of colors in a specific area of a color image, and a color image input means for inputting the color image, and an area designation for specifying an image area for obtaining the number of colors for the color image. Means, cropping means for cropping the image area designated by the area designating means from the color image input by the color image input means, and each pixel of the image area sliced by the cropping means on a color space. Mapping means for mapping, decolorizing means for decolorizing the image area mapped on the color space by the mapping means, and image for outputting a color image of the image area decolorized by the decolorizing means A color discrimination device comprising: an output unit.
【請求項5】 カラー画像の特定領域内の色数を求める
色判別装置において、 前記カラー画像を入力するカラー画像入力手段と、 前記カラー画像に対して色数を求める画像領域を指定す
る領域指定手段と、 この領域指定手段により指定された画像領域を前記カラ
ー画像入力手段により入力されたカラー画像から切り出
す切出手段と、 この切出手段により切り出された画像領域の各画素を色
空間上に写像する写像手段と、 この写像手段により写像された画素の色空間上の各点を
ハフ(Hough)変換する変換手段と、 この変換手段によりハフ変換された前記色空間上の各点
の分布から、この分布の極大点を検出する極大点検出手
段と、 この極大点検出手段により検出された極大点から色空間
上での直線状の点分布の位置を検出する直線成分検出手
段と、 この直線成分検出手段により検出された色空間の直線状
の点分布を分割する直線成分分割手段と、 この直線成分分割手段により分割された色空間の直線状
の点分布を含めて色空間上の点分布のクラスタリングを
行うクラスタリング手段と、 このクラスタリング手段によりクラスタリングされた各
クラスタ内の色を1つの色で置き換えることにより少色
化するデータ置換え手段と、 このデータ置換え手段により少色化された画像領域のカ
ラー画像を出力する画像出力手段と、 を具備することを特徴とする色判別装置。
5. A color discriminating apparatus for obtaining the number of colors in a specific area of a color image, and a color image input means for inputting the color image, and an area designation for specifying an image area for obtaining the number of colors for the color image. Means, cropping means for cropping the image area designated by the area designating means from the color image input by the color image input means, and each pixel of the image area sliced by the cropping means on a color space. From the mapping means for mapping, the transforming means for Hough transforming each point in the color space of the pixel mapped by this mapping means, and the distribution of each point in the color space Hough transformed by this transforming means , A maximum point detecting means for detecting the maximum point of this distribution, and a straight line forming means for detecting the position of the linear point distribution on the color space from the maximum point detected by the maximum point detecting means. Detecting means, linear component dividing means for dividing the linear point distribution of the color space detected by the linear component detecting means, and linear point distribution of the color space divided by the linear component dividing means Clustering means for clustering point distributions in the color space, data replacement means for reducing the color by replacing the colors in each cluster clustered by this clustering means with one color, and this data replacement means for reducing the number of colors An image output unit for outputting a color image of a converted image region, and a color discrimination device comprising:
JP18845493A 1993-07-29 1993-07-29 Color discriminating apparatus and color discriminating method Expired - Fee Related JP3483912B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18845493A JP3483912B2 (en) 1993-07-29 1993-07-29 Color discriminating apparatus and color discriminating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18845493A JP3483912B2 (en) 1993-07-29 1993-07-29 Color discriminating apparatus and color discriminating method

Publications (2)

Publication Number Publication Date
JPH0744709A true JPH0744709A (en) 1995-02-14
JP3483912B2 JP3483912B2 (en) 2004-01-06

Family

ID=16223990

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18845493A Expired - Fee Related JP3483912B2 (en) 1993-07-29 1993-07-29 Color discriminating apparatus and color discriminating method

Country Status (1)

Country Link
JP (1) JP3483912B2 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1998051995A1 (en) * 1997-05-15 1998-11-19 Mitsubishi Denki Kabushiki Kaisha Navigator
JP2002024825A (en) * 2000-07-11 2002-01-25 Toshiba Corp Image processing device, image processing method and certificate producing device
JP2007116419A (en) * 2005-10-20 2007-05-10 Fuji Xerox Co Ltd Method for specifying color to be used in original, image processing apparatus and program
US7280688B2 (en) 1998-12-09 2007-10-09 Fujitsu Limited Image processing apparatus and pattern extraction apparatus
JP2011193294A (en) * 2010-03-15 2011-09-29 Toshiba Corp Document image processing apparatus, document image processing method and document image processing program
JP2012239518A (en) * 2011-05-16 2012-12-10 Hoya Corp Electronic endoscope system, image processing method and software
JP2013069043A (en) * 2011-09-21 2013-04-18 Mega Chips Corp Segment and arc detection device
US9467596B2 (en) 2014-10-31 2016-10-11 Pfu Limited Image-processing apparatus, image-processing method, and computer program product

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1998051995A1 (en) * 1997-05-15 1998-11-19 Mitsubishi Denki Kabushiki Kaisha Navigator
US6219614B1 (en) 1997-05-15 2001-04-17 Mitsubishi Denki Kabushiki Kaisha Navigation system providing simplified navigation instructions using graphics and voice guidance to preferred routes and using landmarks
US7280688B2 (en) 1998-12-09 2007-10-09 Fujitsu Limited Image processing apparatus and pattern extraction apparatus
US7349571B2 (en) 1998-12-09 2008-03-25 Fujitsu Limited Image processing apparatus and pattern extraction apparatus
JP2002024825A (en) * 2000-07-11 2002-01-25 Toshiba Corp Image processing device, image processing method and certificate producing device
JP2007116419A (en) * 2005-10-20 2007-05-10 Fuji Xerox Co Ltd Method for specifying color to be used in original, image processing apparatus and program
JP4539526B2 (en) * 2005-10-20 2010-09-08 富士ゼロックス株式会社 Image processing apparatus and program
JP2011193294A (en) * 2010-03-15 2011-09-29 Toshiba Corp Document image processing apparatus, document image processing method and document image processing program
JP2012239518A (en) * 2011-05-16 2012-12-10 Hoya Corp Electronic endoscope system, image processing method and software
JP2013069043A (en) * 2011-09-21 2013-04-18 Mega Chips Corp Segment and arc detection device
US9467596B2 (en) 2014-10-31 2016-10-11 Pfu Limited Image-processing apparatus, image-processing method, and computer program product

Also Published As

Publication number Publication date
JP3483912B2 (en) 2004-01-06

Similar Documents

Publication Publication Date Title
US6714689B1 (en) Image synthesizing method
JP3574170B2 (en) Distributed image processing device
US7822224B2 (en) Terrain map summary elements
JP2000105774A (en) Method for visualizing image characteristic measure
US7075681B1 (en) System and method for reducing the data volume of images
JP3483912B2 (en) Color discriminating apparatus and color discriminating method
JPH10149441A (en) Picture processing method and device therefor
JPH05250472A (en) Method and device for preparing fine mask of boundary on image in concerned area so as to separate area from remaining parts of image
US5825916A (en) Illuminant color detection
JP2522369B2 (en) Color image limited color representation method and apparatus
JP2936599B2 (en) Color image processing equipment
EP0689168B1 (en) Image processing method and apparatus
JP2002117402A (en) Image processing method and device thereof
US20030059113A1 (en) System and method for creating unclassified line drawings from classified NTM images
JP2000074643A (en) Method and device for converting three-dimensional distance data and storing medium storing program for data conversion
JPH0636048A (en) Volume data clipping system
JP2000182056A (en) Picture processor
JP2860992B2 (en) Moving target extraction method
EP1018694B1 (en) System and method for automatic graph parsing
JPH06274618A (en) Area identifying device
JP3268014B2 (en) Color extraction device
JPH05135171A (en) Processor for color image and border part detecting method
JPS61131183A (en) Picture processing system
JPH05128224A (en) Color extracting device for color picture and method therefor
JPH0534117A (en) Image processing method

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081017

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20081017

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20091017

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20101017

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees