JPS63215166A - Area processing system - Google Patents

Area processing system

Info

Publication number
JPS63215166A
JPS63215166A JP62047968A JP4796887A JPS63215166A JP S63215166 A JPS63215166 A JP S63215166A JP 62047968 A JP62047968 A JP 62047968A JP 4796887 A JP4796887 A JP 4796887A JP S63215166 A JPS63215166 A JP S63215166A
Authority
JP
Japan
Prior art keywords
point
area
input
points
processing
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
JP62047968A
Other languages
Japanese (ja)
Other versions
JP2791017B2 (en
Inventor
Toshiyuki Kitamura
敏之 北村
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP62047968A priority Critical patent/JP2791017B2/en
Publication of JPS63215166A publication Critical patent/JPS63215166A/en
Application granted granted Critical
Publication of JP2791017B2 publication Critical patent/JP2791017B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

PURPOSE:To save the storage capacity and the transmission time of an area data and to facilitate the editing of a complicated irregular area, by dividing the irregular area where plural rectangles are combined into rectangular areas. CONSTITUTION:When first point P1 (PX1, PY1) and second point P2 (PX2, PY2) are inputted, since it is ¦PX2-PX1¦>¦PY2-PY1¦, the input point P2 is corrected to T2=(TX2, TY2)=(PX2, PY1). When third point P3 (PX3, PY3) is inputted, it goes to ¦PX3-TX2¦<¦PY3-TY2¦ from a corrected second point T2 and the third point P3, and the P3 is corrected to T3 (TX3, TY3)=(PX2, PY3). Fourth point P4 (PX4, PY4) is compared with a corrected third point T3, and is corrected to T4 (TX4, TY4)=(PX4, PY3). Fifth point P5 (PX5, PY5) is corrected to T5 (TX5, TY5)=(PX4, PY5) and sixth point P6 (PX6, PY6) to T6 (TX6, TY6)=(PX6, PY5), and the first point P1 (X1, Y1) is corrected to T1 (TX1, TY1)=(PX6, PY1).

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は画像処理装置における座標入力装置により入力
された領域の処理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for processing a region input by a coordinate input device in an image processing apparatus.

〔従来技術〕[Prior art]

従来、領域を指定する方法の1つに矩形の領域を対角線
上の2端点をもって指定する方法や、さらに指定する領
域が矩形を組み合せた形(以後凹凸エリアと呼ぶ)とし
、そのコーナ一点を順次入力する方法がある。
Conventionally, one of the methods for specifying an area is to specify a rectangular area using two end points on the diagonal line, and furthermore, the area to be specified is a combination of rectangles (hereinafter referred to as an uneven area), and one corner point of the area is specified sequentially. There is a way to enter it.

この様な入力方法においては領域の水平方向及び垂直方
向の変化点を境界とし、画像処理内容を切り換えてゆく
方法が用いられている。
In such an input method, a method is used in which the change points in the horizontal and vertical directions of an area are used as boundaries, and the content of image processing is switched.

しかしながら、複数の矩形が複雑に組み合わさった領域
に対して画像処理することは困難であった。
However, it has been difficult to perform image processing on a region that is a complex combination of multiple rectangles.

〔発明が解決しようとしている問題点〕そこで複雑な形
状の領域に対して画像処理を行う方法として編集作業用
のビットマツプメモリーを持つ方法が考えられる。これ
は第15図の様に画像読取領域に対応させたメモリ上へ
、指定された領域の内部を書き込んでゆき、このビット
マツプメモリーを参照しながら、出力の制御を行う。こ
の方法だと、異なる画像処理を行う複数領域の処理が容
易に行える利点がある。しかし反面、ビットマツプメモ
リーに必要なメモリ容lが非常に大きいという欠点があ
る。1例として、A4 (296X210)の画像領域
を分解能0 、5 m m X 0 、5 m mで1
個の画像処理を行おうとすると、約25万bit必要と
する。
[Problems to be Solved by the Invention] Therefore, as a method of performing image processing on a region with a complex shape, a method of having a bitmap memory for editing work can be considered. As shown in FIG. 15, the inside of the specified area is written into the memory corresponding to the image reading area, and the output is controlled while referring to this bitmap memory. This method has the advantage that it is possible to easily process multiple areas that undergo different image processing. However, on the other hand, there is a drawback that the memory capacity required for the bitmap memory is very large. As an example, an image area of A4 (296 x 210) has a resolution of 0, 5 mm x 0, and 1
If you try to process 1 image, you will need about 250,000 bits.

又、この処理をリアル・タイムに処理することも困難で
ある。
Furthermore, it is difficult to perform this processing in real time.

〔目 的〕〔the purpose〕

本発明は以上の状況に鑑み、複雑な形状の領域に対して
も容易に画像処理を行えるようにする領域処理方式を提
供することを目的とするものである。
SUMMARY OF THE INVENTION In view of the above circumstances, it is an object of the present invention to provide an area processing method that allows image processing to be easily performed even on areas with complex shapes.

〔実施例〕〔Example〕

以下図面を参照して本発明の一実施例を詳細に説明する
An embodiment of the present invention will be described in detail below with reference to the drawings.

第1−2図は本発明を適、用できる複写装置の外観図で
ある。原稿読取部101は不図示の原稿台ガラス、照明
ランプとミラーから成る2:1光学系、レンズ、CCD
等を有し、前記光学系が副走査しつつ原稿像を光電変換
し電気信号として出力する。プリント部102はいわゆ
るレーザープリンターで、読取部101からの電気信号
を受け、変調されたレーザビームにより感光体上を走査
して電子写真方式にてプリントする。読取部101は操
作部103、原稿押えを兼ねた座標入力装置104、座
標入力ペン105を有する。第1−1図に座標入力装置
104を上側から見た図を示す。106は有効座標入力
面、107は原稿114を入力面に載置する為の突き当
て基準点、108は領域指定を行う旨を入力する領域指
定キー、109は一連の入力座標をキャンセルするクリ
アキー、110は領域指定の入力を終了するOKキー、
illは指定領域のみを出力するトリミングモード選択
キー、112は指定領域のみを消′去するマスキングモ
ード選択キー、113は指定領域内部をその外部と異な
る処理で出力する画像分離モード選択キーである。
1-2 are external views of a copying machine to which the present invention can be applied. The document reading unit 101 includes a document table glass (not shown), a 2:1 optical system consisting of an illumination lamp and a mirror, a lens, and a CCD.
The optical system performs sub-scanning while photoelectrically converting the original image and outputs it as an electrical signal. The printing unit 102 is a so-called laser printer, which receives an electrical signal from the reading unit 101, scans the photoreceptor with a modulated laser beam, and prints using an electrophotographic method. The reading unit 101 includes an operation unit 103, a coordinate input device 104 that also serves as a document holder, and a coordinate input pen 105. FIG. 1-1 shows a view of the coordinate input device 104 from above. 106 is an effective coordinate input surface, 107 is a reference point for placing the original 114 on the input surface, 108 is an area specification key for inputting an area specification, and 109 is a clear key for canceling a series of input coordinates. , 110 is an OK key to finish inputting the area designation,
112 is a masking mode selection key that erases only the specified area; 113 is an image separation mode selection key that outputs the inside of the specified area with different processing from the outside.

これらの操作例を説明する。Examples of these operations will be explained.

オペレータは図示の如く、原稿114を基準点107に
突き当てて載置し、キー108により領域指定モードに
入り、入力ペン105によって例えば点線で囲まれる領
域の黒丸で示す各コーナーを右回り或いは左回りで順次
入力後OK主キー10を押して入力を完了する。その後
、指定領域に対して施すべき処理内容を111. 11
2. 113の各キーにより指示する。
As shown in the figure, the operator places the original 114 against the reference point 107, enters the area designation mode using the key 108, and uses the input pen 105 to move clockwise or counterclockwise around each corner indicated by a black circle in the area surrounded by a dotted line. After inputting data sequentially by rotating the keys, press the OK main key 10 to complete the input. After that, 111. 11
2. 113 keys.

第3図に本実施例の複写装置の概略ブロック図を示す。FIG. 3 shows a schematic block diagram of the copying apparatus of this embodiment.

302は画像読取部である。画像読取部302はCCD
、信号増巾回路、A/D変換回路、シェーディング補正
回路を有し補正後の信号が画像処理部303に入力され
る。
302 is an image reading unit. The image reading unit 302 is a CCD
, a signal amplification circuit, an A/D conversion circuit, and a shading correction circuit, and the corrected signal is input to the image processing unit 303 .

画像処理部303ではシフトメモリに画信号を一旦蓄積
後、変倍、移動、トリミング/マスキング濃度変換等の
画像処理を施し、その結果がVIDEO信号として外部
ユニット312へ出力される。外部ユニット312は本
実施例ではいわゆるレーザープリンタを想定しているが
、電子ファイルやファクシミリ等のコントローラ及びメ
モリ装置でも良い。
The image processing unit 303 once stores the image signal in a shift memory, performs image processing such as scaling, movement, trimming/masking density conversion, etc., and outputs the result to the external unit 312 as a VIDEO signal. In this embodiment, the external unit 312 is assumed to be a so-called laser printer, but it may also be a controller and memory device for an electronic file, facsimile, etc.

外部ユニットとはケーブル313を介して画信号VID
EO以外に例えば複数の信号像から成るシリアル信号線
5RALによりシリアル信号を行い、システム全体を制
御する。外部ユニット312がレーザープリンターの時
はプリンタから水平同期信号BDを受け、クロックジェ
ネレータ304により内部動作の為のクロックを生成し
前述の読取部302や処理部303に与える。
Image signal VID is connected to the external unit via cable 313.
In addition to EO, a serial signal line 5RAL consisting of a plurality of signal images is used to send a serial signal to control the entire system. When the external unit 312 is a laser printer, it receives a horizontal synchronizing signal BD from the printer, generates a clock for internal operation by a clock generator 304, and supplies it to the reading section 302 and processing section 303 described above.

CPU301は制御プログラムや制御データを格納した
ROM305、処理データ等を記憶するためのRAM3
06、タイマー回路307を有し、前述の読取部302
)処理部303、外部ユニット312との通信を制御す
る他に原稿照明の為の蛍光灯ドライバ回路309や光学
系駆動の為のモータードライバ回路308、及び操作部
311や座標入力装置310を制御する。
The CPU 301 includes a ROM 305 that stores control programs and control data, and a RAM 3 that stores processing data, etc.
06, has a timer circuit 307, and the above-mentioned reading section 302
) In addition to controlling communication with the processing unit 303 and external unit 312, it also controls a fluorescent lamp driver circuit 309 for illuminating the document, a motor driver circuit 308 for driving the optical system, the operation unit 311, and the coordinate input device 310. .

第4図に座標入力装置310のブロック図を示す。FIG. 4 shows a block diagram of the coordinate input device 310.

タイミング回路402は内蔵された発振器によりクロッ
クを発生させ、アドレスカウンタ403に与える。アド
レスカウンタ403はペン412に内蔵されたスイッチ
が押下されている間、カウント動作する。カウント動作
中まずXデコーダ409が動作し、パルス電圧を順次入
力面411のX方向電極に2巡ダイナミックスキャンし
、その後Yデコーダ410が動作し同じ(パルス電圧を
順次入力面411のY方向電極に2巡ダイナミックスキ
ャンする。入力面411上でペンのスイッチがONされ
ると、X方向、Y方向のスキャンがペン位置へ達した時
に静電容置結合によりペン内に電圧が誘起され、ペン入
力信号が得られ、アンプ404により増幅される。X方
向スキャンの1巡目のペン入力信号によりカウント値が
Xレジスタ406にセットされ、2巡目スキャン時のペ
ン入力信号によりXレジスタ406の内容とカウント値
を比較器405により比較して、一致すれば一致信号が
CPU401に出力される。同様にY方向についても1
巡目スキヤン時Yレジスタ408がセットされ、2巡目
スキャン時比較器407で比較して一致していれば一致
信号がCPU401に出力されて、CPU401は2つ
の一致信号が得られた時x、Y各レジスタから座標値を
取り込み、メインCPU301に対して例えばシリアル
通信により通知できる。尚、Xレジスタ406とカウン
タ値とが一致しないときは入力無効と判断される。Y方
向も同様である。
Timing circuit 402 generates a clock using a built-in oscillator and supplies it to address counter 403 . The address counter 403 performs a counting operation while the switch built in the pen 412 is pressed down. During the counting operation, the X decoder 409 operates first and dynamically scans the pulse voltage to the X-direction electrodes of the input surface 411 twice, and then the Y-decoder 410 operates to sequentially apply the same pulse voltage to the Y-direction electrodes of the input surface 411. Performs two cycles of dynamic scanning.When the pen switch is turned on on the input surface 411, when the scan in the X and Y directions reaches the pen position, a voltage is induced in the pen by electrostatic capacity coupling, and the pen input signal is is obtained and amplified by the amplifier 404.The count value is set in the X register 406 by the pen input signal in the first round of the X direction scan, and the contents of the X register 406 and the count are set by the pen input signal in the second scan. The values are compared by a comparator 405, and if they match, a matching signal is output to the CPU 401.Similarly, 1
During the second scan, the Y register 408 is set, and during the second scan, the comparator 407 compares and if they match, a match signal is output to the CPU 401, and when the CPU 401 obtains two match signals, x, The coordinate values can be taken in from each Y register and notified to the main CPU 301 by, for example, serial communication. Note that if the X register 406 and the counter value do not match, it is determined that the input is invalid. The same applies to the Y direction.

第5図に、画像処理部303の内部、特にシフトメモリ
に係る回路図を示す。尚、シフト・メモリには2ライン
分のシフト・メモリが設けられるが、その制御は共通な
ので、第5図には一方のシフト・メモリに関してのみ、
その制御構成を示す。ライトアドレスカウンタ904は
シフトメモリ907にデータを書込む時のアドレスカウ
ンタで、リードアドレスカウンタ905はシフトメモリ
907からデータを読み出す時のアドレス・カウンタで
ある。アドレスセレクタ906はCPU301からの指
令をI10ポート901を介して受けてライトアドレス
カウンタ904のアドレス信号とリードアドレスカウン
タ905のアドレス信号のいずれかを選択し、シフトメ
モリ907をアドレッシンダするためのものである。
FIG. 5 shows a circuit diagram related to the inside of the image processing unit 303, particularly the shift memory. Although the shift memories are provided for two lines, their control is common, so FIG. 5 shows only one shift memory.
The control configuration is shown below. A write address counter 904 is an address counter for writing data into the shift memory 907, and a read address counter 905 is an address counter for reading data from the shift memory 907. The address selector 906 receives a command from the CPU 301 via the I10 port 901, selects either the address signal of the write address counter 904 or the address signal of the read address counter 905, and addresses the shift memory 907. .

I10レジスタ902,903はライトアドレスカウン
タ904、リードアドレスカウンタ905にそれぞれプ
リセット値をCPU301が与えるためのレジスタであ
る。
I10 registers 902 and 903 are registers for the CPU 301 to give preset values to the write address counter 904 and read address counter 905, respectively.

ライトアドレスカウンタ904、リードアドレスカウン
タ905は共にダウンカウンタでそれぞれにカウント動
作の開始を指令するWST信号及びR5T信号が入力さ
れ、また、シフトメモリ907への書込みクロックWC
LKとシフトメモリからの読出しクロックRCLKが入
力される。
Both the write address counter 904 and the read address counter 905 are down counters, and the WST signal and R5T signal that command the start of counting operation are input to each of them, and the write clock WC to the shift memory 907 is input to each of them.
LK and a read clock RCLK from the shift memory are input.

915、 916は画像領域を決定する為の排他オアゲ
ート、信号OFはそれを制御する信号で、lの時STカ
ウンタ912)ENカウンタ913で決まる枠内をマス
クし、枠外を出力画佛とし、Oの時枠内を出力画像とし
枠外をマスクする。
915 and 916 are exclusive OR gates for determining the image area, and the signal OF is a signal that controls them. The area within the time frame is the output image, and the area outside the frame is masked.

910はシフトメモリ907から出力され濃度処理部9
08を経て2値信号となった画像データを出力制御する
アンドゲート、917は前述のマスク部分を白として出
力するか黒として出力するかを決定するアンドゲートで
、BBはそれを制御する信号で1の時点、0の時白を出
力する。
910 is output from the shift memory 907 and sent to the density processing section 9.
08 is an AND gate that controls the output of the image data that has become a binary signal, 917 is an AND gate that determines whether to output the aforementioned mask portion as white or black, and BB is a signal that controls it. When it is 1, white is output when it is 0.

911はゲート910,917により出力される画像出
力をVIDEOとして出力するオアゲート、909は画
像データを白黒反転制御する排他オアゲート、INはそ
れを制御する信号で1の時オリジナル通りの画像で、O
の時は反転させる。各信号は、CPU301がオペレー
タの指定したモードにより出力する。
911 is an OR gate that outputs the image output from gates 910 and 917 as VIDEO; 909 is an exclusive OR gate that controls black and white inversion of image data; IN is a signal that controls it; when it is 1, the image is as original;
Invert when . Each signal is output by the CPU 301 according to the mode specified by the operator.

STカウンタ912及びENカウンタ913は各々決め
られた領域のみに画像を出力するためのスタートビット
カウンタ及びエンドビットカウンタで、これらには、I
loを介してCPU301がゲートの為のカウントデー
タをプリセットする。
The ST counter 912 and the EN counter 913 are a start bit counter and an end bit counter for outputting an image only to a predetermined area, respectively.
The CPU 301 presets count data for the gate via lo.

フリップフロップ914はSTカウンタ912のカウン
トアツプでセットされ、ENカウンタ913のカウント
アツプでリセットされる。
The flip-flop 914 is set when the ST counter 912 counts up, and is reset when the EN counter 913 counts up.

例えばOF倍信号1の場合STカウンタ912のカウン
トアツプでF/F914のQが1となるとゲート915
の出力がOとなって、ENカウンタ913がカラントア
ップする迄ゲート910の出力はなく、マスクされる。
For example, in the case of the OF multiplied signal 1, when the ST counter 912 counts up and the F/F 914 Q becomes 1, the gate 915
There is no output from the gate 910 and it is masked until the output of the gate becomes O and the EN counter 913 increments by a current.

かわりにゲート916の出力はその間1なのでBB倍信
号1の時ゲート917は1であり、ゲート911は1を
出力し、黒マスクとなる。逆に0F=1.BB=0(7
)時は白マスクされる。又0F=0とするとゲート91
5. 916の出力が各々その間1.0となるのでBB
=1の時はトリミング領域外が黒、0F=0.BB=O
の時はトリミング領域外が白となる。
Instead, the output of the gate 916 is 1 during that time, so when the BB multiplied signal is 1, the gate 917 is 1, and the gate 911 outputs 1, resulting in a black mask. Conversely, 0F=1. BB=0(7
) is masked white. Also, if 0F=0, gate 91
5. Since each output of 916 becomes 1.0 during that time, BB
When = 1, the outside of the trimming area is black, 0F = 0. BB=O
When , the area outside the trimming area becomes white.

さて本実施例は、以上述べた手段を用いて、矩形もしく
は矩形を組み合わせた領域に対してトリミングやマスキ
ング等の編集処理を行う場合に有効である。
Now, this embodiment is effective when performing editing processing such as trimming and masking on a rectangle or a region that is a combination of rectangles using the above-described means.

矩形もしくは矩形の組み合わせ領域とは主/副各走査軸
に平行もしくは垂直な線分によってのみ囲まれる領域の
事であり、編集の対象をこのような領域に限定する事は
充分実用的であり、かつ大容量メモリを用いることなく
、低コストで編集機能を提供できるという点において有
用である。
A rectangle or a combination of rectangles is an area surrounded only by line segments parallel or perpendicular to the main and sub-scanning axes, and it is quite practical to limit the editing target to such areas. Moreover, the present invention is useful in that editing functions can be provided at low cost without using a large capacity memory.

このような限定にもとづいてオペレータは所望の領域を
囲むように離散的に座標を入力し、かつそれらの座標を
入力順に結んだ線分が主/副各走査軸に対して極力水平
もしくは垂直になるように入力するものとする。
Based on these limitations, the operator inputs coordinates discretely to surround the desired area, and makes sure that the line segments connecting these coordinates in the input order are as horizontal or perpendicular to the main and sub-scanning axes as possible. Please input as follows.

しかしながら現実にはフリーハンドによるペン入力によ
り水平、垂直に結ばれる2点を入力することは、座標入
力装置の実用的な分解能から見て不可能である為、以下
のような手順でオペレータの入力座標を補正する。
However, in reality, it is impossible to input two points connected horizontally and vertically using freehand pen input, considering the practical resolution of the coordinate input device. Correct the coordinates.

第2図に本実施例による領域指定方式の概略例を図示す
る。
FIG. 2 shows a schematic example of the area designation method according to this embodiment.

■まず、すでに設定されている座標を全てクリアする為
、クリアキーを押す。
■First, press the clear key to clear all the coordinates that have already been set.

■第1点P+  (PXI 、  PYI )を入力す
る。
■Input the first point P+ (PXI, PYI).

■第2点P2 (PX21 PY2)を入力する。この
時、1PX2  PXI lと1PY2−PYI lを
比較して、1 px2−px、1 > 1py2−py
、+だから入力点P2を図示の如< T2(TX21 
TY2 )=(P X21py、 )に補正する。
■Input the second point P2 (PX21 PY2). At this time, comparing 1PX2 PXI l and 1PY2-PYI l, 1 px2-px, 1 > 1py2-py
, +, so the input point P2 is < T2 (TX21
Correct to TY2 )=(P X21py, ).

■第3点P3(PX3.PY3)を入力する。この時、
補正済第2点T2と第3点P3から1PX3−TX21
くIPY3−TY21となる故、図示の如<P3  を
T3  (TX31  TY3)  =  (PX21
   PY3)の様に補正する。
■Input the third point P3 (PX3.PY3). At this time,
1PX3-TX21 from corrected second point T2 and third point P3
Therefore, T3 (TX31 TY3) = (PX21
Correct as shown in PY3).

■第4点P4(PX4.PY4)も補正済第3点T3と
比較してT4(TX4.TY4)=(PX4.PY3)
と補正する。以下同様に、 ■第5点P5(PX5 + PYs )はT 5(T 
X s 、 T Y 5)= (PX4.PY5)へと ■第6点Pa(PXa 、 PYe )はT6(TX6
. TY6)= (px6.py5)へと補正する。
■The fourth point P4 (PX4.PY4) is also compared with the corrected third point T3 and T4 (TX4.TY4) = (PX4.PY3)
and correct it. Similarly, ■The fifth point P5 (PX5 + PYs) is T 5 (T
X s , TY 5) = (PX4.PY5) and ■ 6th point Pa (PXa , PYe ) is T6 (TX6
.. TY6) = (px6.py5).

■所望の領域の各コーナーの入力が完了したらOKキー
を押す。
■When inputting each corner of the desired area is completed, press the OK key.

■OKキーが入力されたら第1点P、(PX、、PYI
 )と補正済最終点Ta”(TXa +  TYa )
=(PXa +PY5)から後述の終点処理により第1
点P。
■When the OK key is input, the first point P, (PX,, PYI
) and the corrected final point Ta” (TXa + TYa)
From = (PXa + PY5), the first
Point P.

(X、、Y、)をT、 (TX、 、 TY+ ) −
(PXa 。
(X, , Y,) as T, (TX, , TY+) −
(PXa.

PY、)へと補正する。PY, ).

以上の手順で入力座標を補正制御することでオペレータ
の所望の領域を垂直線分及び垂直線分で構成することが
できる。
By correcting and controlling the input coordinates in the above-described procedure, the area desired by the operator can be constructed of vertical line segments.

第6図に前述の補正処理の詳細なフローチャートを示す
。まず入力座標点数を示すRAM上のカウンタiをOク
リアする(601)。座標入力があれば(602)、そ
のX成分をRAM上のエリアPXi、 TXiにY成分
を同じ(PYi、  TYiにセットする( 603 
)。
FIG. 6 shows a detailed flowchart of the above-mentioned correction process. First, a counter i on the RAM indicating the number of input coordinate points is cleared to zero (601). If there is a coordinate input (602), set the X component to the area PXi, TXi on the RAM and the Y component to the same (PYi, TYi) (603
).

i=0つまり1魚目ならば(604)、2魚目入力を待
つべく、カウンタiをインクリメントする(615)。
If i=0, that is, the first fish (604), the counter i is incremented to wait for the second fish input (615).

i≧1ならば(604)、1点前の補正済座標(T X
 i−+ 。
If i≧1 (604), the corrected coordinates of the previous point (T
i-+.

TYi−+)と今回の入力座標(PXi、 PYi)の
X。
TYi-+) and the current input coordinates (PXi, PYi).

Y成分毎の差分の絶対値α、βを求める(605)。The absolute values α and β of the difference for each Y component are determined (605).

オペレータは各点を結ぶ線分が極力軸に対して水平、垂
直になるよう入力するという前提に基づいてαとβの大
小比較を行う(606)。α〈βならばオペレータがY
軸に平行になる様座標入力しようとしたと判定して注目
点PiのY座標PYiをそのままTYiとして採用し、
X座標PXiはキャンセルして一点前のX座標T X 
i−+をTXiとして採用する(608)。逆にα〉β
ならばオペレータがX軸に平行になる様、座標入力を行
ったと判定して注目点PiのX座標PXiはそのままT
Xi’として採用し、Y座標PYiはキャンセルし一点
前のY座標T Y i−+をTYiとして採用する(6
07)。607゜608の補正により入力点PiはTi
に補正され、線分子i−+TiがX軸もしくはY軸に平
行になった後、次に線分子 i −+ T iとその一
本前の線分子1−2Ti−+が直交するか否か調べる。
The operator compares the magnitudes of α and β based on the premise that the line segment connecting each point is input so as to be as horizontal and perpendicular to the axis as possible (606). If α<β, the operator is Y
It is determined that an attempt was made to input coordinates parallel to the axis, and the Y coordinate PYi of the point of interest Pi is adopted as TYi,
The X coordinate PXi is canceled and the previous X coordinate T
i-+ is adopted as TXi (608). On the contrary, α〉β
If so, it is determined that the operator has input the coordinates parallel to the X axis, and the X coordinate PXi of the point of interest Pi is set as T.
Xi', cancel the Y coordinate PYi, and use the previous Y coordinate TYi-+ as TYi (6
07). With the correction of 607°608, the input point Pi becomes Ti
After the line molecule i-+Ti becomes parallel to the X-axis or Y-axis, check whether the line molecule i-+ Ti and the previous line molecule 1-2Ti-+ are orthogonal to each other. investigate.

i=1ならば線分は1本しか生成されないので第3点入
力を待つべくカウンタlを1インクリメントする(60
9.610.615)。
If i = 1, only one line segment is generated, so the counter l is incremented by 1 to wait for the input of the third point (60
9.610.615).

i≧2ならばT X i −2: T X iすなわち
注目の2線分がY軸に平行な同−線分上にあるか否か(
612)もしくはTYi−2=TYiすなわち注目する
2線分がX軸に平行な同−線分上にあるか否か(611
)を調べ、もしNoならば次の入力を待つべくカウンタ
iを1インクリメント(615)。もしYESならばこ
れら2線分を1線分にまとめるべ(Ti−2TI−1+
1=rなる和ベクトルをあらためて T I −2T r−、+と置きかえる(613,61
4)。つまり1点前の入力Ti−+をキャンセルしTi
をTi−rとして扱い、再びT1人力を待つ為、カウン
タiをインクリメントせず、次の座標を待つ。新たな入
力を待つべくカウンタiをインクリメントした後、最新
の入力点Ti−+により生成された線分子 i −2T
 i−1がそれ迄に入力された全ての線分子。T1.T
、T2・・・Ti−3看]と何回交差するか否かをチェ
ックする(616)。その詳細フローは後述する。
If i≧2, T X i −2: T X i, that is, whether the two line segments of interest are on the same line segment parallel to the Y axis (
612) or TYi-2=TYi, that is, whether the two line segments of interest are on the same line segment parallel to the X axis (611
), and if No, the counter i is incremented by 1 to wait for the next input (615). If YES, combine these two line segments into one line segment (Ti-2TI-1+
Replace the sum vector 1=r with T I −2T r−, + (613, 61
4). In other words, the previous input Ti-+ is canceled and Ti
Since it treats as Ti-r and waits for T1 human power again, it does not increment the counter i and waits for the next coordinate. After incrementing the counter i to wait for a new input, the line molecule i −2T generated by the latest input point Ti−+
i-1 is all line molecules input so far. T1. T
, T2...Ti-3] is checked (616). The detailed flow will be described later.

交差検出の結果全く交差しない時は次の座標入力を待つ
(617,602)。2回以上交差するようならばTi
−+を無効入力とし、再入力を待つべくカウンタiを1
デクリメントする(617→619)。1回だけ交差す
る場合は少なくとも閉領域が1つ生成されたため、領域
指定を終了する為のOK主キー力もしくは点Ti−+を
キャンセルする為のクリアキー人力を待つ。もしクリア
キー人力があればカウンタiを1デクリメントし再入力
を待つ(618→619)。
If the result of intersection detection is that there is no intersection at all, the next coordinate input is waited (617, 602). If it intersects more than once, Ti
-+ is invalid input and counter i is set to 1 to wait for re-input.
Decrement (617→619). If the points intersect only once, at least one closed area has been generated, so the operator waits for the OK main key force to end the area specification or the clear key force to cancel the point Ti-+. If there is a clear key available, the counter i is decremented by 1 and waits for re-input (618→619).

もしOK主キー力があれば後述の終点処理に進む(62
4)。
If there is an OK primary key force, proceed to the end point processing described later (62
4).

ステップ602において座標入力がない時、クリアキー
人力があれば、最新の入力点Ti−+をキャンセルして
再入力を待つ為カウンタiを1デクリメントする(62
3)。OK主キー力があれば(624)後述の終点処理
に進む(624)。終点処理の結果領域が確定したら終
了し、未確定ならば再び座標入力もしくはクリアキー人
力を待つ。
When there is no coordinate input in step 602, if there is a clear key input, the counter i is decremented by 1 in order to cancel the latest input point Ti-+ and wait for re-input (62
3). If there is an OK primary key force (624), the process proceeds to the end point process described later (624). When the area is determined as a result of end point processing, the process ends, and if it is not determined, the process waits for coordinate input or clear key input again.

第7図に交差検出の制御フローを示し、以下に説明する
。まず交差回数を示すRAM上のカウンタkをOクリア
する(701 )。i<4の時は高々4点つまり3辺し
か入力されていないので検出処理を終了する。i″25
の時は交差チェックの為のRAM上のカウンタjにi−
4をセットする(703)。その後、点Ti−+、 T
i−z、Tj、 Tj−+の座標を用いて値A、 B。
FIG. 7 shows a control flow of intersection detection, which will be explained below. First, a counter k on the RAM indicating the number of intersections is cleared to O (701). When i<4, at most only four points, that is, only three sides have been input, so the detection process ends. i″25
When , i- is written to the counter j on the RAM for cross checking.
4 is set (703). After that, the point Ti-+, T
Values A, B using the coordinates of i-z, Tj, Tj-+.

C,Dを求める(704,705,706,707)。Find C and D (704, 705, 706, 707).

値算出には次に示す関数Fを用いる。The following function F is used to calculate the value.

F(Tm 、 Tn )= −1+TXm=TXn又は
T Ym=T Ynの時0:TXm<TXnかつTYm
<TYnの時1:TXm<TXnかつTYm>TYnの
時2:TXm>TXnかつTYm>TYnの時3:TX
m>TXnかつTYm<TYnの時間数Fは2点Tm、
Tnの位置関係を5つの場合に分類して値を割りつける
もので、第8図に図解する。すなわち2点Tm、Tnか
ら生成されるベクトルTm、TnがX軸かY軸に平行な
時に値“−1”を、右上りの時“0″を、左上りの時“
1″を、左下りの時“2”を、右下りの時“3”を出力
する関数である。
F (Tm, Tn) = -1 + TXm = TXn or TYm = TYn: 0: TXm < TXn and TYm
When <TYn 1: TXm<TXn and TYm>TYn 2: TXm>TXn and TYm>TYn 3: TX
The number of hours F for m>TXn and TYm<TYn is 2 points Tm,
The positional relationship of Tn is classified into five cases and values are assigned, which is illustrated in FIG. In other words, when the vectors Tm and Tn generated from the two points Tm and Tn are parallel to the X or Y axis, the value is "-1", when it is upward to the right, it is "0", and when it is upward to the left, it is "
This is a function that outputs "1" when the direction is downward to the left, "2" when the direction is downward to the left, and "3" when downward to the right.

もし値A、 B、 C,Dの中に1つでも−1″があれ
ば辺浦;口丁可と辺T j −+ T jは接すること
はあっても交差はしないのでjを更新する(708→7
09)。
If even one of the values A, B, C, and D has -1'', update j because the sides T j −+ T j may touch but do not intersect. (708→7
09).

“−1”がなければ以下7jl〜718の様に、値A。If “-1” is not present, the value is A, as shown in 7jl to 718 below.

B、 C,Dがその順で値“0″、′1″、“2″、′
3”。
B, C, and D have the values “0”, “1”, “2”, and “0” in that order.
3”.

を昇番順もしくは降番順にローテーションした値をとる
か否かを調べる。第9図にステップ711でYESと判
定される例を挙げる。
Check whether the values are rotated in ascending or descending order. FIG. 9 shows an example in which the determination in step 711 is YES.

以下第9図の例を時計回りに90°ずつ回転させると7
12. 713. 714で“YES”と判定される4
点の位置関係となる。また第9図の例を辺T i −2
T i−+に線対称に折り返した位置関係の時ステップ
715でYESと判定され、以下反時計回りに90°ず
つ回転させて行(と各々716.717.718で“Y
ES”と判定される。以上の8つのケースでカウンタk
を1インクリメントし、辺T I −2T i −+テ
ップ710でj<Oとなる迄、チェックを続ける。
If you rotate the example in Figure 9 clockwise by 90 degrees, it will become 7.
12. 713. 714 is determined as “YES” 4
This is the positional relationship of the points. In addition, the example in FIG. 9 is expressed as side T i −2
When the positional relationship is line-symmetrically folded back to T i-+, it is determined as YES in step 715, and then the rows are rotated counterclockwise by 90 degrees (and "Y" is determined in each step 716, 717, and
ES”.In the above eight cases, the counter k
is incremented by 1, and the check is continued until the side T I -2T i -+ becomes j<O at step 710.

ステップ709でjを2デクリメントするのはlだけデ
クリメントした時の辺Tj −+ T3は辺Ti −2
Ti −1と平行である為である。
When j is decremented by 2 in step 709, the side Tj −+ T3 when decremented by l is the side Ti −2
This is because it is parallel to Ti -1.

第12図に終点処理フローを示し以下に説明する。The end point processing flow is shown in FIG. 12 and will be explained below.

まずカウンタiをチェックしく1001)、もしi<2
ならば、高々2点の入力しかない為、領域が確定しない
為(1012)再び点入力を待つべ(終了する。
First check the counter i (1001), if i<2
If so, since there are only two input points at most, the area is not determined (1012), so the process must wait for point input again (end of process).

i≧3ならばカウンタi値が最新入力点番号を示すよう
に1デクリメントする(1002)。
If i≧3, the counter i value is decremented by 1 so as to indicate the latest input point number (1002).

次に始点T。から第2点T1へのベクトルT。T。Next, start point T. vector T from to the second point T1. T.

の方向コードDoを第1O図に基づいて決定しく100
3)、同じく最新点Tiに向かう点T i−+からのベ
クトルnの方向コードD i−+も同様に決定する(1
004)。その後、第13図に示す終点処理タイプテー
ブルに従って2つの方向コードDOとDi−+及び点T
oの座標TXo、TY0及び点Tiの座標TXi。
Determine the direction code Do of 100 based on FIG.
3), the direction code D i-+ of the vector n from the point T i-+ heading toward the latest point Ti is determined in the same way (1
004). Then, according to the end point processing type table shown in FIG. 13, the two direction codes DO and Di-+ and the point T
Coordinates TXo and TY0 of o and coordinates TXi of point Ti.

TYiの4つの座標の位置関係から終点処理タイプを選
択し、表1に記載の処理内容に応じた処理を施表  1 表1に記載した各タイプ毎の処理内容による補正例を第
14図に示す。表1の処理を施してあらたに決定された
始点(Sp) Toと終点(Ep)Tiにより辺TiT
oが生成され、かつ辺r丁T及び辺Ti−rTiと直角
をなす場合は再処理の必要はないが、そうでない場合は
補正されたTo、  Ti及びiを用いて再びステップ
tool以下の処理を行う(1006→1001)。
Select the end point processing type from the positional relationship of the four coordinates of TYi and perform the processing according to the processing contents listed in Table 1. 1 Figure 14 shows an example of correction based on the processing contents of each type listed in Table 1. show. The side TiT is determined by the starting point (Sp) To and the ending point (Ep) Ti newly determined by performing the processing in Table 1.
If o is generated and is perpendicular to the sides rT and Ti-rTi, there is no need to reprocess it, but if it is not, the process below step tool is performed again using the corrected To, Ti, and i. (1006→1001).

以上の手順で領域を構成し得る各コーナーの座標を確保
した後、ToからTiまでの各点を順に結んでできる線
分が互いに交差することはないか、前述の交差検出論理
を各辺に対応させて実行しく1007)、もし1ケ所で
も交差する時は領域不確定とし再O点入力を待つかクリ
アキー人力による入力点のキャンセルを待つ(1008
→1012)。
After securing the coordinates of each corner that can constitute a region using the above procedure, apply the above-mentioned intersection detection logic to each side to check whether the line segments formed by sequentially connecting each point from To to Ti intersect with each other. Correspond and execute (1007), if even one point intersects, it is assumed that the area is uncertain and waits for the O point to be input again or for the clear key to be manually canceled (1008)
→1012).

ステップ1009においては点Toから点Tiの中でそ
のY成分が最小値を示す点の中でさらにそのX成分が最
小のものTsを領域原点としく1009)。
In step 1009, among the points from point To to point Ti whose Y component shows the minimum value, the point Ts whose X component is the smallest is set as the area origin (1009).

さらにその領域原点TsをあらためてTOとして以下新
しいToから時計回りに点列をたどってT I +T2
 + ・・・、  Ti  とあらたに付番して(10
10)、領域を確定しく1011)、領域指定を終了す
る。
Furthermore, the area origin Ts is set as TO again, and the sequence of points is traced clockwise from the new To to T I +T2
+ ..., renumber Ti (10
10), define the area (1011), and end the area specification.

ステップ1009. 1010の処理例を第11−1図
〜第11−3図に示す。
Step 1009. Processing examples of 1010 are shown in FIGS. 11-1 to 11-3.

ところで、凹凸エリアのコーナ一点を順次入力してゆく
方法の場合、変化点が各画像処理の開始の変化点である
のか終了の変化点であるのか判別がつきにくい。第16
−1図に示す凹凸エリアを指定した場合、第16−2図
に示す情報が必要となる。
By the way, in the case of the method of sequentially inputting one corner point of the uneven area, it is difficult to determine whether the change point is the start change point or the end change point of each image process. 16th
When specifying the uneven area shown in Figure 16-1, the information shown in Figure 16-2 is required.

しかし、該領域を第16−3図に示す様に3つの矩形に
分けて入力すれば、第16−2図に示す情報を即得るこ
とができる。以下、矩形の分割方法について説明する。
However, if the area is divided into three rectangles and inputted as shown in FIG. 16-3, the information shown in FIG. 16-2 can be immediately obtained. The method of dividing the rectangle will be explained below.

〔矩形分割〕[Rectangular division]

エリア別画像処理や凹凸エリアの処理を可能にするため
に、入力データを矩形の対角2端点のデータの集合に変
換する必要がある。又、省メモリの点からも、分割は最
適に行う必要がある。
In order to enable image processing by area and processing of uneven areas, it is necessary to convert input data into a set of data of two diagonal end points of a rectangle. Also, from the point of view of memory saving, it is necessary to perform the division optimally.

第17−1図に凹凸エリアを最適に分割する1つの方法
を示す。このように人間が考える場合は、垂直線もしく
は、水平線どちらか一方のみで最適分割を行える。本実
施例では垂直線で分割する方法について説明する。
FIG. 17-1 shows one method for optimally dividing an uneven area. When humans think in this way, optimal division can be performed using either vertical lines or horizontal lines. In this embodiment, a method of dividing along vertical lines will be explained.

矩−形分割処理は、第18.−1図〜第18−4図に示
すアルゴリズムに基づいて実行する。これに必要な諸量
を以下に示す。
The rectangular division process is performed in the 18th. It is executed based on the algorithms shown in Figures 1 to 18-4. The various quantities required for this are shown below.

PBXOO(入力データ)・・・入力点のY値、X値が
入力した順に入っている。これを、Y値が最小値である
線分中のX値が大き′い方の点(第17−2図に示す)
を原点とし、右回りにソートしたものである。
PBXOO (input data): Contains the Y value and X value of the input point in the order in which they were input. This is the point where the X value is larger in the line segment where the Y value is the minimum value (shown in Figure 17-2).
is the origin and sorted clockwise.

SCD  置・・・ペア点検索時に各入力点の属性(後
述)をセットする為のワークエリアである(第19−1
図、第19−2図)。尚ペア点とは分割された矩形の対
角をなす2点を示す。本実施例では16X16(byt
e)を割り当てる。
SCD location: This is a work area for setting the attributes (described later) of each input point when searching for paired points (No. 19-1)
Figure 19-2). Note that a pair of points refers to two points forming diagonal corners of a divided rectangle. In this example, 16X16 (bytes
e) Assign.

AREA  POINT  CNT・・・入力点数を表
わす。前記終点処理によって必ず偶数個である。
AREA POINT CNT...Represents the number of input points. Due to the end point processing described above, the number is always an even number.

ここで、点の属性として ・指定全点・・・入力された全ての点 ・残存指定点・・・指定全点の中で、ペア点を構成する
もの。尚、残存指定点であれば指定全点に含まれる。
Here, the attributes of the points are: - All designated points: All input points - Remaining designated points: Among all designated points, those that constitute a paired point. Note that if it is a remaining designated point, it is included in all designated points.

・新規候補点・・・凹凸エリアを構成する水平線分中で
、Y値の変化点上にあるすべての点。
・New candidate points: All points located on the Y value change points in the horizontal line segments that make up the uneven area.

・新規決定点・・・新規候補点のなかで、ペア点を構成
するもの。尚、新規決定点であれば新規候補点に含まれ
る。
・New decision points: Among the new candidate points, those that constitute paired points. Note that if it is a new decision point, it is included in the new candidate points.

以上の4つの属性を定義する。The above four attributes are defined.

のY座標をYPiとしたとき、 YPi−YPi+1>0の時、方向フラグ(PNT D
RF)を下にセットYPi−YPi+1<Oの時、方向
フラグ(PNT DRF)を上にセット方向は、方向フ
ラグを参照して決定される。
When the Y coordinate of is YPi, when YPi-YPi+1>0, the direction flag (PNT D
RF) is set downward. When YPi-YPi+1<O, the direction flag (PNT DRF) is set upward. The direction is determined with reference to the direction flag.

また、本実施例では入力可能な点の最大を30点とし、
それにより分割可能な矩形の数は15個となる。従って
、X方向、Y方向とも変化点の最大数を15とする。
In addition, in this embodiment, the maximum number of points that can be input is 30 points,
As a result, the number of rectangles that can be divided is 15. Therefore, the maximum number of changing points is set to 15 in both the X direction and the Y direction.

第18−1図〜第18−4図に示す各フローが行う各処
理を説明する。
Each process performed by each flow shown in FIGS. 18-1 to 18-4 will be explained.

にセットする。Set to .

まず、ポインタ(i)をリセットし、ポインタ詣 が前述の原点を差すようにする(2−1)。点の方向を
決定する方向フラグを上または下にセラ1− L (2
−2)、現在ポインタがある点に指定全点及び方向フラ
グに応じた方向をセットしく2−3)、現在ポインタが
ある点の次の点には、残存指定点(指定全点でもある)
及び方向フラグに応じた方向をセットする(2−4)。
First, the pointer (i) is reset so that the pointer points to the aforementioned origin (2-1). Set the direction flag that determines the direction of the point up or down to 1-L (2
-2) Set all specified points and the direction according to the direction flag to the point where the current pointer is.2-3) The point next to the point where the current pointer is located is the remaining specified point (also all specified points).
and sets the direction according to the direction flag (2-4).

さらに、上記の2点の間にY方向の変化点があるか否か
判断しく2−5)、あるならばすべての点に新規決定点
、方向をセットする(2−6)。最後に、ポインタカウ
ンタ(i)を2増加させる(2−7)。
Furthermore, it is determined whether there is a change point in the Y direction between the above two points (2-5), and if there is, a new determination point and direction are set for all points (2-6). Finally, pointer counter (i) is incremented by 2 (2-7).

以上の作業を入力点数分繰り返す(1−8)。The above operations are repeated for the number of input points (1-8).

まず、カウンタlを0にリセットしく3−1)、前述の
SCD  TBL  5ETIで新規決定点としてセッ
トされた中から同−Y値内で隣合う新規点の方向が異る
場合は、その画点を新規決定点から新規候補点に降格さ
せる(3−2)。そしてカウンタlを1つインクリメン
トする(3−3)。これをSCD  置の座標の最大値
15になるまで繰り返す(3−4)。次に再びカウンタ
lをOにクリア(3−5)する。
First, reset the counter l to 0 (3-1), and if the directions of adjacent new points within the same -Y value are different among those set as new decision points in the above-mentioned SCD TBL 5ETI, that pixel is demoted from a new decision point to a new candidate point (3-2). Then, the counter l is incremented by one (3-3). This is repeated until the maximum value of the coordinates of the SCD location reaches 15 (3-4). Next, the counter l is cleared to O again (3-5).

その後に、同−Y値内で隣合う点の属性を見た時、 ■上方向でかつ指定全点(残存指定点を含む)の次に下
方向の新規候補点がある。
After that, when looking at the attributes of adjacent points within the same -Y value, (1) there is a new candidate point in the upward direction and next to all the specified points (including the remaining specified points) in the downward direction.

■上方向でかつ新規候補点の次に下方向の指定全点(残
存指定点を含む)がある。
(2) In the upward direction and next to the new candidate point, there are all designated points (including remaining designated points) in the downward direction.

これらの場合は、新規候補点を新規決定点として再度セ
ットする(3−6)。そしてポインタlを1つインクリ
メントし、!!=15になるまで繰り返す(3−8)。
In these cases, the new candidate point is set again as a new decision point (3-6). Then increment the pointer l by one, and! ! Repeat until =15 (3-8).

(3)PAIRPOINT・SCD  TBL(7)内
容をもとにペア点を検索する。
(3) PAIRPOINT/SCD TBL (7) Search for paired points based on the contents.

「ペアを成す点は、残存指定点か新規決定点であり、上
方向の点と、その斜め右上最短距離にある下方向の点が
ペアを成す」    ”ことをペア点検索の基本原則と
する。
The basic principle of paired point search is that ``points that form a pair are remaining specified points or newly decided points, and a point in the upper direction and a point in the lower direction that is the shortest distance to the upper right of that point form a pair.'' .

尚、第18−3図、第18−4図のアルゴリズムでは、
第17−3図のような指定入力にも対処できるように、
ペア点検索°の条件を拡張し、■残存指定点か新規決定
点で、方向の異る2点が1つのペアを成す。
In addition, in the algorithms shown in Figures 18-3 and 18-4,
In order to be able to handle specified inputs as shown in Figure 17-3,
Extending the conditions for pair point search°, ■ Two points with different directions form a pair, either remaining designated points or new determined points.

■対角2点の左側の点を始点、右側を終点とすると、終
点は始点の斜め右最短距離にある。蒋同−X値では、斜
め右上の点が斜め右下の点より優先される。
■If the point on the left side of the two diagonal points is the starting point and the right side is the ending point, the ending point is the shortest distance diagonally to the right of the starting point. In the Jiang Tong-X value, the diagonally upper right point has priority over the diagonally lower right point.

この2つの条件として定義する。These two conditions are defined.

尚、Skを始点のYカウンタ、SI!を始点のXカウン
タ、Ekを終点のYカウンタ、EI!を終点のカウンタ
とする。
In addition, the Y counter with Sk as the starting point, SI! is the X counter at the start point, Ek is the Y counter at the end point, and EI! Let be the end point counter.

まず、カウンタSk、S!!をOにクリアしく4−1゜
4−2)、矩形エリアの2端点の始点の条件を持つ点を
探す(4−3)。その条件とは ■残存指定点もしくは新規決定点 ■未使用点(このペア点検索が始ってからまだ始点又は
終点として登録されていない点)であることである。
First, counter Sk, S! ! 4-1 and 4-2), and search for a point that meets the conditions for the starting point of the two end points of the rectangular area (4-3). The conditions are: 1) a remaining specified point or a newly determined point 2) an unused point (a point that has not yet been registered as a starting point or an ending point since this pair point search started).

次に、見つかった始点に対応する終点を探す(4−4)
Next, find the end point that corresponds to the found starting point (4-4)
.

終点検索の方法は、まず終点の存在するY座標を見つけ
、次にX座標を見つける。
The method of searching for the end point is to first find the Y coordinate where the end point exists, and then find the X coordinate.

始点がある位置と同じX座標値で、始点より右で(Y座
標が大きい)、最短距離の指定全点(残存指定点を含む
)か新規決定点をさがし、これを終点検索の基準点とす
る(5−3.5−12)。見つかったら基準点の位置か
らX値を1つずつ増しく5−4)、 ■未使用点である ■始点と方向が逆 ■残存指定点or新規決定点 以上の終点条件をすべて備えた点を探す(5−5)。
Search for all designated points (including remaining designated points) or a new determination point with the same X coordinate value as the position of the starting point, to the right of the starting point (larger Y coordinate), and with the shortest distance, and use this as the reference point for the end point search. (5-3.5-12). If found, increase the X value by 1 from the reference point position 5-4), ■ It is an unused point ■ The direction is opposite to the starting point ■ A point that meets all the end point conditions of remaining specified point or new determined point Search (5-5).

見つからないときは、基準点からX値を1つずつ減らし
同様に終点をさがす(5−6,5−7,5−8)。
If the end point is not found, reduce the X value by one from the reference point and search for the end point in the same way (5-6, 5-7, 5-8).

終点の条件を満たす点が見つかったときは、その点を終
点と決定して、始点と終点のX座標を入れ替える(5−
9)。さらに見つからないときは、基準点のY値を1増
やしく5−10)、先程と同じように基準点の検索から
やり直す。入力座標補正処理や終点処理が行われている
ため、1つの始点には必ず1つの終点が対応する。始点
と終点が見つかったら、この2点に仕様済のフラグをた
てて、(5−11)次のペア点を探す。
When a point that satisfies the end point conditions is found, that point is determined as the end point and the X coordinates of the start and end points are swapped (5-
9). If it is still not found, increase the Y value of the reference point by 1 (5-10) and start searching for the reference point again in the same way as before. Since input coordinate correction processing and end point processing are performed, one starting point always corresponds to one ending point. Once the starting point and ending point are found, flag these two points as specified, and (5-11) search for the next pair of points.

以上の処理を経て凹凸エリアの座標情報は、矩形の二端
点の集合に変換される。
Through the above processing, the coordinate information of the uneven area is converted into a set of two end points of a rectangle.

次に第20−1図に示すようなエリアを指定した場合を
例にして具体的に説明する。
Next, a case in which an area as shown in FIG. 20-1 is designated will be specifically explained.

第20−1図に示すリアを指定し、終点処理を行い、デ
ータ・ソートが終了した時点では、入力諸1は以下のよ
うになる。
When the rear shown in FIG. 20-1 is specified, end point processing is performed, and data sorting is completed, input items 1 will be as follows.

PBXoo・・・60,10,60,20,50,20
,50,40,70,40,70,60,60,60,
60,70,50,70,50゜50.10,50,1
0,20,20,20,20,40,40,40,40
,30,30,30,30.10AREA  POIN
T CNT・・・18これをもとに、SCD  TBL
をセットする。
PBXoo...60, 10, 60, 20, 50, 20
,50,40,70,40,70,60,60,60,
60,70,50,70,50゜50.10,50,1
0, 20, 20, 20, 20, 40, 40, 40, 40
,30,30,30,30.10AREA POIN
T CNT...18 Based on this, SCD TBL
Set.

第20−2図に第20−1図の領域をSCD  TBL
の座標に変換した様子を示しである。
SCD TBL of the area of Figure 20-1 in Figure 20-2
This figure shows how the coordinates have been converted.

第18−1図に示すSCD  TBL  5ETIが終
了した時点でのSCD  TBLの様子を第19−1図
に、又第18−2図に示すSCD  TBL  5ET
2が終了した時点でのSCD  TBLの様子を第19
−2図に示す。
Figure 19-1 shows the state of SCD TBL at the end of SCD TBL 5ETI shown in Figure 18-1, and SCD TBL 5ET shown in Figure 18-2.
The situation of SCD TBL at the end of 2 is shown in the 19th
- Shown in Figure 2.

この第19−2図に示す状態のSCD  TBLをもと
にペア点の検索を行う。
Pair points are searched based on the SCD TBL in the state shown in FIG. 19-2.

最初に(2,O) (第19−2図に示すSCD  T
BL上の座標)に始点の条件を満たす点が見つかる。
First (2, O) (SCD T shown in Figure 19-2)
A point that satisfies the starting point condition is found at the coordinates on BL).

そこで、始点の1つ右を見るとそこ(2,1)に終点を
探す為の基準点が見つかる。
Then, if you look one place to the right of the starting point, you will find the reference point for searching for the ending point there (2, 1).

次に、基準点の上方を探ってゆ(と、(5,l)に今回
の始点に対応した終点の条件を持った点がある。よって
、この2点をペアと見て登録し使用済とする。
Next, search above the reference point and find a point at (5, l) that has the conditions of the end point corresponding to the current start point.Therefore, consider these two points as a pair and register them. shall be.

再び始点の検索を開始すると、(0,l)に2つめの始
点を見つけることができ、以下先程と同じようにしてペ
ア点を見つけてゆく。
When we start searching for the starting point again, we find the second starting point at (0, l), and we continue to find paired points in the same way as before.

このようにしてベア点検索をすることにより、以下のよ
うな矩形エリア2端点データの集合が第20−1図に対
応して得られ、7つの矩形領域に分割される。
By performing the bare point search in this manner, a set of rectangular area 2 end point data as shown below is obtained corresponding to FIG. 20-1, and is divided into seven rectangular areas.

以上のように指定領域を矩形に分割することで例えば、
第20−1図の領域の場合、18点で定義されていたも
のが14点で定義されることになり、領域データの記憶
の為のメモリ容量や伝送に要する時間の節約に役立てる
。またこのように複雑に入り組んだ領域の例えばトリミ
ング処理制御も容易となる。
For example, by dividing the specified area into rectangles as described above,
In the case of the area shown in FIG. 20-1, what used to be defined by 18 points is now defined by 14 points, which helps save memory capacity for storing area data and time required for transmission. Furthermore, it is also easier to control, for example, the trimming process of such a complicated area.

第20−1図のように分割された領域を編集する為には
例えばY−30での主走査ライン上で見れば分かるよう
にX=10〜20とX=30〜50の2つの区間で、例
えばトリミング処理を行う必要があるが、このような場
合は第5図で示したカウンタ912゜913及びゲート
909. 910.915. 916.917を少なく
とも2組持てば実現できる。今2組のカウンタ912,
913をSTカウンタ1.ENカウンタl及びSTカウ
ンタ2.ENカウンタ2とすると第20−1図の領域を
トリミングする場合、光学系がy=toに達した時、S
Tカウンタlに30、ENカウンタ1に60をセットし
STカウンタ2.ENカウンタ2には同じ値をセットす
る。次に光学系がY=20に達した時、STカウンタ2
に10.  ENカウンタ2に20. ENカウンタ1
に50をセットする。
In order to edit the divided area as shown in Figure 20-1, for example, as you can see on the main scanning line at Y-30, edit the two sections of X = 10 to 20 and X = 30 to 50. For example, it is necessary to perform trimming processing, but in such a case, the counters 912, 913 and gates 909, . 910.915. This can be achieved by having at least two sets of 916.917. Now two sets of counters 912,
913 to ST counter 1. EN counter l and ST counter 2. Assuming that the EN counter is 2, when trimming the area shown in Figure 20-1, when the optical system reaches y=to, S
Set T counter l to 30, EN counter 1 to 60, and ST counter 2. The same value is set in EN counter 2. Next, when the optical system reaches Y=20, ST counter 2
10. 20. to EN counter 2. EN counter 1
Set 50 to .

さらに光学系がY=30に達した時STカウンタ1に1
0. ENカウンタlに70.カウンタ2には同じ値を
セットし、以下同様な手順でカウンタを制御すれば所望
の編集が可能となる。
Furthermore, when the optical system reaches Y=30, 1 is added to ST counter 1.
0. 70 on the EN counter. If the same value is set in counter 2 and the counters are controlled in the same manner thereafter, desired editing becomes possible.

〔効 果〕〔effect〕

以上説明したように本発明によれば、複数の矩形の組み
合わさった凹凸領域を矩形領域に分割することで、領域
データの記憶容量や伝送時間が節約でき、かつ複雑な凹
凸領域の編集が容易となる。
As explained above, according to the present invention, by dividing a concavo-convex region that is a combination of multiple rectangles into rectangular regions, it is possible to save storage capacity and transmission time of region data, and it is easy to edit a complex concavo-convex region. becomes.

また本実施例における領域の矩形分割方式は、凹凸領域
の各コーナーの座標とその方向成分をもとに高速演算処
理を可能とした。
Furthermore, the rectangular division method of the region in this embodiment enables high-speed calculation processing based on the coordinates of each corner of the uneven region and its directional component.

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

第1−1図は座標入力装置を示す図、 第1−2図は本発明を適用できる複写装置の外観図、 第2図は座標補正の例を示す図、 第3図は装置全体の概略ブロック図、 第4図は座標入力装置のブロック図、 第5図は編集に係わる処理ブロック図、第6図は入力座
標補正の制御フローチャート、第7図は交差検出の制御
フローチャート、第8図は交差検出に用いる函機Fの説
明図、第9図は交差例、 第12図は座標入力終了後の終点処理制御フローチャー
ト、 第13図は終点処理タイプテーブルを示す図、第14図
は終点処理例を示す図、 第15図はエリア編集の為のビットマップメモリーの例
を示す図、 第16−1図〜第16−3図は矩形分割の効果を示第1
8−1図〜第18−4図は矩形分割処理のフローチャー
1・、 第19−1図、第19−2図は矩形分割に用いるスケジ
ュールテーブル(SCD  TBL)を示す図、第20
−1図は矩形分割を説明するための図、第20−2図は
第20−1図の領域をスケジュールテーブルの座標に変
換した図である。 104は座標入力装置、105は座標入力用ペン、10
6は有効座標入力面、912はスタートカウンタ、91
3はエンドカウンタである。 躬2図 第7図 男!θ図 〈終立逍理タイアテーブル〉 ooooooooooooo。 ト f6(AD、)ρノ     I’2(J2.727莞
/7−バZ   ′帛/7−?7 第77−3医 莞18−3図
Fig. 1-1 is a diagram showing a coordinate input device, Fig. 1-2 is an external view of a copying machine to which the present invention can be applied, Fig. 2 is a diagram showing an example of coordinate correction, and Fig. 3 is a schematic diagram of the entire device. Block diagram: Figure 4 is a block diagram of the coordinate input device; Figure 5 is a processing block diagram related to editing; Figure 6 is a control flowchart for input coordinate correction; Figure 7 is a control flowchart for intersection detection; An explanatory diagram of the box machine F used for intersection detection, Fig. 9 is an example of an intersection, Fig. 12 is an end point processing control flowchart after coordinate input is completed, Fig. 13 is a diagram showing an end point processing type table, and Fig. 14 is an end point processing Figure 15 is a diagram showing an example of bitmap memory for area editing. Figures 16-1 to 16-3 are diagrams showing the effect of rectangular division.
8-1 to 18-4 are the flowchart 1 of rectangular division processing, FIGS. 19-1 and 19-2 are diagrams showing the schedule table (SCD TBL) used for rectangular division, and FIG.
FIG. 20-1 is a diagram for explaining rectangular division, and FIG. 20-2 is a diagram obtained by converting the area in FIG. 20-1 into schedule table coordinates. 104 is a coordinate input device; 105 is a coordinate input pen; 10
6 is a valid coordinate input surface, 912 is a start counter, 91
3 is an end counter. Figure 2 Figure 7 Man! θ Diagram〈Final Shoiri Tire Table〉 ooooooooooooooo. To f6 (AD,) ρノ I'2 (J2.727 guan/7-ba Z' 帛/7-?7 77-3 Ikuan 18-3 Fig.

Claims (4)

【特許請求の範囲】[Claims] (1)座標入力装置を有する画像処理装置において、前
記座標入力装置により、主/副各走査方向に水平/垂直
な線分で囲むように指定された閉領域を1つ又は複数の
矩形領域に分割する手段を有し、分割された矩形領域に
対して所望の処理を行うことを特徴とする領域処理方式
(1) In an image processing device having a coordinate input device, the coordinate input device converts a closed area specified to be surrounded by horizontal/vertical line segments in each main/sub scanning direction into one or more rectangular areas. An area processing method characterized by having a dividing means and performing desired processing on the divided rectangular areas.
(2)特許請求の範囲第(1)項において、前記分割手
段は前記閉領域を囲む線分の各端点座標と、端点座標を
順次結んで生成されるベクトルの方向成分に基き、分割
処理することを特徴とする領域処理方式。
(2) In claim (1), the dividing means performs dividing processing based on the coordinates of each end point of a line segment surrounding the closed region and the directional component of a vector generated by sequentially connecting the coordinates of the end points. A region processing method characterized by:
(3)特許請求の範囲第(1)項において、前記分割手
段は前記閉領域を主走査もしくは副走査のどちらか一方
に平行な線分でのみ矩形領域に分割することを特徴とす
る領域処理方式。
(3) In claim (1), the area processing is characterized in that the dividing means divides the closed area into rectangular areas only by line segments parallel to either main scanning or sub-scanning. method.
(4)特許請求の範囲第(1)項において、前記閉領域
を前記矩形領域の対角2点の座標対の集合として記憶す
る手段を有し、記憶された座標対集合にもとづき、所望
の処理を行うことを特徴とする領域処理方式。
(4) Claim (1), further comprising means for storing the closed area as a set of coordinate pairs of two diagonal points of the rectangular area, and based on the stored coordinate pair set, a desired An area processing method characterized by processing.
JP62047968A 1987-03-03 1987-03-03 Area processing method Expired - Lifetime JP2791017B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62047968A JP2791017B2 (en) 1987-03-03 1987-03-03 Area processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62047968A JP2791017B2 (en) 1987-03-03 1987-03-03 Area processing method

Publications (2)

Publication Number Publication Date
JPS63215166A true JPS63215166A (en) 1988-09-07
JP2791017B2 JP2791017B2 (en) 1998-08-27

Family

ID=12790122

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62047968A Expired - Lifetime JP2791017B2 (en) 1987-03-03 1987-03-03 Area processing method

Country Status (1)

Country Link
JP (1) JP2791017B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60114078A (en) * 1983-11-25 1985-06-20 Canon Inc Picture processing device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60114078A (en) * 1983-11-25 1985-06-20 Canon Inc Picture processing device

Also Published As

Publication number Publication date
JP2791017B2 (en) 1998-08-27

Similar Documents

Publication Publication Date Title
KR950012083B1 (en) Information processing apparatus
EP0558049B1 (en) Method and apparatus for extracting a contour of an image
JPH0728451A (en) Data conversion device
JPH06203153A (en) Method and device for processing image
JPS63215166A (en) Area processing system
JPH04328956A (en) Picture data read method
JPH10337932A (en) Print processor
JPH11242753A (en) Method and device for three-dimensional plotting
CN109101121B (en) Electromagnetic electronic whiteboard coordinate conversion method and device and readable medium
KR100266930B1 (en) Method of drawing figure such as polygon and display control device
EP0458571A2 (en) Image processing method and apparatus
JPS63214068A (en) Area designating system
JP6859781B2 (en) Image processing equipment, image processing methods and programs
KR920005242B1 (en) Image processing apparatus
JP2004164549A (en) Image processing apparatus, image processing method, and program for executing the method
JPH01177272A (en) Picture processor
JP2768370B2 (en) Drawing method
JP6631939B2 (en) Image processing apparatus, image forming system, and program
JPH0816822A (en) Three-dimensional moving picture generation method
JPH08138040A (en) Method and device for plotting picture
JP2017154395A (en) Information processing device, image processing device, and information processing method
JP2000298729A (en) Two-dimensional image generation device
JP3124562B2 (en) Image forming control device and image forming device
JP2814709B2 (en) Drawing data creation device
JP3026093B2 (en) Image correction method and apparatus

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term