JPH0340078A - Color discriminating device - Google Patents

Color discriminating device

Info

Publication number
JPH0340078A
JPH0340078A JP1175180A JP17518089A JPH0340078A JP H0340078 A JPH0340078 A JP H0340078A JP 1175180 A JP1175180 A JP 1175180A JP 17518089 A JP17518089 A JP 17518089A JP H0340078 A JPH0340078 A JP H0340078A
Authority
JP
Japan
Prior art keywords
color
window
hue
chromatic
averaging
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
JP1175180A
Other languages
Japanese (ja)
Other versions
JP2851060B2 (en
Inventor
Yasuhiko Nakano
泰彦 中野
Shigeru Yoshida
茂 吉田
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP1175180A priority Critical patent/JP2851060B2/en
Publication of JPH0340078A publication Critical patent/JPH0340078A/en
Application granted granted Critical
Publication of JP2851060B2 publication Critical patent/JP2851060B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Character Input (AREA)
  • Image Processing (AREA)

Abstract

PURPOSE:To decrease the influence by a color misalignment, to prevent the deterioration of discrimination accuracy of a color, and to utilize color format information as character segmenting information by averaging a chromatic color at every window of plural picture elements. CONSTITUTION:An image area P is divided, for instance, into windows W00 - W45 such as 16 picture elements in the horizontal direction and 4 picture elements in the vertical direction, and the hue of a chromatic color part in each window is averaged. In order to average the hue in such a way, an HSV converting circuit 10 for obtaining H, S and V signals from R, G and B signals, a comparator 11 for comparing the S signal with a threshold TS for separating to a chromatic color or an achromatic color, and a hue averaging part 12 for averaging the hue of a chromatic color in the window are provided. In such a way, the hue is converted to an average value, and a color distribution becomes narrow, therefore, color coding by a threshold is facilitated.

Description

【発明の詳細な説明】 [目次] 概要 産業上の利用分野 従来の技術(第5図、第6図) 発明が解決しようとする課題 課題を解決するための手段(第1図〉 作用 実施例(第2図、第3図、第4図〉 発明の効果 〔概要〕 色識別装置に係り、 エツジ部分で無彩色については色がついたり、有彩色に
ついては色が変化することによる書式分離情報に雑音混
入防止することを目的とし、原画像信号を色相(H)、
彩度(S)、輝度(V)により出力するHSV変換手段
を備えた色識別装置において、原画像の複数の画素で構
成されるウィンドウ区分内の色相を平均する色相平均化
手段を具備したことを特徴とする。
[Detailed description of the invention] [Table of contents] Overview Industrial field of application Prior art (Figures 5 and 6) Means for solving the problems to be solved by the invention (Figure 1) Working examples (Figures 2, 3, and 4) Effects of the invention [Summary] Relating to a color identification device, format separation information is obtained by adding color to achromatic colors and changing color to chromatic colors at edge portions. In order to prevent noise from entering the original image signal, the original image signal is divided into hue (H),
A color identification device equipped with an HSV conversion means for outputting saturation (S) and luminance (V), including a hue averaging means for averaging the hue within a window section consisting of a plurality of pixels of an original image. It is characterized by

〔産業上の利用分野〕[Industrial application field]

本発明は色識別装置に係り、特にOCR伝票のようなカ
ラー文書の中で使用される文字とカラー書式とを正確に
分離するために使用される色識別装置に関するものであ
る。
The present invention relates to a color identification device, and more particularly to a color identification device used to accurately separate characters and color formats used in color documents such as OCR slips.

〔従来の技術〕[Conventional technology]

近年オフィスオートメーションが発展し、文書情報とし
てカラー文書も取扱われるようになってきた。例えば伝
票の種類に応じて枠を異なるカラーで印刷すること等が
行われている。
With the development of office automation in recent years, color documents have come to be handled as document information. For example, frames are printed in different colors depending on the type of slip.

ところで手書き文字読み取り用OCR等においては、文
字記入枠のような書式をドロップ・アウト・カラーと呼
ばれる特殊な色で印刷しており、読み取り時に光学的に
書式を除去し、文字だけ読み取って認識するようにして
いた。しかしこのような方式では、鉛筆、ボールペン等
の筆記用具とドロップ・アウト・カラーの分光特性に合
わせてフィルターを選ぶ必要があり、またドロップ・ア
ウト・カラーとして赤色系を使用するとき印鑑が見えな
くなることがある。また書式情報を活用できないことに
なる。
By the way, in OCR for reading handwritten characters, formats such as character entry frames are printed in a special color called drop-out color, and when reading, the format is optically removed and only the characters are read and recognized. That's what I was doing. However, with this method, it is necessary to select a filter that matches the spectral characteristics of the drop-out color and the writing instrument such as a pencil or ballpoint pen, and the seal becomes invisible when a red color is used as the drop-out color. Sometimes. Also, format information cannot be utilized.

これを解決するため伝票等の原稿を3色の画像信号とし
て読み取り、彩度;色相;輝度(以下S ; 5atu
ration+ H; Hue、 V ; Value
で表わす)に変換を行うとともに、彩度で所定の闇値に
より無彩色と有彩色に分けた後、無彩色の輝度を文字認
識に用い、有彩色は色相を予め定めた複数の闇値で2値
または色数分の多値画像として出力するHSV方式の識
別方式が提案されている。
To solve this problem, documents such as slips are read as three-color image signals, and saturation; hue; brightness (hereinafter referred to as S; 5atu
ration+H; Hue, V; Value
After dividing into achromatic colors and chromatic colors based on a predetermined darkness value using saturation, the luminance of achromatic colors is used for character recognition, and chromatic colors are converted into hues using multiple darkness values with predetermined hue values. An HSV identification method has been proposed that outputs a binary image or a multi-valued image corresponding to the number of colors.

ところでHSV座標では、第5図に示す如きHSVS標
領域で背景、文字と文字記入枠領域等が示される。即ち
、第5図(A)に示す如く、背景、文字は無彩色となる
ため、HSV座標内で内側の円筒の領域に入り、またカ
ラーの文字記入枠は有彩色となるため外側の中空円筒の
領域に入る。11SV変換後のこの性質を利用して、ま
ずSで闇値をかけ無彩色である文字背景と、有彩色であ
る文字記入枠とを分離する。そして分離された無彩色か
らVで閾値をかけ、文字と背景とを区別する。
By the way, in the HSV coordinates, the background, characters, character entry frame area, etc. are shown in the HSVS mark area as shown in FIG. That is, as shown in Fig. 5 (A), since the background and characters are achromatic, they fall within the area of the inner cylinder in HSV coordinates, and the colored character entry frame is chromatic, so they fall within the outer hollow cylinder. into the realm of. Utilizing this property after the 11SV conversion, first, the darkness value is multiplied by S to separate the character background, which is achromatic, from the character entry frame, which is chromatic. Then, a threshold value is applied to the separated achromatic color by V to distinguish the characters from the background.

一方、有彩色の方は、伝票で用いる代表的な色について
、第5図(B)に示す如く、色相を分離する闇値を予め
決めておき、この闇値により予め定めた色数分の多値画
像として識別する。
On the other hand, for chromatic colors, as shown in Figure 5 (B), a darkness value for separating the hues is determined in advance for typical colors used on the slip, and this darkness value is used to divide the number of colors into a predetermined number. Identifies it as a multivalued image.

このため、従来では、第6図に示す如く、カラー伝票の
如き原稿43を読み取る画像読取部41と、色識別部4
2を設ける。画像読取部41にはレンズ上1、L2、L
3と、赤色光を通過させる赤色フィルタRFと、緑色光
を通過させる緑色フィルタCFと、青色光を通過させる
青色フィルタBFと、赤色光を検出するチャージ・カッ
プルド・デバイス(CCD)CL緑色光を検出するCC
DC2、青色光を検出するCCDC5の如き1画素単位
の光電素子と、壜幅器A1〜A3と、アナログ信号をデ
ィジタル信号に変換するADコンバータADCI〜AD
C3等が設けられ、また色識別部42にはHSV変換回
路50と、比較回路51〜53と、マルチプレクサ54
.55等が設けられる。
For this reason, conventionally, as shown in FIG.
2 will be provided. The image reading unit 41 has lenses 1, L2, and L on the lens.
3, a red filter RF that passes red light, a green filter CF that passes green light, a blue filter BF that passes blue light, and a charge coupled device (CCD) CL that detects red light. CC to detect
DC2, a photoelectric element for each pixel such as CCDC5 that detects blue light, scalers A1 to A3, and AD converters ADCI to AD that convert analog signals to digital signals.
C3, etc., and the color identification section 42 includes an HSV conversion circuit 50, comparison circuits 51 to 53, and a multiplexer 54.
.. 55 etc. are provided.

第6図において、画像読取部41のレンズ上1〜L3、
赤色フィルタRF、緑色フィルタCF、青色フィルタB
Fと、CCDC1〜CCDC5と、ADコンバータAD
1〜AD3により、R,G、Bの3系統の光学信号系を
構成して原稿43の3色分の画像信号ライン単位に読み
取り、ライン中の画像信号を1画素単位のディジタル信
号に変換し、信号線RN、G7!、BlによりこれらR
,、G。
In FIG. 6, the upper lenses 1 to L3 of the image reading unit 41,
Red filter RF, green filter CF, blue filter B
F, CCDC1 to CCDC5, and AD converter AD
1 to AD3 constitute a three-system optical signal system of R, G, and B, read the image signals of the three colors of the original 43 line by line, and convert the image signals in the lines into digital signals for each pixel. , signal line RN, G7! , Bl these R
,,G.

S信号をHSV変換回路50に伝達する。HSV変換回
路50では、これらR,G、Bの3色分の信号によりS
信号、S信号、■信号に変換し、出力する。
The S signal is transmitted to the HSV conversion circuit 50. In the HSV conversion circuit 50, the S
Convert to signal, S signal, ■ signal and output.

次にS信号が比較回路51に人力され、予め定められた
閾値T、と比較される。第5図(A)に示す如く、この
閾値T、は無彩色か有彩色かを分離するものであり、こ
れより小さいときは文字、背景とされ、大きいときカラ
ー書式とされる。即ち、比較回路51はS<Tsなら無
彩色とみて例えば「0」を出力し、S≧T、なら有彩色
とみて例えば「1」を出力する。
Next, the S signal is input to the comparison circuit 51 and compared with a predetermined threshold T. As shown in FIG. 5(A), this threshold value T is used to distinguish between an achromatic color and a chromatic color, and when it is smaller than this, it is used as a character or background, and when it is larger, it is used as a color format. That is, if S<Ts, the comparison circuit 51 considers the color to be achromatic and outputs, for example, "0", and if S≧T, it considers it to be a chromatic color and outputs, for example, "1".

一方、■信号、S信号はそれぞれ比較回路52.53に
人力される。比較回路52には閾値Tvが無彩色のうち
文字と背景の輝度を区別するため印加され、■信号がこ
れより小さいとき黒部分即ち文字部分とする。比較回路
53には闇値THが色を区別するため印加されている。
On the other hand, the ■ signal and the S signal are input to comparison circuits 52 and 53, respectively. A threshold value Tv is applied to the comparison circuit 52 in order to distinguish between the brightness of characters and the background among the achromatic colors, and when the ■ signal is smaller than this, it is determined as a black part, that is, a character part. A darkness value TH is applied to the comparison circuit 53 in order to distinguish colors.

第5図(B)に示す如く、この閾値THは、T1が赤と
黄を区別するもの、T2が黄と緑を区別するもの、T3
が緑とシアンを区別するもの、T4がシアンと青を区別
するもの、T5が青とマゼンタを区別するものである。
As shown in FIG. 5(B), the threshold TH is T1 for distinguishing between red and yellow, T2 for discriminating between yellow and green, and T3 for discriminating between yellow and green.
is for distinguishing between green and cyan, T4 is for distinguishing between cyan and blue, and T5 is for distinguishing between blue and magenta.

そして闇値T1以下が赤であり、T5以上がマゼンタで
ある。従って第5図(B)より類推されるように、文字
記入枠が1色、つまり書式のカラーが1色なら区別する
必要はないが、2色例えば2種類の書式を区別するとき
なら闇値1個、3色なら闇値2個、以下同様に6色を区
別するときなら闇値5個というように伝票等に用いられ
る色数によりその闇値と値と個数を決めておく。
The darkness value below T1 is red, and the darkness value above T5 is magenta. Therefore, as can be inferred from Figure 5 (B), if the character entry frame is one color, that is, the color of the format is one color, there is no need to differentiate, but if you want to distinguish between two colors, for example, two types of formats, the darkness value The darkness value, value, and number are determined based on the number of colors used on the slip, etc., such as 2 darkness values for 1 or 3 colors, 5 darkness values for 6 colors, and so on.

なお、比較回路52は、入力されたV信号を闇値Tvと
比較し、v<’rvなら文字とみて例えば「1」を出力
し、T≧TVなら背景とみて例えば「0」を出力する。
Note that the comparison circuit 52 compares the input V signal with the darkness value Tv, and if v<'rv, it treats it as a character and outputs, for example, "1", and if T≧TV, it treats it as a background and outputs, for example, "0". .

さらにこの比較回路52の出力信号は、前記比較回路5
1の出力により制御されるマルチプレクサ54により無
彩色部分は、即ちs<’rsの場合にはそのまま出力さ
れるが、S≧T、つまり有彩色の文字記入枠の部分は、
マルチプレクサ53に伝達されている「0」が出力され
、ドロツプ・アウト・カラーを用いて読み取ったのと同
様に除去される。なお、マルチプレクサ54の出力信号
S4は、その後段の文字認識部(図示省略)に伝達され
る。
Furthermore, the output signal of this comparison circuit 52 is
The achromatic portion is output as is by the multiplexer 54 controlled by the output of 1, that is, when s<'rs, but the portion of the chromatic character entry frame when S≧T is output as is.
The "0" being passed to multiplexer 53 is output and removed in the same way as if it were read using a drop-out color. Note that the output signal S4 of the multiplexer 54 is transmitted to a subsequent character recognition section (not shown).

マルチプレクサ55は、マルチプレクサ54とは逆に、
比較回路51から「1」が伝達されるとき、比較回路5
3の出力が、つまり文字記入枠情報がそのまま出力され
、比較回路51から「0」が伝達されたとき、即ちS<
T、つまり無彩色のとき、マルチプレクサ55に伝達さ
れている「0」が出力される。
The multiplexer 55, contrary to the multiplexer 54,
When “1” is transmitted from the comparison circuit 51, the comparison circuit 5
3, that is, the character entry frame information is output as is, and when "0" is transmitted from the comparator circuit 51, that is, S<
When the color is T, that is, an achromatic color, "0", which is transmitted to the multiplexer 55, is output.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

実際に原稿43を画像読取部41で読み取るとき、フラ
ットベツド型のスキャナが使用されるので、カラーで読
み取ると、通常3色(例えばRGB)の色間で2画素ま
たは2ライン程度の位置ずれが生しる。これは、例えば
RGBの階調が等量であるとき、その画素の色は無彩色
になるが、例えば文字のエツジでは色バランスが崩れる
ため色がつき、有彩色に変わる。一方、有彩色について
はエツジで色が変化するが無彩色になることはない。従
って前記第4図に記載の手法により、彩度で閾値をかけ
ると有彩色として分離した書式情報に文字の輪郭(エツ
ジ)部分が雑音として混入し、文字切り出し情報として
そのままでは使用しにくい欠点があった。また色ずれが
あるため、特定の色の書式の抽出をするにも困難があっ
た。
When the original 43 is actually read by the image reading unit 41, a flatbed scanner is used, so when reading in color, there is usually a positional deviation of about 2 pixels or 2 lines between the three colors (for example, RGB). Live. This is because, for example, when the RGB gradations are equal, the color of the pixel is achromatic, but for example, at the edge of a character, the color balance is disrupted and the pixel becomes colored, turning into a chromatic color. On the other hand, for chromatic colors, the color changes at the edges but never becomes achromatic. Therefore, when applying a threshold value based on saturation using the method shown in Fig. 4 above, the edge of the character will be mixed in as noise in the format information separated as chromatic colors, which has the drawback that it is difficult to use it as is as character extraction information. there were. Furthermore, because of the color shift, it was difficult to extract formats with specific colors.

従って本発明の目的は、このような問題点を解決した色
識別装置を提供することである。
Therefore, an object of the present invention is to provide a color identification device that solves these problems.

〔課題を解決するための手段〕[Means to solve the problem]

前記目的を達成するため、本発明では、第1図(A)に
示す如く、画像領域Pを例えば横方向16画素縦力向4
画素の如きウィンドウ内0゜〜W4゜に分割し、各ウィ
ンドウ内における有彩色部分の色相を平均化する。なお
第1図(A)は80×20画素を6×5の30ウィンド
ウ分割した状態を示す。
In order to achieve the above object, in the present invention, as shown in FIG.
A window such as a pixel is divided into 0° to W4°, and the hue of the chromatic color portion within each window is averaged. Note that FIG. 1(A) shows a state in which 80×20 pixels are divided into 30 windows of 6×5.

このような色相平均化のために、第1図(B)に示す如
く、R,G、B信号からH,S、V信号を得るHSV変
換回路10、S信号を有彩色か無彩色に分離するための
閾値T、と比較する比較器11、ウィンドウ内の有彩色
の色相を平均化する色相平均化部12を設ける。この色
相平均化部12は、アンドゲート13、加算器14、ラ
インメモリ15、レジスタ16、メモリカウンタ17、
メモリ制御部18、平均化部19を具備している。
For such hue averaging, as shown in FIG. 1(B), an HSV conversion circuit 10 obtains H, S, and V signals from R, G, and B signals, and separates the S signal into chromatic color or achromatic color. A comparator 11 that compares the chromatic color with a threshold value T, and a hue averaging unit 12 that averages the hues of chromatic colors within the window are provided. This hue averaging section 12 includes an AND gate 13, an adder 14, a line memory 15, a register 16, a memory counter 17,
It includes a memory control section 18 and an averaging section 19.

今、第1図(A)の画像領域PをウィンドウWo0から
W。S方向つまり主走査方向に走査する。このとき1ウ
インドウ当たり4ラインで走査されるので、ウィンドウ
内、。〜W0.は走査ライン10〜13で走査される。
Now, the image area P in FIG. 1(A) is moved from window Wo0 to window W. Scanning is performed in the S direction, that is, the main scanning direction. At this time, 4 lines are scanned per window, so within the window. ~W0. is scanned in scan lines 10-13.

まず、走査ラインgoで走査されたことにより得られた
R、G、B信号が、第1図(B)に示すHSV変換回路
10に入力され、各画素毎にHlS、■信号にそれぞれ
変換される。S信号は比較器11に入力され、閾値Ts
より大きい画素部分つまり有彩色画素と判断された画素
のみ比較器11より「1」が出力される。したがってア
ントゲ−113からこの有彩色のH信号つまりH値が加
算器14に入力される。加算器14の一方の入力は、初
めのライン20についてはrOJであり、ラインメモリ
15は画像領域の1ライン分の画素に対するメモリ容量
を持つので、ラインメモリ15に前記ウィンドウ対応。
First, the R, G, and B signals obtained by scanning with the scanning line go are input to the HSV conversion circuit 10 shown in FIG. Ru. The S signal is input to the comparator 11, and the threshold Ts
The comparator 11 outputs "1" only for the larger pixel portion, that is, the pixel determined to be a chromatic pixel. Therefore, this chromatic H signal, that is, the H value, is input from the anime game 113 to the adder 14. One input of the adder 14 is rOJ for the first line 20, and since the line memory 15 has a memory capacity for one line of pixels in the image area, the line memory 15 corresponds to the window.

〜13osの画素対応の有彩色のH値が記入される。な
お、このライン(0方向の処理のとき、メモリカウンタ
17が比較器11の出力「1」の数をカウントする。こ
のときメモリ制御部18はラインlOの16画素毎にメ
モリカウンタ17のカウント値を読み保持する。
A chromatic H value corresponding to a pixel of ~13os is entered. Note that when processing this line (in the 0 direction), the memory counter 17 counts the number of output "1"s of the comparator 11. At this time, the memory control unit 18 calculates the count value of the memory counter 17 for every 16 pixels of line lO. read and retain.

次にウィンドウ対応。〜W0.に対しライン11方向に
おける同様な処理が行われるが、このとき、ラインメモ
リ15は前記ライン11方向の処理により得られた1ラ
イン分の画素に対するH値が保持されている。従って、
ライン11方向における処理について、まず第1図(A
)における画素Eo。
Next is window support. ~W0. Similar processing is performed in the line 11 direction, but at this time, the line memory 15 holds the H value for one line of pixels obtained by the processing in the line 11 direction. Therefore,
Regarding the processing in the direction of line 11, first see Figure 1 (A
) at pixel Eo.

のH値が、画素Eo。に対して比較器11より「1」が
出力されるとき、アンドゲート13を経由して加算器1
4に印加される。このとき、ラインメモリ15の画素E
o。についてのH値がレジスタ16に一時保持され、こ
れが加算器14に伝達されるので、結局加算器14では
画素E。0とEIOとの加算値が出力され、ラインメモ
リ15に保持される。そして次にラインメモリ15から
画素EoのH値がレジスタ16に一時保持されるので、
加算器14では画素E。、とElfのH値が加算され、
ラインメモリ15に保持される。このようにしてライン
11方向の走査によりラインβ0との加算処理が行われ
る。それからライン12方向の処理により画素E2゜の
H値がアンドゲート13を経由して加算器14に伝達さ
れ、今度は(Eoo+E+。)との加算が行われる。こ
のようにしてライン13方向の走査が行われたとき、ラ
インメモリ15には、この4回の加算結果が画素の走査
位置対応に応して保持される。このとき、メモリ制御部
18には、走査ラインI2.−n3について、ブロソク
毎にその有彩色個数に応じたデータが保持される。従っ
て、メモリ制御部18は、平均化部11 9に対し、各ウィンドウ対応にラインメモリ15に保持
したH値と有彩色個数に応じたデータを出力するので、
平均値化部19は、後述するように、これらにもとづき
、各ウィンドウ毎のH値の平均値つまり色相の平均値が
算出される。
The H value of pixel Eo. When "1" is output from the comparator 11, the adder 1 is output via the AND gate 13.
4. At this time, pixel E of line memory 15
o. The H value for pixel E is temporarily held in the register 16, and is transmitted to the adder 14, so that the adder 14 ends up in the pixel E. The added value of 0 and EIO is output and held in the line memory 15. Then, the H value of pixel Eo from the line memory 15 is temporarily held in the register 16, so
Pixel E in adder 14; , and the H value of Elf are added,
It is held in the line memory 15. In this way, addition processing with line β0 is performed by scanning in the direction of line 11. Then, by processing in the direction of line 12, the H value of pixel E2° is transmitted to the adder 14 via the AND gate 13, where it is then added to (Eoo+E+). When scanning is performed in the line 13 direction in this manner, the line memory 15 holds the results of the four additions in accordance with the scanning position correspondence of the pixels. At this time, the memory control unit 18 stores scanning lines I2. -n3, data corresponding to the number of chromatic colors is held for each block. Therefore, the memory control unit 18 outputs data corresponding to the H value and the number of chromatic colors held in the line memory 15 for each window to the averaging unit 119.
Based on these, the averaging unit 19 calculates the average value of the H values for each window, that is, the average value of the hue, as will be described later.

〔作用〕[Effect]

本発明により各ウィンドウ毎に色相平均値が算出され、
同一ウィントウ内の有彩色部分をこの平均値で置換する
。これにより色相が平均値化され、つまり、特定エツジ
部分に濃い色が離散的に存在する場合でもこれが薄めら
れること、即ち色分布が狭くなるので闇値で色分けする
ことが容易となる。
According to the present invention, a hue average value is calculated for each window,
The chromatic parts within the same window are replaced with this average value. As a result, the hue is averaged, that is, even if a dark color exists discretely in a specific edge portion, it is diluted, that is, the color distribution is narrowed, so that it becomes easy to classify colors by darkness value.

〔実施例〕〔Example〕

本発明の一実施例を第2図及び第3図にもとづき説明す
る。
An embodiment of the present invention will be described based on FIGS. 2 and 3.

第2図は本発明の一実施例構成図、第3図(A)はメモ
リ制御部と平均化部の詳細図、第3図(B)2 はテーブルの詳細図である。
FIG. 2 is a block diagram of an embodiment of the present invention, FIG. 3(A) is a detailed diagram of a memory control section and an averaging section, and FIG. 3(B) 2 is a detailed diagram of a table.

第2図において、第1図と同記号部分は同一部分を示し
、1は画像読取部であって第5図の画像読取部41に対
応するもの、2はカラー伝票の如き原稿であり第5図の
原稿43に対応するもの、20は比較器であって明度を
示すV信号を閾値T7と比較してこれより低ければ文字
部分とみて「1」を出力するもの、21はアントゲ−1
・であって比較器20が「1」を出力したときに比較器
11より「0」つまり無彩色と判別されたとき、インバ
ータ22が「1」を出力することにより「1」を出力す
るものであり、換言すればこのアンドゲート21から文
字信号「1」を出力するものである。
In FIG. 2, the same symbols as those in FIG. 1 indicate the same parts, 1 is an image reading section corresponding to the image reading section 41 in FIG. 20 is a comparator which compares the V signal indicating the brightness with a threshold value T7, and if it is lower than this, it is regarded as a character part and outputs "1", 21 is an ant game 1
・When the comparator 20 outputs "1" and the comparator 11 determines "0", that is, an achromatic color, the inverter 22 outputs "1", thereby outputting "1". In other words, the AND gate 21 outputs a character signal "1".

23はヒストグラム用メモリであり、平均値部19によ
り平均値された値をウィンドウサイズ分(第1図(A)
に示す例では16X4)だけヒストグラム用メモリ23
に出力し、色相のヒストグラムを作成するもの、24は
閾値設定部であり、ヒストグラム用メモリ23に保持さ
れたヒストグラムを基に、色相のヒストグラムの谷の部
分に闇値を設定し、ルックアップテーブル25を作成す
るもの、25はルックアップテーブルであり、2枚目の
原稿からは平均化部19を通ったH値がこのルックアッ
プテーブル25を参照しながら色(色番号)が決定され
るものである。なお、ヒストグラム設定及びルックアソ
プテーブル作成手順については、本出願人よりすでに特
許出願済みであり、本発明の対象とする色にしみ補正に
直接関係がないので詳細な説明については省略する。
Reference numeral 23 denotes a histogram memory, which stores the values averaged by the average value section 19 for the window size (Fig. 1 (A)).
In the example shown in , the histogram memory 23 is 16×4).
24 is a threshold value setting unit, which sets a darkness value in the valley of the hue histogram based on the histogram stored in the histogram memory 23, and creates a hue histogram. 25 is a lookup table, and the color (color number) is determined by referring to this lookup table 25 from the H value passed through the averaging unit 19 from the second document. It is. Note that the histogram setting and look assortment table creation procedures have already been patented by the present applicant, and are not directly related to color and stain correction, which is the subject of the present invention, so a detailed explanation will be omitted.

本発明は、前記の如く、各ウィンドウ毎の有彩色部分の
平均値を求めるものであるが、そのために各ウィンドウ
の有彩色部分の画素の個数とこの画素部分のH値の和と
の2つを求めることが必要である。
As described above, the present invention calculates the average value of the chromatic color portion of each window, and for this purpose, the number of pixels in the chromatic color portion of each window and the sum of the H value of this pixel portion are calculated. It is necessary to find out.

この、ウィンドウ内の有彩色部分の画素の個数を求める
ため、例えば、第3図に示す如く、メモリ制御部18に
ウィンドウの縦幅である画素数4(0〜3)をカウント
する第1カウンタ31と、ウィンドウの横幅である画素
数16 (0〜15)ら をカウントする第2カウンタ32と、テーブル33と、
制御部34を設ける。勿論この第1カウンタ31、第2
カウンタ32はラインメモリ15の走査と同期してカウ
ント動作を行う。
In order to obtain the number of pixels in the chromatic color portion within the window, for example, as shown in FIG. 31, a second counter 32 that counts the number of pixels 16 (0 to 15), which is the width of the window, and a table 33.
A control section 34 is provided. Of course, this first counter 31, the second
The counter 32 performs a counting operation in synchronization with the scanning of the line memory 15.

メモリカウンタ17には比較器11より有彩色画素が「
1」として出力されるので、先ずラインe6の状態で走
査されるとき、第1カウンタ31はOをカウントしてい
る。そして第2カウンタ32はOから起動し、15をカ
ウントすると、制御部34はメモリカウンタ17を読み
取り、そのカウント値をテーブル33に記入し、メモリ
カウンタ17をリセットする。したがって、第1図(A
)のウィンドウW0゜、WO+’−・について走査ウィ
ンドウのスキャンにもとづき、第3図(B)に示す如く
、初めの16画素についてメモリカウンタ17がカウン
トした有彩色数Aoがそのカウント区分Coに記入され
、次の16画素についてメモリカウンタ17がカウント
した有彩色数Boが2番目のカウント区分CIに記入さ
れる。このようにして走査ウィンドウに対する横方向の
ウィンドウ数がNのとき、走査ライン2oに関しN個の
データ(Ao=No)がカウント区分C0−CN−1に
記入される。同様に走査ライン*t−7i3についても
それぞれの有彩色数カウント値がそれぞれのカウント区
分に記入され、第3図(B)に示す如き、データが得ら
れる。なおこのテーブル33へのデータの書き込みは、
第1カウンタ31によりβ0〜β3が与えられ、また第
2カウンタ32によりGo”−CN−+が与えられるこ
とによりそのアドレスが指定される。
The memory counter 17 receives chromatic pixels from the comparator 11.
1", the first counter 31 is counting O when the line e6 is first scanned. The second counter 32 starts from O, and when it counts 15, the control unit 34 reads the memory counter 17, writes the count value in the table 33, and resets the memory counter 17. Therefore, Fig. 1 (A
), the chromatic color number Ao counted by the memory counter 17 for the first 16 pixels is entered in the count section Co, as shown in FIG. Then, the chromatic color number Bo counted by the memory counter 17 for the next 16 pixels is written into the second count section CI. In this way, when the number of windows in the horizontal direction for the scanning window is N, N pieces of data (Ao=No) for the scanning line 2o are written in the count sections C0-CN-1. Similarly, for the scanning line *t-7i3, each chromatic color number count value is entered in each count section, and data as shown in FIG. 3(B) is obtained. Note that writing data to this table 33 is as follows:
The first counter 31 gives β0 to β3, and the second counter 32 gives Go''-CN-+, thereby specifying the address.

このようにして横方向の1列のウィンドウに対し所定の
回数の走査(この実施例の例では4回)が行われたとき
、制御部34は今度はウィンドウW。。における有彩色
数を求めるために、テーブル33より走査ラインメモリ
15に対するカウント区分C,oのデータAo、A+、
Ax、A3を読み出してこれらを順次平均化部19の第
2演算部36に送出する。これにより第2演算部36は
Ao+A1+At+A3を演算し、これを−旦保持する
When one row of windows in the horizontal direction has been scanned a predetermined number of times (four times in this embodiment) in this way, the control unit 34 scans the window W this time. . In order to obtain the number of chromatic colors in the table 33, data Ao, A+,
Ax and A3 are read and sequentially sent to the second calculation section 36 of the averaging section 19. As a result, the second arithmetic unit 36 calculates Ao+A1+At+A3 and holds this for the time being.

このとき、メモリ制御部18は、ラインメモリ15から
前記ウィンドウW0゜に対応する16画素のデータをレ
ジスタ16を経由して第1演算部35に順次出力する。
At this time, the memory control unit 18 sequentially outputs 16 pixel data corresponding to the window W0° from the line memory 15 to the first calculation unit 35 via the register 16.

これはメモリ制御部18における制御部34の制御によ
り行われる。第1図について説明した如く、このときラ
インメモリ15の各区分には、走査ラインメモリ15に
よる縦の画素のH値の加算値がそれぞれ記入されている
ので、これらを第1演算部35で加算することにより、
ウィンドウW0゜におけるH値の和が得られることにな
る。そしてこのH値の和を第2演算部36に送出し、前
記(A I+Aa +A3 +A、4)で割算すること
によりこのウィンドウW0゜における閾値T6以上の有
彩色画素のH値の平均値を得る。
This is performed under the control of the control section 34 in the memory control section 18. As explained with reference to FIG. 1, at this time, in each section of the line memory 15, the added values of the H values of the vertical pixels by the scanning line memory 15 are respectively written, so these are added by the first calculation unit 35. By doing so,
The sum of H values in the window W0° is obtained. Then, the sum of the H values is sent to the second calculation unit 36 and divided by the above-mentioned (A I + Aa + A3 + A, 4) to calculate the average value of the H values of the chromatic pixels that are equal to or higher than the threshold T6 in this window W0°. obtain.

次に制御部34はテーブル33よりカウント区分CIの
データメモリ15よりウィンドウW。1に対応する16
画素の各H値のデータを、同様に第1演算部35に送出
してこれらを加算し、ウィンドウW01における有彩色
画素の和を求め、これを第2演算部36において(Bo
+B++Bs+B3)で割算することによりウィンドウ
W01における閾値T5以上の有彩色画素のH値の平均
値を求める。
Next, the control unit 34 selects the window W from the data memory 15 of the count classification CI from the table 33. 16 corresponding to 1
The data of each H value of the pixel is similarly sent to the first calculation section 35 and added together to obtain the sum of the chromatic pixels in the window W01, which is then added to the second calculation section 36 (Bo
+B++Bs+B3) to find the average value of the H values of the chromatic pixels that are equal to or higher than the threshold T5 in the window W01.

このようにして横方向のウィンドウW。[1,WO+に
対する平均値の算出が終わると、次の列のウィンドウw
oos w、、、W 、 2−に対する走査ライン7!
o〜13方向のスキャンデータが順次出力される。そし
てこれらに対して同様な処理が行われ、各ウィンドウに
対してそのH値の平均値が求められることになる。
In this way, the window W in the horizontal direction. [1, After calculating the average value for WO+, the next column window w
Scan line 7 for oos w,,,W,2-!
Scan data in directions o to 13 are sequentially output. Similar processing is then performed on these, and the average value of the H values is determined for each window.

なお、4ライン分の加算値がラインメモリ15に揃うと
、新しいH信号の入力を中断する。そして、前記の如く
、ウィンドウW0゜、Wol・・に対する平均値が計算
されるが、1枚目のトレーニング原稿の読み取りでは、
平均化された値をウィンドウサイズ分(この例では16
X4)だけヒストグラム作成部のヒストグラム用メモリ
23へ出力する。このようにして最初の4走査ラインの
平均化が終了すると、次の4ラインを同様にして平均化
し、これによりウィンドウ数IいWo、W1□−の平均
化処理が行われる。そして画像全体の平均化が終了する
と、色相のヒストグラムをヒス1−グラムメモリ23に
作成する。闇値設定部24では、ヒストグラム用メモリ
23をもとにして色相のヒストグラムの谷の部分に闇値
を設定し、ルックアンプテーブル25を作成することに
なる。そして2枚目の原稿からは平均化部19を通った
のち、ルックアップテーブル25を参照しながら色が決
定されることになるが、本発明の目的とはあまり関係が
ないのでこのヒストグラム作成やルックアンプテーブル
については詳細説明を省略する。
Note that when the added values for four lines are stored in the line memory 15, input of a new H signal is interrupted. Then, as mentioned above, the average value for the windows W0°, Wol, etc. is calculated, but when reading the first training manuscript,
The averaged value is divided by the window size (in this example, 16
X4) is output to the histogram memory 23 of the histogram creation section. When the averaging of the first four scanning lines is completed in this way, the next four lines are similarly averaged, and thereby the averaging process of the number of windows IWo, W1□- is performed. When the averaging of the entire image is completed, a hue histogram is created in the histogram memory 23. The darkness value setting unit 24 sets a darkness value in the valley of the hue histogram based on the histogram memory 23, and creates a look amplifier table 25. After passing through the averaging section 19, the color of the second document is determined by referring to the lookup table 25, but this is not related to the purpose of the present invention, so this histogram creation is not necessary. A detailed explanation of the look amplifier table will be omitted.

なお、本発明では、ウィンドウ内の有彩色画素数算出手
段としては、前記第2図、第3図に示す手段に限定され
るものではなく、例えば第4図に示す如き手段により行
うこともできる。
In the present invention, the means for calculating the number of chromatic pixels in the window is not limited to the means shown in FIG. 2 and FIG. .

即ち、メモリカウンタ37によりウィンドウ内の有彩色
数を各走査ライン毎にカウントする。このときメモリ制
御部38ではアンドゲート39に16画素毎に「1」を
出力してこれをオンにするので、アンドゲート39より
、走査ラインfioについては、例えば第3図(B)の
Ao、Bo−・−N 。
That is, the memory counter 37 counts the number of chromatic colors within the window for each scanning line. At this time, the memory control unit 38 outputs "1" to the AND gate 39 for every 16 pixels to turn it on, so the AND gate 39 outputs "1" to the AND gate 39 for scanning line fio, for example, Ao in FIG. 3(B), Bo-・-N.

n が出力され、加算器40を経由して第2ラインメモリ4
1は順次記入される。なお、第2ラインメモリ41は横
方向のウィンドウ数の区分を有する。
n is output and sent to the second line memory 4 via the adder 40.
1 is filled in sequentially. Note that the second line memory 41 has divisions in the horizontal direction according to the number of windows.

つまり第3図(B)についてはCo−C,、、のN区分
有する。次に走査ライン11によるスキャンが行われる
と、まず、第2ラインメモリ41の初めの区分Coのデ
ータAoがレジスタ42に一時セットされ、メモリカウ
ンタ37によりカウントされたAIがアンドゲート39
を経由して加算器40に入力される。これにより加算器
40ではレジスタ42にセントされたAoとこのA+と
の(Ao+Ar)が計算され、これが第2ラインメモリ
41の区分Coにセントされる。このような制御が走査
ライン*o−A3に対して行われると、第2ラインメモ
リ4の区分COには(Ao+Al+A2+A9)が記入
され、区分C1には(Be十BI十BIl+83)が記
入され、そして区分CN−1には(No+N++N2+
N3)が記入されることになる。従って、走査ラインR
,NI!3による制御が行われたとき、第2ラインメモ
リ41にはこのように各ウィンドウ毎の有彩色数がセッ
トされているので、平均化部19の第2演算部36では
、単に前記割算を行うのみで、平均値を求めることがで
きる。
In other words, in FIG. 3(B), there are N divisions of Co-C, . Next, when scanning is performed by the scanning line 11, data Ao of the first section Co of the second line memory 41 is temporarily set in the register 42, and AI counted by the memory counter 37 is set to the AND gate 39.
The signal is input to the adder 40 via the . As a result, the adder 40 calculates (Ao+Ar) between Ao stored in the register 42 and this A+, and stores this in the section Co of the second line memory 41. When such control is performed on the scanning line *o-A3, (Ao+Al+A2+A9) is written in the section CO of the second line memory 4, and (Be + BI + BIl + 83) is written in the section C1. And in the category CN-1 (No+N++N2+
N3) will be entered. Therefore, the scanning line R
,NI! 3, the number of chromatic colors for each window is set in the second line memory 41 in this way, so the second calculation unit 36 of the averaging unit 19 simply performs the division. You can find the average value just by doing this.

また、ハードウェア化を考えた場合、できるだけ少量の
メモリ構成で処理できることが望ましい。
Furthermore, when considering hardware implementation, it is desirable to be able to process with as little memory as possible.

従ってHSV色変換、平均化処理等のすべての処理はラ
イン単位に行うようにする。
Therefore, all processing such as HSV color conversion and averaging processing is performed line by line.

なお、ウィンドウサイズは16X4画素の例について説
明したが、勿論これのみに限定されるものではない。
Although the window size has been described as an example of 16×4 pixels, it is of course not limited to this.

〔発明の効果〕〔Effect of the invention〕

伝票をカラーで読み取り、黒色の文字とカラーの書式情
報を分離するとき、本発明では、エツジ部分にある色ず
れ画素は少数であるため、複数画素のウィンドウ毎に有
彩色を平均化することにより、色ずれの影響を減少させ
、色の識別精度が落ちるのを防ぐことができ、カラー書
式情報を文字切り出し情報として利用することができる
When reading a slip in color and separating black text from color format information, in the present invention, since there are only a small number of color misaligned pixels at the edge, the chromatic colors are averaged for each window of multiple pixels. , the influence of color shift can be reduced, color identification accuracy can be prevented from deteriorating, and color format information can be used as character segmentation information.

また書式の色識別が必要でないときは、彩度Sと輝度V
だけで文字と書式の分離ができる構成となるので、処理
速度の大幅な向上が期待できる。
In addition, if color identification of the format is not required, saturation S and brightness V
Since it is possible to separate characters and formats by simply using the following commands, we can expect a significant improvement in processing speed.

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

第1図は本発明の原理説明図、 第2図は本発明の一実施例構成図、 第3図は本発明の要部説明図、 第4図は本発明の他の実施例、 第5図はHSV表示系説明図、 第6図は従来例を示す。 0−HS V変換回路 1−比較器 2−色相平均化部 3−アンドゲート 4−加算器 5− ラインメモリ 6− レジスタ 7−メモリカウンタ 3 18−メモリ制御部 19−平均化部 FIG. 1 is a diagram explaining the principle of the present invention, FIG. 2 is a configuration diagram of an embodiment of the present invention. FIG. 3 is an explanatory diagram of the main parts of the present invention, FIG. 4 shows another embodiment of the present invention, Figure 5 is an explanatory diagram of the HSV display system. FIG. 6 shows a conventional example. 0-HS V conversion circuit 1-Comparator 2-Hue averaging section 3-and gate 4- Adder 5- Line memory 6- Register 7-Memory counter 3 18-Memory control unit 19-Averaging section

Claims (1)

【特許請求の範囲】 原画像信号を色相(H)、彩度(S)、輝度(V)によ
り出力するHSV変換手段(10)を備えた色識別装置
において、 原画像の複数の画素で構成されるウィンドウ区分内の色
相を平均する色相平均化手段(12)を具備したことを
特徴とする 色識別装置。
[Claims] A color identification device comprising an HSV conversion means (10) for outputting an original image signal in terms of hue (H), saturation (S), and brightness (V), comprising: a plurality of pixels of the original image; A color identification device comprising: hue averaging means (12) for averaging hues within a window section.
JP1175180A 1989-07-06 1989-07-06 Color identification device Expired - Fee Related JP2851060B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1175180A JP2851060B2 (en) 1989-07-06 1989-07-06 Color identification device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1175180A JP2851060B2 (en) 1989-07-06 1989-07-06 Color identification device

Publications (2)

Publication Number Publication Date
JPH0340078A true JPH0340078A (en) 1991-02-20
JP2851060B2 JP2851060B2 (en) 1999-01-27

Family

ID=15991672

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1175180A Expired - Fee Related JP2851060B2 (en) 1989-07-06 1989-07-06 Color identification device

Country Status (1)

Country Link
JP (1) JP2851060B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6972866B1 (en) * 2000-10-03 2005-12-06 Xerox Corporation Detecting process neutral colors

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6972866B1 (en) * 2000-10-03 2005-12-06 Xerox Corporation Detecting process neutral colors

Also Published As

Publication number Publication date
JP2851060B2 (en) 1999-01-27

Similar Documents

Publication Publication Date Title
US5134666A (en) Image separator for color image processing
JP3258122B2 (en) Image processing device
JP2746692B2 (en) Color image data processing device
JPH03256178A (en) Picture/character area identifying system for image processor
US6125200A (en) Removing non-text information from a color image
JPH0340078A (en) Color discriminating device
JP3073837B2 (en) Image region separation device and image region separation method
JP2003087562A (en) Image processor and image processing method
US6798544B1 (en) Image reading method, image reading device and image processing device
JP3224172B2 (en) Color image processing equipment
JP2641924B2 (en) Image data extraction device
JP2637498B2 (en) Image signal processing device
JPS589469B2 (en) Character reading method
JP2003196592A (en) Program for processing image, and image processor
JPS6359272A (en) Picture processor
JPH02204879A (en) Method and device for identifying color
JPH02137079A (en) Color identifying circuit
JP3153221B2 (en) Color image processing equipment
JP2947566B2 (en) In-frame area detection device
JP4228515B2 (en) Image processing device
JP2000341549A (en) Color image processor
JPH1051655A (en) Image processor and optical character reader
US20040252343A1 (en) Image processing apparatus and image processing method
JPH09247481A (en) Picture processor
JPH0359783A (en) Image signal processor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees