JPH08138066A - Contour line sampling method for character - Google Patents

Contour line sampling method for character

Info

Publication number
JPH08138066A
JPH08138066A JP6270870A JP27087094A JPH08138066A JP H08138066 A JPH08138066 A JP H08138066A JP 6270870 A JP6270870 A JP 6270870A JP 27087094 A JP27087094 A JP 27087094A JP H08138066 A JPH08138066 A JP H08138066A
Authority
JP
Japan
Prior art keywords
line
coordinate
pair
contour
character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP6270870A
Other languages
Japanese (ja)
Inventor
Naomi Ogawa
直美 小川
Masaru Fujii
大 藤井
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP6270870A priority Critical patent/JPH08138066A/en
Publication of JPH08138066A publication Critical patent/JPH08138066A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE: To accurately sample line-pair information required for line width correction processing on all characters provided with various features. CONSTITUTION: A character plotting part 13 in which a line width correcting part 134 equipped with a closed area separating part 1341, a horizontal line/ vertical line sampling part 1342, a line pair judging part 1343 and a coordinate point correcting part 1344, a data readout part 131, a font storage part 132, a coordinate transformation part 133, work memory 135 and a paint-out part 136 are provided, an input part 11 and an output part 14 are provided, and they are controlled by a control part 12, and the line pair judging part 1343 is provided with a judging part 24 in which a pair flag judging part 25 for target edge, a directional condition judging part 26 and a coordinate value condition judging part 27 are provided, a reference edge setting part 21, a pair flag judging part 22, a target edge setting part 23 and a pair flag setting part 28, and it is controlled by a line pair judging control part 70.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、文字輪郭座標データで
構成される文字データ(アウトラインフォント)を用
い、プリンタやディスプレイ上に高品位な文字を出力す
る方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method of outputting high-quality characters on a printer or a display by using character data (outline font) composed of character contour coordinate data.

【0002】[0002]

【従来の技術】アウトラインフォントを表示,印刷する
には、そのフォント表現をドットパターンに変換しなけ
ればならない。従って、もともと同一の線幅で表現され
たアウトラインフォントであっても、ディスプレイやプ
リンタ等の出力装置の解像度や、文字の縮小によって、
その線幅にばらつきが生じて表示,印刷されてしまう。
そこでアウトラインフォントをドットパターンに変換す
る際に、線幅のばらつきを補正するための処理(ヒンテ
ィング)が行われている。主なヒンティングには、特願
平2−81657号公報のようなものがある。また、ヒンティ
ングの際には、水平線、及び垂直線を生成する輪郭線の
上端下端、及び左端右端等のラインペア抽出処理が必要
である。従来から、ラインペア抽出には特願平4−18819
0 号公報のような方法が用いられていた。
2. Description of the Related Art In order to display and print an outline font, the font expression must be converted into a dot pattern. Therefore, even if the outline font is originally expressed with the same line width, the resolution of the output device such as a display or a printer or the reduction of the characters causes
The line width varies and is displayed and printed.
Therefore, when converting an outline font into a dot pattern, processing (hinting) is performed to correct variations in line width. The main hinting is disclosed in Japanese Patent Application No. 2-81657. Further, at the time of hinting, it is necessary to perform line pair extraction processing such as the upper and lower ends of the contour lines that generate horizontal lines and vertical lines, and the left and right ends. Conventionally, Japanese Patent Application No. 4-18819 is used for line pair extraction.
A method such as the one disclosed in Japanese Patent No. 0 was used.

【0003】これはラインペアの抽出ルールとして水
平,垂直線の方向、及び代表点の(x,y)座標値だけ
を管理しておき、代表点をソートし、方向をみながらラ
インペアであるか否かを判断するものであった。その結
果、図8の従来ラインペア82のように、x1とx2,
x7とx8をそれぞれラインペアとして抽出してしまう
ため、ヒンティング後も線幅のばらつきがあった。
As a line pair extraction rule, this is a line pair that manages only the horizontal and vertical line directions and the (x, y) coordinate values of the representative points, sorts the representative points, and observes the directions. It was to judge whether or not. As a result, x1 and x2, like the conventional line pair 82 of FIG.
Since x7 and x8 are extracted as line pairs, the line width varies even after hinting.

【0004】[0004]

【発明が解決しようとする課題】上記従来方法では単純
な文字については正確なラインペアを抽出できたが、特
殊な文字に関しては正しいラインペアを抽出できず、結
果的に線幅の不揃いを目立たせている場合があった。
In the above conventional method, an accurate line pair can be extracted for a simple character, but a correct line pair cannot be extracted for a special character, resulting in an uneven line width. In some cases, it was standing.

【0005】本発明の目的は、本来のアウトラインフォ
ントの持つ美しさを表現するために必要不可欠な線幅補
正を行うにあたり、あらかじめ水平線と垂直線の情報を
抽出しておき、これらの情報をもとに全ての文字に適用
可能なラインペア判定方法を用いて、正確にラインペア
を抽出することである。
It is an object of the present invention to extract horizontal and vertical line information in advance in order to perform the line width correction which is indispensable for expressing the beauty of the original outline font. The line pair is accurately extracted by using a line pair determination method applicable to all characters.

【0006】[0006]

【課題を解決するための手段】本発明は上記した目的を
達成するためになされたもので、すべての文字に対処で
きるラインペア抽出ルールを提案するものである。方向
とエッジを生成する一方の端点だけでなく、例えば、水
平線ならば水平線を生成する最大x値,最小x値、及び
y値、線の向きを管理する。同様に、垂直線の場合には
垂直線を生成する最大y値,最小y値、及びx値、線の
向きを管理する。そして線の向きや座標値を用いること
により、様々な特徴を持つ文字に対しても正確にライン
ペアを抽出することができ、線幅補正によって文字品質
が劣化することなく、本来の文字の美しさを十分に表現
することができる。
The present invention has been made in order to achieve the above-mentioned object, and proposes a line pair extraction rule which can deal with all characters. In addition to one end point that generates a direction and an edge, for example, in the case of a horizontal line, the maximum x value, the minimum x value and the y value that generate a horizontal line, and the direction of the line are managed. Similarly, in the case of a vertical line, the maximum y value, the minimum y value and the x value for generating the vertical line, and the direction of the line are managed. By using the line direction and coordinate values, line pairs can be accurately extracted even for characters with various characteristics, and line width correction does not deteriorate the character quality, and It is possible to express the fullness.

【0007】[0007]

【作用】入力手段より文字及びサイズが入力されると、
制御手段はフォント記憶部からアウトラインデータをワ
ークメモリ上に読み出し、座標変換部にてデバイス座標
変換及びサイズ変換を行う。次に線幅補正部では、変換
による線幅のばらつきを補正し、塗りつぶし部では直線
近似データとスキャンラインとの交点から輪郭線を生成
し、輪郭線内部を塗りつぶし、出力部より文字を出力す
る。線幅補正部は、閉領域分離部,水平線垂直線抽出
部,ラインペア判定部,座標点補正部の処理から成る。
閉領域分離部では、文字の輪郭座標データを閉領域に分
離する。次に水平線垂直線抽出部では、座標変換された
文字輪郭座標データから水平線輪郭座標のy座標値,水
平線を生成する両端点のx座標値及び線の向き、さらに
垂直線輪郭座標のx座標値,垂直線を生成する両端点の
y座標値及び線の向きを抽出し、水平線ならばy座標
値,垂直線ならばx座標値でソートしテーブルに格納す
る。次にラインペア判定部では、抽出した水平線,垂直
線について各々のラインペアと成り得る条件を満たすか
否か判定する。座標点補正部では、ラインペア判定部に
て得たラインペア間の間隔を求め、該間隔を整数化し、
整数化したラインペア間の間隔に合わせて座標値の補
正、さらに全体長の補正を行う。
[Operation] When characters and size are input by the input means,
The control means reads out the outline data from the font storage section onto the work memory, and the coordinate conversion section performs device coordinate conversion and size conversion. Next, the line width correction unit corrects the line width variation due to the conversion, the filling unit generates a contour line from the intersection of the straight line approximation data and the scan line, fills the inside of the contour line, and outputs the character from the output unit. . The line width correction unit includes a closed region separation unit, a horizontal line vertical line extraction unit, a line pair determination unit, and a coordinate point correction unit.
The closed area separation unit separates the contour coordinate data of the character into closed areas. Next, in the horizontal line / vertical line extraction unit, the y coordinate value of the horizontal line outline coordinates from the coordinate-converted character outline coordinate data, the x coordinate value of the endpoints that generate the horizontal line and the line direction, and the x coordinate value of the vertical line outline coordinates. , Y-coordinate values of both end points that generate a vertical line and the direction of the line are extracted, sorted by the y-coordinate value for the horizontal line and x-coordinate value for the vertical line and stored in the table. Next, the line pair determination unit determines whether or not the extracted horizontal lines and vertical lines satisfy the conditions that can be the respective line pairs. In the coordinate point correction unit, the interval between the line pairs obtained by the line pair determination unit is obtained, and the interval is converted into an integer,
The coordinate value is corrected according to the interval between the line pairs that have been converted into integers, and the entire length is corrected.

【0008】[0008]

【実施例】以下に本発明の一実施例を説明する。図1は
本発明の一実施例を示すシステムのブロック図である。
EXAMPLE An example of the present invention will be described below. FIG. 1 is a block diagram of a system showing an embodiment of the present invention.

【0009】11は文字及びサイズを入力する入力部で
あり、12は一連の処理を制御する制御部であり、13
2はフォントデータを記憶しておくフォント記憶部であ
り、131はフォント記憶部からフォントデータを読み
出すデータ読み出し手段であり、133は所定の文字サ
イズに変換する座標変換部であり、134は変換された
文字輪郭座標データから線幅を補正する線幅補正部であ
り、135は読み出された文字輪郭座標データ等の計算
処理を行うワークメモリであり、136は文字イメージ
を生成するために文字輪郭内部を塗りつぶす塗りつぶし
部であり、14は生成された文字イメージを出力する出
力部である。1341は文字輪郭座標データから文字の
閉領域ごとに分離する閉領域分離部であり、1342は
閉領域分離部にて分離された閉領域ごとに文字の水平
線,垂直線を抽出する水平線垂直線抽出部であり、13
43は水平線垂直線抽出部にて抽出した水平線,垂直線
について各々のラインペアと成りうるか否かを判定する
ラインペア判定部,1344はラインペア判定部で生成
したラインペア情報よりラインペア間の線幅を求め、座
標点を補正する座標点補正部である。
Reference numeral 11 is an input unit for inputting characters and sizes, 12 is a control unit for controlling a series of processes, and 13
Reference numeral 2 is a font storage unit for storing font data, 131 is a data reading means for reading the font data from the font storage unit, 133 is a coordinate conversion unit for converting the font data into a predetermined character size, and 134 is a conversion unit. A line width correction unit for correcting the line width from the character contour coordinate data, 135 is a work memory for calculating the read character contour coordinate data, and 136 is a character contour for generating a character image. Reference numeral 14 is a filling unit for filling the inside, and 14 is an output unit for outputting the generated character image. Reference numeral 1341 denotes a closed area separation unit that separates the character contour coordinate data for each closed area of the character, and 1342 extracts a horizontal line and a vertical line for extracting the horizontal and vertical lines of the character for each closed area separated by the closed area separation unit. Part, 13
Reference numeral 43 is a line pair determination unit that determines whether or not each of the horizontal lines and vertical lines extracted by the horizontal line vertical line extraction unit can be a line pair, and 1344 is the line pair information based on the line pair information generated by the line pair determination unit. This is a coordinate point correction unit that determines the line width and corrects the coordinate points.

【0010】各部の動作について説明する。The operation of each unit will be described.

【0011】入力部11が制御部12に印字命令を転送
すると、制御部12は印字命令から文字イメージを生成
し出力部14に転送するため、一連の処理を制御する。
出力手段はプリンタ,ディスプレイ等であり、文字イメ
ージを印刷もしくは表示する。データ読み出し部131
では、入力部11から送られてきた書体情報と文字コー
ドを解読し、指定されたフォントデータをフォント記憶
部132からワークメモリ135に読み出す。座標変換
部133は入力部11より文字サイズ情報を受け取り、
ワークメモリ135に読み出されたフォントデータを所
定の解像度及びサイズになるように変換する。このと
き、文字輪郭座標データがベジェ曲線等のような曲線表
現を含む場合には、座標変換部133において直線近似
処理を行う。変換を受けた文字輪郭座標データは、線幅
補正部134において補正される。塗りつぶし部136
は、補正された文字輪郭座標データをもとに、輪郭内部
を塗りつぶすことによって文字イメージを生成し、出力
部14に転送する。
When the input unit 11 transfers the print command to the control unit 12, the control unit 12 generates a character image from the print command and transfers the character image to the output unit 14, thus controlling a series of processes.
The output means is a printer, a display, etc., and prints or displays a character image. Data reading unit 131
Then, the typeface information and the character code sent from the input unit 11 are decoded, and the designated font data is read from the font storage unit 132 to the work memory 135. The coordinate conversion unit 133 receives the character size information from the input unit 11,
The font data read to the work memory 135 is converted to have a predetermined resolution and size. At this time, when the character contour coordinate data includes a curved line expression such as a Bezier curve, the coordinate conversion unit 133 performs a linear approximation process. The converted character contour coordinate data is corrected by the line width correction unit 134. Filling section 136
Generates a character image by filling the inside of the outline based on the corrected character outline coordinate data and transfers it to the output unit 14.

【0012】線幅補正部134の内部では、まず閉領域
分離部1341が文字の閉領域ごとに文字輪郭座標デー
タを分離し、水平線垂直線抽出部1342が座標変換部
133により変換を受けた文字輪郭座標データから水平
線,垂直線を抽出し、水平線はy座標値について、垂直
線はx座標値についてソートしテーブルに格納する。ラ
インペア判定部1343では、水平線垂直線抽出部にお
いて抽出した水平線及び垂直線についてラインペアと成
りうるか否かを判定し、ラインペア情報を抽出する。座
標点補正部1344ではラインペア判定部で算出したラ
インペア情報に基づきラインペア間の線幅を求め、線幅
を揃えるために座標点の補正を行い、さらに全体長の補
正も行う。
In the line width correction unit 134, first, the closed area separation unit 1341 separates the character contour coordinate data for each closed area of the character, and the horizontal line vertical line extraction unit 1342 separates the coordinate conversion unit.
A horizontal line and a vertical line are extracted from the character outline coordinate data converted by 133, and the horizontal line is sorted for the y coordinate value and the vertical line is sorted for the x coordinate value and stored in the table. The line pair determination unit 1343 determines whether or not the horizontal line and the vertical line extracted by the horizontal line / vertical line extraction unit can be a line pair, and extracts line pair information. The coordinate point correction unit 1344 obtains the line width between the line pairs based on the line pair information calculated by the line pair determination unit, corrects the coordinate points to make the line widths uniform, and also corrects the overall length.

【0013】図2は、本発明のラインペア判定部の動作
を示すブロック図である。
FIG. 2 is a block diagram showing the operation of the line pair determination unit of the present invention.

【0014】20はラインペア判定の一連の処理を制御
するラインペア判定部であり、21はラインペア判定に
おいて、基準とするエッジ(水平線又は垂直線)を設定
する基準エッジ設定部である。本実施例では、各々のエ
ッジがラインペアを有するオンかオフかを判定するため
にペアフラグを用いている。そこでペアフラグ判定部2
2では基準エッジがラインペアを有するか否かを判定す
る。23は、基準エッジのラインペアかどうかを判定す
る対象とするエッジを設定する対象エッジ設定部であ
り、24は対象エッジがラインペアに成りうる条件を満
たすかどうかを判定する判定部である。判定部24は、
対象エッジのペアフラグ判定部25,向き条件判定部2
6,座標値条件判定部27から成る。対象エッジのペア
フラグ判定部25は、対象エッジのペアフラグがオフで
あるかどうかを判定する部分であり、向き条件判定部2
6は基準エッジと対象エッジの向きが互いに逆であるか
どうかを判定する部分であり、座標値条件判定部27は
水平線ならばx座標範囲,垂直線ならばy座標値範囲を
用いて判定する部分である。
Reference numeral 20 is a line pair determination unit that controls a series of line pair determination processing, and reference numeral 21 is a reference edge setting unit that sets a reference edge (horizontal line or vertical line) in the line pair determination. In this embodiment, a pair flag is used to determine whether each edge has a line pair and is on or off. Therefore, the pair flag determination unit 2
At 2, it is determined whether the reference edge has a line pair. Reference numeral 23 is a target edge setting unit that sets an edge that is a target for determining whether the target edge is a line pair, and reference numeral 24 is a determination unit that determines whether the target edge satisfies a condition of being a line pair. The determination unit 24 is
Target edge pair flag determination unit 25, orientation condition determination unit 2
6 and the coordinate value condition determination unit 27. The target edge pair flag determination unit 25 is a unit that determines whether or not the target edge pair flag is off, and the orientation condition determination unit 2
Reference numeral 6 is a portion for determining whether the directions of the reference edge and the target edge are opposite to each other. The coordinate value condition determination unit 27 determines using the x coordinate range for horizontal lines and the y coordinate value range for vertical lines. It is a part.

【0015】各部の動作について説明する。The operation of each unit will be described.

【0016】ラインペア判定制御部20は水平線垂直線
抽出部1342において抽出された水平線垂直線情報を
受け取り、各水平線垂直線のラインペアを探し出し座標
点補正部1344で座標点補正を行うための一連の処理
を制御する。まず基準エッジ設定部21で基準エッジを
設定し、ペアフラグ判定部22では基準エッジのペアフ
ラグよりラインペアを既に有しているか否か判定する。
次に対象エッジ設定部23で基準エッジのラインペア判
定の対象とするエッジを設定する。次に判定部24にお
いて対象エッジが基準エッジのラインペアに成りうるか
どうかを判定する。まず対象エッジのペアフラグ判定部
25で対象エッジのペアフラグより対象エッジがオフで
あるかどうか判定する。向き条件判定部26では基準エ
ッジと対象エッジの向きが互いに逆であるという条件を
満たすかどうか判定する。次に基準エッジと対象エッジ
の座標値よりラインペアと成りうる条件を満たすかどう
か判定する。これらの判定部24でラインペアであると
判定された場合に、ペアフラグ設定部28で基準エッジ
と対象エッジのペアフラグをオン(ラインペアを有す
る)に設定する。本実施例では、水平線垂直線の各エッ
ジに対し、ペアフラグを用いてラインペアを有するか否
かを管理するが、これ以外の方法で管理してもよい。
The line pair determination control unit 20 receives the horizontal line vertical line information extracted by the horizontal line vertical line extraction unit 1342, finds a line pair of each horizontal line vertical line, and performs a coordinate point correction by the coordinate point correction unit 1344. Control the processing of. First, the reference edge setting unit 21 sets the reference edge, and the pair flag determination unit 22 determines from the pair flag of the reference edge whether or not the line pair has already existed.
Next, the target edge setting unit 23 sets an edge which is a target of line pair determination of the reference edge. Next, the determination unit 24 determines whether the target edge can be a line pair of the reference edge. First, the target edge pair flag determination unit 25 determines from the target edge pair flag whether the target edge is off. The orientation condition determination unit 26 determines whether or not a condition that the orientations of the reference edge and the target edge are opposite to each other is satisfied. Next, it is determined from the coordinate values of the reference edge and the target edge whether or not a condition that can be a line pair is satisfied. When the determination unit 24 determines that there is a line pair, the pair flag setting unit 28 sets the pair flag of the reference edge and the target edge to ON (has a line pair). In this embodiment, for each edge of the horizontal line and the vertical line, it is managed whether or not there is a line pair by using a pair flag, but it may be managed by a method other than this.

【0017】図3,図4はそれぞれ水平線垂直線抽出部
1342の動作である水平線抽出,垂直線抽出処理を示
すフローチャートである。図5は水平線垂直線抽出部13
42で抽出した水平線、及び垂直線をソートし、重複する
座標値を削除してテーブルに格納したものである。図
6,図7はラインペア判定部1343を示すフローチャ
ートである。図8は「出」の文字について垂直線ライン
ペア抽出結果を示したものである。図3を用いて水平線
抽出処理における一実施例について説明する。
FIGS. 3 and 4 are flow charts showing horizontal line extraction and vertical line extraction processing, which are operations of the horizontal line vertical line extraction unit 1342, respectively. FIG. 5 shows a horizontal line / vertical line extraction unit 13
The horizontal line and the vertical line extracted in 42 are sorted, and the duplicate coordinate values are deleted and stored in the table. 6 and 7 are flowcharts showing the line pair determination unit 1343. FIG. 8 shows the vertical line pair extraction result for the character "out." An example of the horizontal line extraction process will be described with reference to FIG.

【0018】まず、ステップST300において、水平
線探索のための開始点を設定する。ステップST301
では一つ前の座標点(xi-1,yi-1)と注目座標点(xi
i)の差(xw,yw)を求める。ST302ではx座標
値間の差(xw)が0以外でかつy座標値間の差(yw)が
0であるという条件を満たすかどうか調べる。ST302の
条件を満たさなければST311で次の座標点を注目座
標点とし、同様にST301の処理を行う。またST3
02の条件を満たす場合には、ST303において注目
x座標値(xi)と前x座標値(xi-1)を比較する。注
目x座標値(xi)が前x座標値(xi-1)以上であれば
ST304で最大x値をxi ,最小x値をxi-1,y値
をyi(=yi-1),方向を右向き(right)と設定する。
またST303における比較の結果、注目x座標値
(xi)が前x座標値(xi-1)より小さければ、ST305
で最大x値をxi-1,最小x値をxi,y値をyi(=y
i-1)、方向を左向き(left)と設定する。ST306で
はST304及びST305で得たエッジ情報より、同
じy値,同じ方向のエッジが水平線抽出テーブルに登録
されたかどうか調べる。登録されていなければST30
9でエッジを水平線抽出テーブルに登録する。登録され
ている場合には、ST307で該最大y値と既登録の最
大y値との大きさを比較する。該最大y値の方が大きけ
れば、ST308 で既登録のエッジを水平線直線テーブルか
ら削除した後、ST309でエッジを水平線抽出テーブ
ルに登録する。ST307の比較の結果、既登録のエッ
ジの最大y値の方が大きければ、エッジを登録せず、S
T311で次のエッジを抽出する。ST310でエッジ
番号が座標点数以上であれば、ST312でy座標値に
ついてソートし処理を終了する。一方、エッジ番号が座
標点数よりも小さければ、ST311で次のエッジを抽
出する。このように、同じy値を持つ水平線の場合、一
定のルールを設けて重複排除しy座標値についてソート
した結果を登録することにした。本実施例では、重複排
除のルールとして最大x値の大きい方を登録することに
したが、別のルールであってもよいことはもちろんであ
る。同様に図4を用いて垂直線抽出処理における一実施
例について説明する。
First, in step ST300, a starting point for horizon search is set. Step ST301
Then, the previous coordinate point (x i-1 , y i-1 ) and the target coordinate point (x i ,
The difference (xw, yw) of y i ) is calculated. In ST302, it is checked whether the condition that the difference (xw) between the x coordinate values is other than 0 and the difference (yw) between the y coordinate values is 0 is satisfied. If the condition of ST302 is not satisfied, the next coordinate point is set as the target coordinate point in ST311, and the process of ST301 is similarly performed. Also ST3
When the condition of 02 is satisfied, the target x coordinate value (x i ) and the previous x coordinate value (x i-1 ) are compared in ST303. If the target x-coordinate value (x i ) is greater than or equal to the previous x-coordinate value (x i-1 ), the maximum x value is x i , the minimum x value is x i-1 , and the y value is y i (= y i ) in ST304. -1 ), and set the direction to right.
Also, as a result of the comparison in ST303, the x coordinate value of interest
If (x i ) is smaller than the previous x coordinate value (x i-1 ), ST305
, The maximum x value is x i-1 , the minimum x value is x i , and the y value is y i (= y
i-1 ), and set the direction to left. In ST306, it is checked from the edge information obtained in ST304 and ST305 whether or not edges having the same y value and the same direction are registered in the horizontal line extraction table. ST30 if not registered
At 9, the edge is registered in the horizontal line extraction table. If registered, the size of the maximum y value is compared with the registered maximum y value in ST307. If the maximum y value is larger, the registered edge is deleted from the horizontal line table in ST308, and the edge is registered in the horizontal line extraction table in ST309. As a result of the comparison in ST307, if the maximum y value of the registered edge is larger, the edge is not registered and S
At T311, the next edge is extracted. If the edge number is greater than or equal to the number of coordinate points in ST310, the y coordinate values are sorted in ST312 and the process ends. On the other hand, if the edge number is smaller than the number of coordinate points, the next edge is extracted in ST311. As described above, in the case of horizontal lines having the same y value, a fixed rule is set to eliminate duplicates and the result of sorting the y coordinate values is registered. In this embodiment, the rule with the larger maximum x value is registered as the deduplication rule, but it goes without saying that another rule may be registered. Similarly, an example of the vertical line extraction processing will be described with reference to FIG.

【0019】まず、ステップST400において、垂直
線探索のための開始点を設定する。ステップST401
では一つ前の座標点(xi-1,yi-1)と注目座標点(x
i,yi)の差(xw,yw)を求める。ST402では
x座標値間の差(xw)が0でかつy座標値間の差(y
w)が0以外であるという条件を満たすかどうか調べ
る。ST402の条件を満たさなければST411で次
の座標点を注目座標点とし、同様にST401の処理を
行う。またST402の条件を満たす場合には、ST4
03において注目y座標値(yi)と前y座標値(yi-1)を
比較する。注目y座標値(yi)が前y座標値(yi-1
以上であればST404で最大y値をyi,最小y値をy
i-1,x値をxi(=xi-1),方向を上向き(up)と設定す
る。またST403における比較の結果、注目y座標値
(yi)が前y座標値(yi-1)より小さければ、ST405
で最大y値をyi-1,最小y値をyi,x値をxi(=x
i-1)、方向を下向き(down)と設定する。ST406で
はST404及びST405で得たエッジ情報より、同
じx値,同じ方向のエッジが垂直線抽出テーブルに登録
されているかどうか調べる。登録されていなければST
409でエッジを垂直線抽出テーブルに登録する。登録
されている場合には、ST407で最大y値と既登録の
最大y値との大きさを比較する。最大y値の方が大きけ
れば、ST408 において既登録のエッジを垂直線直線テー
ブルから削除した後、ST409でエッジを垂直線抽出
テーブルに登録する。ST407の比較の結果、既登録
のエッジの最大y値の方が大きければ、エッジを登録せ
ず、ST411で次のエッジを抽出する。ST410で
エッジ番号が座標点数以上であれば、ST412でx座
標値についてソートし処理を終了する。一方、エッジ番
号が座標点数よりも小さければ、ST411で次のエッ
ジを抽出する。このように、同じx値を持つ垂直線の場
合、一定のルールを設けて重複排除しソート後の情報を
登録することにした。本実施例では、重複排除のルール
として最大y値の大きい方を登録することにしたが、別
のルールであってもよいことはもちろんである。また本
実施例では、各エッジ情報として水平線ならば水平線を
表現するx方向の端点座標,垂直線ならば垂直線を表現
するy方向の端点座標も管理することで正確なラインペ
アを認識できるようにした。図5に各エッジ情報の一実
施例を示す。水平線抽出テーブル51は水平線として抽
出されたエッジに関する情報を格納したものである。本
実施例では、y値,最大x値,最小x値、方向を水平線
のエッジ情報としてテーブルに格納した。同様に垂直線
抽出テーブル52は垂直線として抽出されたエッジに関
する情報を格納したものである。水平線抽出テーブル5
1,垂直線抽出テーブル52において、情報を格納して
おくことにより、従来から抽出困難であったラインペア
を抽出することができる。次に図6を用いて垂直線の場
合のラインペア判定処理における一実施例について説明
する。
First, in step ST400, a starting point for vertical line search is set. Step ST401
Then, the previous coordinate point (x i-1 , y i-1 ) and the target coordinate point (x i-1
The difference (xw, yw) between i , y i ) is calculated. In ST402, the difference between the x coordinate values (xw) is 0 and the difference between the y coordinate values (y
Check whether the condition that w) is other than 0 is satisfied. If the condition of ST402 is not satisfied, the next coordinate point is set as the target coordinate point in ST411, and the process of ST401 is performed in the same manner. If the condition of ST402 is satisfied, ST4
At 03, the target y coordinate value (y i ) and the previous y coordinate value (y i-1 ) are compared. The target y-coordinate value (y i ) is the previous y-coordinate value (y i-1 )
If it is greater than or equal to ST404, the maximum y value is y i and the minimum y value is y.
The i-1 and x values are set to x i (= x i-1 ) and the direction is set to up. In addition, as a result of the comparison in ST403, the y-coordinate value of interest
If (y i ) is smaller than the previous y coordinate value (y i-1 ), ST405
, The maximum y value is y i-1 , the minimum y value is y i , and the x value is x i (= x
i-1 ), and set the direction to down. In ST406, it is checked from the edge information obtained in ST404 and ST405 whether or not edges having the same x value and the same direction are registered in the vertical line extraction table. ST if not registered
At 409, the edge is registered in the vertical line extraction table. If registered, the maximum y value is compared with the already registered maximum y value in ST407. If the maximum y value is larger, the registered edge is deleted from the vertical line straight line table in ST408, and then the edge is registered in the vertical line extraction table in ST409. As a result of the comparison in ST407, if the maximum y value of the registered edge is larger, the edge is not registered and the next edge is extracted in ST411. If the edge number is greater than or equal to the number of coordinate points in ST410, the x coordinate values are sorted in ST412, and the process ends. On the other hand, if the edge number is smaller than the number of coordinate points, the next edge is extracted in ST411. In this way, in the case of vertical lines having the same x value, a certain rule is set to eliminate duplicates and register information after sorting. In this embodiment, the rule with the largest maximum y value is registered as the deduplication rule, but it goes without saying that another rule may be registered. Further, in the present embodiment, an accurate line pair can be recognized by managing the x-direction end point coordinates representing the horizon if the line is a horizontal line and the y direction end point coordinates representing the vertical line if the line is a vertical line. I chose FIG. 5 shows an example of each piece of edge information. The horizontal line extraction table 51 stores information about edges extracted as horizontal lines. In this embodiment, the y value, the maximum x value, the minimum x value, and the direction are stored in the table as horizontal line edge information. Similarly, the vertical line extraction table 52 stores information on edges extracted as vertical lines. Horizontal line extraction table 5
1. By storing information in the vertical line extraction table 52, it is possible to extract a line pair that has been difficult to extract conventionally. Next, an example of the line pair determination processing in the case of vertical lines will be described with reference to FIG.

【0020】まずST60においてラインペア判定開始
の垂直線を設定する。ST61において注目する垂直線
nのペアフラグがオフかどうか調べる。オンであれば、
垂直線nは他の垂直線のペアフラグとして既に抽出され
ていることになるため、ST66で垂直線番号nが垂直線数
(M)以上であるかどうか比較し、垂直線数以上であれ
ば処理を終了する。垂直線番号nが垂直線数より小さけ
れば垂直線番号をインクリメントし同様に処理を行う。
ST61でペアフラグがオフであればST62で垂直線
nのラインペア(垂直線m)を抽出する。次にST63
では垂直線nとST62で抽出された垂直線mのペアフ
ラグをオンとする。ST64ではすべての垂直線のペア
フラグがオンであるかどうかを判定し、すべてオンであ
れば処理を終了する。一方、ST64ですべての垂直線
のペアフラグがオンでなければ、垂直線番号nが垂直線
数以上であるか否か比較し、垂直線数以上でなければST
65で垂直線番号をインクリメントし同様な処理を繰り返
す。ここで、垂直線番号が垂直線数以上の時には処理を
終了する。次に図7を用いてST62のラインペア抽出
処理について説明する。ここでは垂直線nのラインペア
を検索するために垂直線mに注目した場合の実施例につ
いて説明する。
First, in ST60, a vertical line for starting the line pair determination is set. In ST61, it is checked whether the pair flag of the vertical line n of interest is off. If on,
Since the vertical line n has already been extracted as a pair flag of another vertical line, it is compared in ST66 whether the vertical line number n is the vertical line number (M) or more, and if it is the vertical line number or more, the processing is performed. To finish. If the vertical line number n is smaller than the number of vertical lines, the vertical line number is incremented and the same processing is performed.
If the pair flag is off in ST61, a line pair of vertical line n (vertical line m) is extracted in ST62. Then ST63
Then, the pair flag of the vertical line n and the vertical line m extracted in ST62 is turned on. In ST64, it is determined whether the pair flags of all the vertical lines are on, and if all are on, the process ends. On the other hand, if the pair flags of all vertical lines are not turned on in ST64, it is compared whether or not the vertical line number n is equal to or more than the vertical line number.
The vertical line number is incremented at 65 and the same processing is repeated. Here, when the vertical line number is equal to or larger than the number of vertical lines, the processing is ended. Next, the line pair extraction processing in ST62 will be described with reference to FIG. Here, an embodiment will be described in which the vertical line m is focused in order to search for a line pair of the vertical line n.

【0021】まずST70では垂直線nのラインペア候
補として垂直線番号1の垂直線m(m=1)について注
目する。ST71において基準とする垂直線nと注目す
る垂直線mが異なる線であれば、ST72で垂直線mの
ペアフラグがオフであるかどうか調べる。オフであれば
ST73で垂直線nと垂直線mの方向が逆向きであるか
どうか調べる。ST73で互いに逆向きであるという条
件を満たせば、ST74で
First, in ST70, attention is paid to the vertical line m (m = 1) having the vertical line number 1 as a line pair candidate for the vertical line n. If the reference vertical line n is different from the vertical line m of interest in ST71, it is checked in ST72 whether the pair flag of the vertical line m is off. If it is off, it is checked in ST73 whether the directions of the vertical line n and the vertical line m are opposite. If the conditions of opposite directions are met in ST73, in ST74

【0022】[0022]

【数1】(minym≦maxyn≦maxym)また
(1) (minym ≦ maxyn ≦ maxym) or

【0023】[0023]

【数2】(minyn≦maxym≦maxyn)を満
たすかどうか調べる。ST74の条件を満たせば、垂直
線nのラインペアとして垂直線mを抽出する。ST7
1,ST72,ST73,ST74の各々の条件を満た
さなければ、垂直線mは垂直線nのラインペアとなり得
ない。そこでST76で垂直線番号nをインクリメント
し処理を繰り返す。またST71,ST72,ST7
3,ST74の各々の条件を満たす垂直線が複数個存在
したとしても、水平線垂直線抽出部において、水平線な
らばy座標値について、垂直線ならばx座標値について
ソートした後にテーブルに登録してあるため、最初に条
件を満たした垂直線をラインペアと判定してもよいこと
は明らかである。図6,図7では垂直線におけるライン
ペア抽出処理を示したが、水平線の場合にはST74の条件
## EQU2 ## It is checked whether (minyn ≦ maxym ≦ maxyn) is satisfied. If the condition of ST74 is satisfied, the vertical line m is extracted as a line pair of the vertical line n. ST7
The vertical line m cannot be a line pair of the vertical line n unless the conditions of 1, ST72, ST73, and ST74 are satisfied. Therefore, in ST76, the vertical line number n is incremented and the process is repeated. ST71, ST72, ST7
Even if there are a plurality of vertical lines that satisfy the conditions of ST3 and ST74, the horizontal line vertical line extraction unit sorts the y coordinate values for horizontal lines and the x coordinate values for vertical lines, and then registers them in the table. Therefore, it is obvious that the vertical line that first satisfies the condition may be determined as the line pair. 6 and 7 show the line pair extraction processing in the vertical line, but in the case of the horizontal line, the condition of ST74 is

【0024】[0024]

【数3】(minxm≦maxxn≦maxxm)また
(3) (minxm ≦ maxxn ≦ maxxm) or

【0025】[0025]

【数4】(minxn≦maxxm≦maxxn)とな
る以外は同様の処理となる。
## EQU4 ## The same processing is performed except that (minxn≤maxxm≤maxxn).

【0026】図8は前述のラインペア判定処理を用い
て、垂直線に関してのラインペアを抽出したものであ
る。垂直線ラインペア81にラインペア情報を示す。垂
直線ラインペア81はx0とx2,x1とx3,x4と
x5,x6とx8,x7とx9がそれぞれラインペアで
あることを示したものである。本発明によれば、図8に
示したような複雑な文字構成を持つ場合でも正しいライ
ンペアを抽出することができる。
FIG. 8 shows a line pair extracted with respect to a vertical line by using the above-mentioned line pair determination processing. Vertical line pair 81 shows line pair information. A vertical line pair 81 indicates that x0 and x2, x1 and x3, x4 and x5, x6 and x8, and x7 and x9 are line pairs, respectively. According to the present invention, a correct line pair can be extracted even if it has a complicated character structure as shown in FIG.

【0027】[0027]

【発明の効果】本発明によれば、文字を構成するすべて
の水平線及び垂直線について、水平線を生成する最大x
値,最小x値,y値、線の向き、さらに垂直線を生成す
る最大y値,最小y値,x値、線の向きを管理すること
により、様々な特徴を持つ文字に対して正しいラインペ
アを抽出することができる。その結果、線幅補正を行う
ことで文字本来の持つ美しさを十分に表現することがで
きる。
According to the present invention, for all horizontal and vertical lines that make up a character, the maximum x for generating horizontal lines is x.
By controlling the values, minimum x value, y value, line direction, and maximum y value, minimum y value, x value, and line direction that generate vertical lines, the correct line for characters with various characteristics Pairs can be extracted. As a result, by performing the line width correction, the original beauty of the character can be sufficiently expressed.

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

【図1】本発明のシステムを示すブロック図。FIG. 1 is a block diagram showing a system of the present invention.

【図2】ラインペア判定部を示すブロック図。FIG. 2 is a block diagram showing a line pair determination unit.

【図3】水平線を抽出する一実施例を示すフローチャー
ト。
FIG. 3 is a flowchart showing an example of extracting a horizontal line.

【図4】垂直線を抽出する実施例を示すフローチャー
ト。
FIG. 4 is a flowchart showing an example of extracting a vertical line.

【図5】抽出した水平線及び垂直線を管理するテーブル
の説明図。
FIG. 5 is an explanatory diagram of a table that manages extracted horizontal lines and vertical lines.

【図6】垂直線におけるラインペア判定処理の一実施例
を示すフローチャート。
FIG. 6 is a flowchart showing an example of line pair determination processing for vertical lines.

【図7】垂直線におけるラインペア判定処理の一実施例
を示すフローチャート。
FIG. 7 is a flowchart showing an example of line pair determination processing for a vertical line.

【図8】「出」の垂直線のラインペア情報を示した説明
図。
FIG. 8 is an explanatory diagram showing line pair information of “out” vertical lines.

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

11…入力部、12…制御部、13…文字描画部、14
…出力部、131…データ読み出し部、132…フォン
ト記憶部、133…座標変換部、135…ワークメモ
リ、136…塗りつぶし部、1341…閉領域分離部、
1342…水平線垂直線抽出部、1343…ラインペア
判定部、1344…座標点補正部。
11 ... Input part, 12 ... Control part, 13 ... Character drawing part, 14
Output unit 131 Data read unit 132 Font storage unit 133 Coordinate conversion unit 135 Work memory 136 Fill unit 1341 Closed region separation unit
1342 ... Horizontal line / vertical line extraction unit, 1343 ... Line pair determination unit, 1344 ... Coordinate point correction unit.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】任意の文字及びサイズを入力する入力手段
と,文字を出力する出力手段と,アウトラインフォント
を形成する文字輪郭座標データを記憶するフォント記憶
手段と,前記入力手段から送られてくる文字コードに対
応する文字輪郭座標データを読み出すデータ読み出し手
段と,前記文字輪郭座標データを所望の解像度及びサイ
ズに変換するための座標変換手段と,生成された輪郭座
標点内部を塗りつぶす塗りつぶし手段と,前記座標変換
手段において変換された文字輪郭座標データを用いて線
幅を補正する線幅補正手段からなる文字出力部におい
て、水平線及び垂直線のラインペア情報を抽出する際
に、水平線を構成する最大値と最小値の情報及び垂直線
を構成する最大値と最小値の情報を抽出する水平線垂直
線抽出部と,前記水平線垂直線抽出部にて抽出した情報
を用いて、各々の水平線,垂直線内でラインペアである
かどうかを判定するラインペア判定部を有することを特
徴とする輪郭線抽出方法。
1. Input means for inputting an arbitrary character and size, output means for outputting a character, font storage means for storing character contour coordinate data forming an outline font, and said input means. Data reading means for reading the character contour coordinate data corresponding to the character code, coordinate conversion means for converting the character contour coordinate data to a desired resolution and size, and filling means for filling the inside of the generated contour coordinate points. In the character output unit including the line width correction unit that corrects the line width using the character contour coordinate data converted by the coordinate conversion unit, when extracting line pair information of the horizontal line and the vertical line, the maximum horizontal line is formed. A horizontal line vertical line extracting unit for extracting information on the value and the minimum value and information on the maximum value and the minimum value forming the vertical line; Using the extracted information in a vertical line extraction unit, each of the horizontal lines, contour extraction method characterized by comprising determining line pair determining section whether a line pair in a vertical line.
【請求項2】請求項1において、ラインペアであるか否
かを判定する際に、水平線及び垂直線の向きを用いて判
定する向き条件判定手段、さらに水平線の場合には水平
線輪郭座標のy座標値とx座標値の範囲,垂直線の場合
には垂直線輪郭座標のx座標値とy座標値の範囲を用い
た座標値条件判定手段を有する輪郭線抽出方法。
2. The orientation condition determining means for determining whether a line pair is a horizontal line or a vertical line when determining whether or not it is a line pair, and in the case of a horizontal line, a horizontal line contour coordinate y. A contour line extraction method having a coordinate value condition judging means using a range of coordinate values and x coordinate values, and in the case of a vertical line, a range of x coordinate values and y coordinate values of vertical line contour coordinates.
【請求項3】請求項2において、共に条件を満足した場
合にラインペアであると判定する輪郭線抽出方法。
3. A contour line extraction method according to claim 2, wherein a line pair is judged to be a line pair when both conditions are satisfied.
【請求項4】請求項3において、輪郭線の方向が互いに
逆であるかどうかを判定条件とする輪郭線抽出方法。
4. The contour line extracting method according to claim 3, wherein the judgment condition is whether the directions of the contour lines are opposite to each other.
【請求項5】請求項3において、一方の水平線のx座標
値範囲と他方のx座標値範囲に共通部分が存在するこ
と、同様に一方の垂直線のy座標値範囲と他方のy座標
値範囲に共通部分が存在することを判定条件とする輪郭
線抽出方法。
5. The method according to claim 3, wherein the x-coordinate value range of one horizontal line and the x-coordinate value range of the other have a common portion, and similarly, the y-coordinate value range of one vertical line and the y-coordinate value of the other vertical line. A contour line extraction method in which the judgment condition is that there is a common part in the range.
JP6270870A 1994-11-04 1994-11-04 Contour line sampling method for character Pending JPH08138066A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6270870A JPH08138066A (en) 1994-11-04 1994-11-04 Contour line sampling method for character

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6270870A JPH08138066A (en) 1994-11-04 1994-11-04 Contour line sampling method for character

Publications (1)

Publication Number Publication Date
JPH08138066A true JPH08138066A (en) 1996-05-31

Family

ID=17492119

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6270870A Pending JPH08138066A (en) 1994-11-04 1994-11-04 Contour line sampling method for character

Country Status (1)

Country Link
JP (1) JPH08138066A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6607315B2 (en) * 2001-01-04 2003-08-19 Hitachi, Ltd. Image processing system having image forming apparatus and printer apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6607315B2 (en) * 2001-01-04 2003-08-19 Hitachi, Ltd. Image processing system having image forming apparatus and printer apparatus

Similar Documents

Publication Publication Date Title
JP2940496B2 (en) Pattern matching encoding apparatus and method
US6185341B1 (en) Image processing using vector data to reduce noise
US4903312A (en) Character recognition with variable subdivisions of a character region
JPH0196771A (en) Recognizing system for circular arc part
JPH08235341A (en) Method and device for document filing
US6947596B2 (en) Character recognition method, program and recording medium
EP0657838B1 (en) Image processing apparatus and method
JP4416890B2 (en) Form identification device
JPH08138066A (en) Contour line sampling method for character
EP0471849A1 (en) Method of generating dot signal corresponding to character pattern and device therefor
JP2845269B2 (en) Figure shaping apparatus and figure shaping method
JP2001283212A (en) Method of base interpolation by vector transformation
JP2000013601A (en) Print information processor and device and method for generating intermediate data
JPS6057264B2 (en) Binary pattern expansion method
JP2000076378A (en) Character recognizing method
KR100254659B1 (en) Character forming apparatus
JP2915700B2 (en) Image processing method and apparatus
JP3716528B2 (en) Image processing device
JPH0916701A (en) Bar code extracting device
JP2937607B2 (en) Layout creation device
JP3757686B2 (en) Character data generator and character output device
JPH07287740A (en) Character recognition device
JPH07319443A (en) Data conversion device
JPH0562016A (en) Character recognizing device
JP2933947B2 (en) Image processing method and apparatus