【発明の詳細な説明】
【0001】
【産業上の利用分野】本発明は画像パターン処理装置に
係り、特に、図形や文字等の画像パターンをスムージン
グ、細線化、整形、太線化処理する装置に関する。
【0002】
【従来の技術】帳票から読み取った文字パターンの文字
認識や、書体変換等の処理を行う際、原文字パターンの
心線パターンを抽出したい場合がある。
【0003】従来、このような文字やその他図形のパタ
ーンの心線パターンの抽出は、単純に細線化処理を原パ
ターンに施すことによって達成していた。なお、この種
の代表的な細線化方式としてはHildich法が知られてい
る。
【0004】しかし、Hildich法による場合、i)線の
境界上の凸凹により心線が乱れる、ii)原画像パターン
の回転によって心線が歪む、iii)線の交差点で心線が
歪む、等々の問題がある。また、他の細線化方式による
場合でも、ノイズにより心線の乱れが生じるという同様
の問題がある。
【0005】
【発明が解決しようとする課題】本発明の目的は、原画
像パターンに忠実な心線パターンが抽出でき、この心線
パターンを一様に太らせて肉太の書体を作ったり、座標
変換を施してイタクックの書体を作ったりなどするのに
好適な画像パターン処理装置を提供することにある。
【0006】
【課題を解決するための手段】本発明は、画像パターン
にスムージング処理を施こす手段、画像パターンに細線
化処理を施こす手段、画像パターンに整形処理を施こす
手段、画像パターンに太線化処理を施こす手段などを具
備してなる画像パターン処理装置において、前記画像パ
ターンに細線化処理を施こす手段は、白ドットに変る元
の黒ドット部分に黒ドットであったことを示す情報(痕
跡情報)を一種の影として残して細線化処理を施こし、
前記画像パターンに太線化処理を施こす手段は、前記細
線化画像パターンに残された痕跡情報に従って太線化処
理を施こすことを特徴とする。
【0007】
【作用】心線パターン抽出は、上記各処理手段を使用し
て次のようにして行う。まず、原画像パターンに前スム
ージング処理を行って、線の境界上の凹凸等を除去した
後、影を残して最初の細線化処理を施して心線パターン
を抽出する。次に、この心線パターンについて、ストロ
ークの途切れ部の接続、交差点部の連結、凹凸部のスム
ージング、飾り部の除去などの整形処理を施こし、この
整形処理結果の画像パターン(心線パターン)に影を考
慮して線幅一様の太線化処理を施こして、通常の細線化
(心線抽出)を行い、その結果に後スムージング処理を
施こす。これにより、原画像パターンに忠実な心線パタ
ーンの抽出が可能になる。
【0008】
【実施例】図1は、本発明の画像パターン処理装置の一
実施例を示す概略ブロック図である。10はスキャナで
あり、帳票等を走査して画像を読み取り、2値の画像信
号を文字切出し装置20へ送る。この文字切出し装置2
0は画像信号を所定走査線分だけ内部に一時的に蓄積
し、公知の射影法等によって個々の文字の画像パターン
を切り出す。切り出された画像パターンは記憶装置A3
0に記憶される。100が本画像パターン処理装置であ
り、記憶装置A52から画像パターンを1文字ずつ内部
メモリに取り込み、所望の処理を実行し、処理結果を記
憶装置B40に格納する。該画像パターン処理装置10
0は、画像パターンに前処理としてのスムージング処理
を施す。スムージング処理手段A110、画像パターン
に対し、白ドットに変る元の黒ドットを影として残して
細線化処理を施す細線化処理手段A120、画像パター
ンに整形処理を施す整形処理手段130、画像パターン
に太線化処理を施す太線化処理手段140、画像パター
ンに通常の(影を残さない)細線化処理を施す細線化処
理手段B150、及び、画像パターンに後処理としての
スムージング処理を施すスムージング処理手段B160
よりなる。なお、110と160のスムージング処理手
段A,Bは同じものを兼用してもよい。
【0009】以下、原画像パターンから心線パターンを
抽出する場合について、各処理手段110〜160の動
作を説明する。
【0010】〈スムージング処理手段A〉
原画像パターンを例えば3×3画素の窓で観測し、図2
の(a)〜(h)のパターンをそれぞれ同図の(a′)
〜(h′)のパターンへ変換することにより、線の境界
上の凹凸を除去する。
【0011】〈細線化処理手段A〉
画像パターンに、Hildich法などによる細線化処理を施
こして心線を抽出すると共に、該細線化処理で白ドット
に変った元の黒ドットを影(痕跡情報)として残す。表
1にこの細線化後の画像パターンに付加する方向コード
の例を示す。
【0012】
【表1】
【0013】表1において、方向コード“0”は原画像
で元々白であったドット、“1”は原画像で黒であった
が、細線化処理で削られて白(影)に変わったドット、
“2”は細線化処理で削られずに黒のまま残ったドット
を表わす。即ち、方向コード“2”のドット群が、抽出
された心線(細線)を表わす。“3”,“5”は方向コ
ード2の一塊のドット群が横方向ストロークであるか縦
方向ストロークであるかを表わす。この方向コード
“3”や“5”は該当ドット群の先頭と末尾に付ける。
即ち、“3”で始まり“3”で終わっている“2”のド
ット群(該当ドット群が二つのドットからなる場合は
“33”)が横方向ストローク、“5”で始まり“5”
で終わっている“2”のドット群(該当ドット群が二つ
のドットからなる場合は“55”)が縦方向ストローク
を表わす。
【0014】例えば図3に示す原画像パターン(文字
“竜”のドットパターン)に、スムージング処理、該細
線化処理を施し、表1に示す方向コードを付加すると、
図4に示す画像パターンが得られる。なお、図3,4に
おいて、空白部は元々“白”ドットであり、方向コード
としては“0”が付されるが、図では省略してある。図
4において、抽出された心線(細線)の横方向ストロー
クは“322・・・・23”や“33”で示され、縦方向ス
トロークは“522・・・・25”や“55”で示される。
【0015】〈整形処理手段〉
上記表1の方向コードの付加された画像パターンについ
て、その方向コードの状態を調べ、下記(イ)〜(ニ)
の処理を行う。
【0016】(イ) 凹凸のスムージング:
図8(a),(b)に示すような横方向や縦方向のスト
ロークの途切れ部に方向コード“2”があれば、それぞ
れ図8(a′),(b′)に示すように該方向コード
“2”を除去し、方向コード“3”や“5”を挿入し
て、隣り合うストロークを接続する。
【0017】(ロ) 横方向の飾り除去:
図9(a),(b)に示すような横方向ストロークにお
ける飾りパターンを、同図(a′),(b′)のような
直線のストロークパターンに修正する。
【0018】(ハ) 直角連結点の4連結化:
図10(a),(b)に示すような横方向と縦方向のス
トロークの交差部を、それぞれ同図(a′),(b′)
に示すように修正する。
【0019】(ニ) 縦方向の飾り除去:
図11(a)に示すような縦方向ストロークに接してい
る方向コード2(飾り)を、同図(a′)に示すように
除去する。
【0020】図4の画像パターンに本整形処理を施す
と、図5の画像パターンが得られる。
【0021】〈太線化処理手段〉
画像パターン(細線化パターン)について、まず、注目
するストロークの始点または終点の8近傍に他のストロ
ークの始点または終点が存在するか調べ、存在すれば、
その方向に太線化を行い、存在しなければ、影(痕跡情
報)の方向(方向コード“1”の方向)に太線化を行
う。太線化は、注目するストロークが横方向ストローク
か縦方向ストロークかに応じて、方向コード3または5
を太線化コードとして付加することで行う。次に、太線
化コードの付されたストロークを線幅2にする。
【0022】例えば、図12のような横方向ストローク
(3で始まり3で終わっているストローク)と縦方向ス
トローク(5で始まり5で終わっているストローク)の
組合せでは、“存在する”、“存在しない”は同図
(b)のようになる。“存在する”ストロークは、同図
(c)のように太線化コードが付され、“存在しない”
ストロークは、同図(d)のように太線化コードが付さ
れる。
【0023】図5の画像パターンに本太線化処理を施し
た結果を図6に示す。図6で、線で囲った部分が線幅2
のパターンである。
【0024】〈細線化処理手段B〉
画像パターンに、Hildich法などによる通常の(影を残
さない)細線化処理を施す。
【0025】〈スムージング処理手段B〉
画像パターンに後処理として、横方向と縦方向のストロ
ークの直角交差点を4連結にする。即ち、図13
(a),(b)のようなパターンを同図(a′),
(b′)のように修正する。
【0026】図7は、図6の画像パターンに細線化、ス
ムージングの処理を施した結果、即ち、図3の原画像パ
ターンから最終的に抽出された心線パターンを示す。図
7のパターンは、図3の原画像パターン忠実な心線パタ
ーンとなっている。
【0027】
【発明の効果】本発明では、図形や文字等の画像パター
ンをスムージング、細線化、整形、太線化などする画像
パターン処理装置において、画像パターンを通常に細線
化する手段に加えて、白ドットに変る元の黒ドットを影
として残して細線化する手段を具備することにより、原
画像パターンに忠実な心線パターンを抽出することがで
き、心線パターンを一様に太らせて肉太の書体や、座標
変換してイタリック書体などを作る場合、原画像の書体
らしさが失われることがない。Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image pattern processing apparatus, and more particularly to an apparatus for smoothing, thinning, shaping, and thickening an image pattern such as a figure or a character. . 2. Description of the Related Art When performing processing such as character recognition of a character pattern read from a form and conversion of a typeface, it is sometimes necessary to extract a core line pattern of an original character pattern. Heretofore, such extraction of a core pattern of a character or other graphic pattern has been achieved by simply performing a thinning process on an original pattern. The Hildich method is known as a typical thinning method of this type. However, in the case of the Hildich method, i) the core is disturbed by irregularities on the boundary of the line, ii) the core is distorted by rotation of the original image pattern, iii) the core is distorted at the intersection of the lines, and so on. There's a problem. In addition, even in the case of using another thinning method, there is a similar problem that disturbance of the cord occurs due to noise. SUMMARY OF THE INVENTION It is an object of the present invention to extract a core pattern faithful to an original image pattern, and to make a thick typeface by uniformly thickening the core pattern. It is an object of the present invention to provide an image pattern processing apparatus suitable for performing a coordinate conversion to form an itacuk typeface. SUMMARY OF THE INVENTION The present invention provides means for applying smoothing processing to an image pattern, means for applying thinning processing to an image pattern, and applying shaping processing to an image pattern.
Means, in the image pattern processing apparatus comprising means for performing a thick line processing on the image pattern, the means for performing the thin line processing on the image pattern, the black dots in the original black dot portion changed to white dots Information indicating that there was
Facilities strained the thinning process, leaving a trail information) as a shadow of a kind,
Means for straining facilities the thickening process the image pattern, the fine
Thick line processing according to the trace information left in the linearized image pattern
Characterized in that the straining facilities and management. The extraction of the cord pattern is performed as follows using each of the above processing means. First, a pre-smoothing process is performed on an original image pattern to remove irregularities and the like on a line boundary, and then a first thinning process is performed while leaving a shadow to extract a core line pattern. Next, the core wire pattern is subjected to shaping processing such as connection of stroke breaks, connection of intersections, smoothing of uneven portions, and removal of decorative portions, and an image pattern (core wire pattern) resulting from the shaping processing is performed. Is subjected to a thickening process with a uniform line width in consideration of the shadow, and normal thinning (extraction of the center line) is performed, and the result is subjected to a post-smoothing process. This makes it possible to extract a core pattern faithful to the original image pattern. FIG. 1 is a schematic block diagram showing an embodiment of an image pattern processing apparatus according to the present invention. A scanner 10 scans a form or the like to read an image and sends a binary image signal to the character extracting device 20. This character extraction device 2
0 temporarily stores image signals for a predetermined number of scanning lines inside, and cuts out an image pattern of each character by a known projection method or the like. The extracted image pattern is stored in the storage device A3.
0 is stored. An image pattern processing apparatus 100 fetches an image pattern from the storage device A52 one character at a time into an internal memory, executes a desired process, and stores a processing result in the storage device B40. The image pattern processing device 10
0 performs a smoothing process as preprocessing on the image pattern. Smoothing processing means A110, thinning processing means A120 for performing thinning processing on the image pattern while leaving the original black dots that change to white dots as shadows, shaping processing means 130 for performing shaping processing on the image pattern, and thick lines for the image pattern Thickening means 140 for performing a thinning processing, thinning processing means B150 for performing a normal (no shadow) thinning processing on an image pattern, and smoothing processing means B160 for performing a smoothing processing as a post-processing on an image pattern
Consisting of Note that the same smoothing processing means A and B of 110 and 160 may be used. The operation of each of the processing means 110 to 160 will be described below in the case where a core pattern is extracted from an original image pattern. <Smoothing processing means A> The original image pattern is observed through a window of, for example, 3 × 3 pixels.
The patterns (a) to (h) of FIG.
By converting to the pattern of (h '), irregularities on the boundary of the line are removed. <Thinning processing means A> An image pattern is subjected to thinning processing by the Hildich method or the like to extract a core wire, and the original black dot changed to a white dot by the thinning processing is shaded ( trace). Information ). Table 1 shows an example of a direction code added to the image pattern after the thinning. [Table 1] In Table 1, the direction code "0" is a dot which was originally white in the original image, and "1" was black in the original image, but was turned into white (shadow) by the thinning process. Dot,
“2” indicates a dot which is not blackened by the thinning process and remains black. That is, the dot group of the direction code “2” represents the extracted core line (thin line). “3” and “5” indicate whether a group of dots in the direction code 2 is a horizontal stroke or a vertical stroke. The direction codes “3” and “5” are added to the head and end of the dot group.
That is, a dot group of “2” that starts with “3” and ends with “3” (“33” when the dot group is composed of two dots) is a horizontal stroke, and starts with “5” and “5”.
"2" dot group ("55" when the dot group is composed of two dots) ending with "." Represents a vertical stroke. For example, when the smoothing process and the thinning process are performed on the original image pattern (the dot pattern of the character “dragon”) shown in FIG. 3 and the direction codes shown in Table 1 are added,
The image pattern shown in FIG. 4 is obtained. In FIGS. 3 and 4, the blank portion is originally a “white” dot, and “0” is added as the direction code, but is omitted in the drawings. In FIG. 4, the horizontal stroke of the extracted core wire (thin line) is indicated by “322... 23” or “33”, and the vertical stroke is “522... 25” or “55”. Is shown. <Shaping processing means> With respect to the image pattern to which the direction code shown in Table 1 is added, the state of the direction code is checked, and the following (A) to (D)
Is performed. (A) Smoothing of unevenness: If there is a direction code "2" at a break in a horizontal or vertical stroke as shown in FIGS. As shown in (b '), the direction code "2" is removed, and the direction codes "3" and "5" are inserted to connect adjacent strokes. (B) Horizontal decoration removal: A decoration pattern in a horizontal stroke as shown in FIGS. 9 (a) and 9 (b) is replaced by a linear stroke as shown in FIGS. 9 (a ') and 9 (b'). Modify to a pattern. (C) Quadrature connection of right-angle connection points: The intersections of horizontal and vertical strokes as shown in FIGS. 10 (a) and 10 (b) are shown in FIGS. 10 (a ') and (b'), respectively. )
Modify as shown. (D) Removal of vertical decoration: The direction code 2 (decoration) in contact with the vertical stroke as shown in FIG. 11 (a) is removed as shown in FIG. 11 (a '). When the main shaping process is performed on the image pattern shown in FIG. 4, the image pattern shown in FIG. 5 is obtained. <Thickening processing means> First, it is checked whether or not the starting point or the ending point of another stroke exists in the vicinity of 8 of the starting point or the ending point of the stroke of interest for the image pattern (thinning pattern).
The line is bolded in that direction, and if it does not exist, the shadow (trace information)
) (Direction of direction code “1”). Thick lines indicate direction codes 3 or 5 depending on whether the focused stroke is a horizontal stroke or a vertical stroke.
Is added as a bold line code. Next, the stroke with the thick line code is set to line width 2. For example, in the combination of the horizontal stroke (stroke starting at 3 and ending at 3) and the vertical stroke (stroke starting at 5 and ending at 5) as shown in FIG. "No" is as shown in FIG. “Existing” strokes are marked with bold lines as shown in FIG.
Strokes are given bold-lined codes as shown in FIG. FIG. 6 shows the result of subjecting the image pattern of FIG. 5 to the thickening process. In FIG. 6, the portion surrounded by the line is the line width 2
It is a pattern of. <Thinning processing means B> An ordinary (thin shadow) thinning processing is applied to the image pattern by the Hildich method or the like. <Smoothing Processing Means B> As post-processing of the image pattern, the right-angle intersections of the horizontal and vertical strokes are connected to four. That is, FIG.
Patterns such as (a) and (b) are shown in FIG.
Modify as shown in (b '). FIG. 7 shows the result of thinning and smoothing the image pattern of FIG. 6, ie, the core pattern finally extracted from the original image pattern of FIG. The pattern of FIG. 7 is a core line pattern that is faithful to the original image pattern of FIG. According to the present invention, in an image pattern processing apparatus for smoothing, thinning, shaping, and thickening an image pattern such as a figure or a character, in addition to the means for normally thinning the image pattern, By providing a means for thinning while leaving the original black dots that change to white dots as shadows, it is possible to extract a core line pattern that is faithful to the original image pattern, and to make the core line pattern uniformly thicker When a bold typeface or an italic typeface is created by coordinate conversion, the original image typeface is not lost.
【図面の簡単な説明】
【図1】本発明の画像パターン処理装置の一実施例のブ
ロック図である。
【図2】前スムージング処理の説明図である。
【図3】原画像パターンの例を示す図である。
【図4】影を残した細線化処理結果の画像パターンの例
を示す図である。
【図5】整形化処理結果の画像パターンの例を示す図で
ある。
【図6】太線化処理結果の画像パターンの例を示す図で
ある。
【図7】通常の細線化処理結果の画像パターンの例を示
す図である。
【図8】整形処理の第1の説明図である。
【図9】整形処理の第2の説明図である。
【図10】整形処理の第3の説明図である。
【図11】整形処理の第4の説明図である。
【図12】太線化処理の説明図である。
【図13】後スムージング処理の説明図である。
【符号の説明】
100 画像パターン処理装置
110 スムージング処理手段A
120 細線化処理手段A
130 整形処理手段
140 太線化処理手段B
150 細線化処理手段
160 スムージング処理手段BBRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram of an embodiment of an image pattern processing device according to the present invention. FIG. 2 is an explanatory diagram of a pre-smoothing process. FIG. 3 is a diagram illustrating an example of an original image pattern. FIG. 4 is a diagram illustrating an example of an image pattern as a result of a thinning process that leaves a shadow. FIG. 5 is a diagram illustrating an example of an image pattern as a result of a shaping process. FIG. 6 is a diagram illustrating an example of an image pattern as a result of a thick line processing. FIG. 7 is a diagram illustrating an example of an image pattern as a result of normal thinning processing. FIG. 8 is a first explanatory diagram of a shaping process. FIG. 9 is a second explanatory diagram of the shaping process. FIG. 10 is a third explanatory diagram of the shaping process. FIG. 11 is a fourth explanatory diagram of the shaping process. FIG. 12 is an explanatory diagram of thickening processing. FIG. 13 is an explanatory diagram of post-smoothing processing. DESCRIPTION OF SYMBOLS 100 Image pattern processing device 110 Smoothing processing means A 120 Thinning processing means A 130 Shaping processing means 140 Thickening processing means B 150 Thinning processing means 160 Smoothing processing means B