JP2791017B2 - Area processing method - Google Patents

Area processing method

Info

Publication number
JP2791017B2
JP2791017B2 JP62047968A JP4796887A JP2791017B2 JP 2791017 B2 JP2791017 B2 JP 2791017B2 JP 62047968 A JP62047968 A JP 62047968A JP 4796887 A JP4796887 A JP 4796887A JP 2791017 B2 JP2791017 B2 JP 2791017B2
Authority
JP
Japan
Prior art keywords
point
area
input
points
counter
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.)
Expired - Lifetime
Application number
JP62047968A
Other languages
Japanese (ja)
Other versions
JPS63215166A (en
Inventor
敏之 北村
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)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は画像処理装置における座標入力装置により入
力された領域の処理方法に関する。 〔従来技術〕 従来、領域を指定する方法の1つに矩形の領域を対角
線上の2端点をもって指定する方法や、さらに指定する
領域が矩形を組み合せた形(以後凹凸エリアと呼ぶ)と
し、そのコーナー点を順次入力する方法がある。 この様な入力方法においては領域の水平方向及び垂直
方向の変化点を境界とし、画像処理内容を切り換えてゆ
く方法が用いられている。 しかしながら、複数の矩形が複雑に組み合わさった領
域に対して画像処理することは困難であった。 〔発明が解決しようとしている問題点〕 そこで複雑な形状の領域に対して画像処理を行う方法
として編集作業用のビツトマツプメモリーを持つ方法が
考えられる。これは第15図の様に画像読取領域に対応さ
せたメモリ上へ、指定された領域の内部を書き込んでゆ
き、このビツトマツプメモリーを参照しながら、出力の
制御を行う。この方法だと、異なる画像処理を行う複数
領域の処理が容易に行える利点がある。しかし反面、ビ
ツトマツプメモリーに必要なメモリ容量が非常に大きい
という欠点がある。1例として、A4(296×210)の画像
領域を分解能0.5mm×0.5mmで1個の画像処理を行おうと
すると、約25万bit必要とする。又、この処理をリアル
・タイムに処理することも困難である。 〔目 的〕 本発明は上記の点に鑑みなされたもので、複雑な形状
の指定領域に対しても容易に画像処理を行えるととも
に、その領域を少ない容量のメモリで記憶可能にする領
域処理方法を提供することを目的とするものである。 即ち、本発明は、座標入力装置により主/副各走査方
向に水平/垂直な線分で囲まれる様に指定される、矩形
とは異なる閉領域に所望の処理を行う画像処理装置の領
域処理方法において、指定された矩形とは異なる閉領域
の複数のコーナーの座標を記憶し、記憶された複数のコ
ーナーの座標に基づいて上記閉領域を複数の矩形領域に
分割し、分割された複数の矩形領域を表わす座標を発生
する領域処理方法にある。 〔実施例〕 以下図面を参照して本発明の一実施例を詳細に説明す
る。 第1−2図は本発明を適用できる複写装置の外観図で
ある。原稿読取部101は不図示の原稿台ガラス、照明ラ
ンプとミラーから成る2:1光学系、レンズ、CCD等を有
し、前記光学系が副走査しつつ原稿像を光電変換し電気
信号として出力する。プリント部102はいわゆるレーザ
ープリンターで、読取部101から電気信号を受け、変調
されたレーザビームにより感光体上を走査して電気写真
方式にてプリントする。読取部101は操作部103、原稿押
えを兼ねた座標入力装置104、座標入力ペン105を有す
る。第1−1図に座標入力装置104を上側から見た図を
示す。106は有効座標入力面、107は原稿114を入力面に
載置する為の突き当て基準点、108は領域指定を行う旨
を入力する領域指定キー、109は一連の入力座標をキヤ
ンセルするクリアキー、110は領域指定の入力を終了す
るOKキー、111は指定領域のみを出力するトリミングモ
ード選択キー、112は指定領域のみを消去するマスキン
グモード選択キー、113は指定領域内部をその外部と異
なる処理で出力する画像分離モード選択キーである。 これらの操作例を説明する。 オペレータは図示の如く、原稿114を基準点107に突き
当てて載置し、キー108により領域指定モードに入り、
入力ペン105によって例えば点線で囲まれる領域の黒丸
で示す各コーナーを右回り或いは左回りで順次入力後OK
キー110を押して入力を完了する。その後、指定領域に
対して施すべき処理内容を111,112,113の各キーにより
指示する。 第3図に本実施例の複写装置の概略ブロツク図を示
す。302は画像読取部である。画像読取部302はCCD、信
号増巾回路、A/D変換回路、シエーデイング補正回路を
有し補正後の信号が画像処理部303に入力される。 画像処理部303ではシフトメモリに画信号を一旦蓄積
後、変倍、移動、トリミング/マスキング濃度変換等の
画像処理を施し、その結果がVIDEO信号として外部ユニ
ツト312へ出力される。外部ユニツト312は本実施例では
いわゆるレーザープリンタを想定しているが、電子フア
イルやフアクシミリ等のコントローラ及びメモリ装置で
も良い。外部ユニツトとはケーブル313を介して画信号V
IDEO以外に例えば複数の信号像から成るシリアル信号線
SRALによりシリアル信号を行い、システム全体を制御す
る。外部ユニツト312がレーザープリンターの時はプリ
ンタから水平同期信号BDを受け、クロツクジエネレータ
304により内部動作の為のクロツクを生成し前述の読取
部302や処理部303に与える。 CPU301は制御プログラムや制御データを格納したROM3
05、処理データ等を記憶するためのRAM306、タイマー回
路307を有し、前述の読取部302、処理部303、外部ユニ
ツト312との通信を制御する他に原稿照明の為の蛍光灯
ドライバ回路309や光学系駆動の為のモータードライバ
回路308、及び操作部311や座標入力装置310を制御す
る。 第4図に座標入力装置310のブロツク図を示す。 タイミング回路402は内蔵された発振器によりクロツ
クを発生させ、アドレスカウンタ403に与える。アドレ
スカウンタ403はペン412に内蔵されたスイツチが押下さ
れている間、カウト動作する。カウント動作中はまずX
デコーダ409が動作し、パルス電圧を順次入力面411のX
方向電極に2巡ダイナミツクスキヤンし、その後Yデコ
ーダ410が動作し同じくパルス電圧を順次入力面411のY
方向電極に2巡ダイナミツクスキヤンする。入力面411
上でペンのスイツチがONされると、X方向、Y方向のス
キヤンがペン位置へ達した時に静電容量結合によりペン
内に電圧が誘起され、ペン入力信号が得られ、アンプ40
4により増幅される。X方向スキヤン1巡目のペン入力
信号によりカウント値がXレジスタ406にセツトされ、
2巡目スキヤン時のペン入力信号によりXレジスタ406
の内容とカウント値を比較器405により比較して、一致
すれば一致信号がCPU401に出力される。同様にY方向に
ついても1巡目スキヤン時Yレジスタ408がセツトさ
れ、2巡目スキヤン時比較器407で比較して一致してい
れば一致信号がCPU401に出力されて、CPU401は2つの一
致信号が得られた時X,Y各レジスタから座標値を取り込
み、メインCPU301に対して例えばシリアル通信により通
知できる。尚、Xレジスタ406とカウンタ値とが一致し
ないときは入力無効と判断される。Y方向も同様であ
る。 第5図に、画像処理部303の内部、特にシフトメモリ
に係る回路図を示す。尚、シフト・メモリには2ライン
分のシフト・メモリが設けられるが、その制御は共通な
ので、第5図には一方のシフト・メモリに関してのみ、
その制御構成を示す。ライトアドレスカウンタ904はシ
フトメモリ907にデータを書込む時のアドレスカウンタ
で、リードアドレスカウンタ905はシフトメモリ907から
データを読み出す時のアドレス・カウンタである。アド
レスセレクタ906はCPU301からの指令をI/Oポート901を
介して受けてライトアドレスカウンタ904のアドレス信
号とリードアドレスカウンタ905のアドレス信号のいず
れかを選択し、シフトメモリ907をアドレッシングする
ためのものである。I/Oレジスタ902,903はライトアドレ
スカウンタ904、リードアドレスカウンタ905にそれぞれ
プリセツト値をCPU301が与えるためのレジスタである。 ライトアドレスカウンタ904、リードアドレスカウン
タ905は共にダウンカウンタでそれぞれにカウント動作
の開始を指令するWST信号及びRST信号が入力され、ま
た、シフトメモリ907への書込みクロツクWCLKとシフト
メモリからの読出しクロツクRCLKが入力される。 915,916は画像領域を決定する為の排他オアゲート、
信号OFはそれを制御する信号で、1の時STカウンタ91
2、ENカウンタ913で決まる枠内をマスクし、枠外を出力
画像とし、0の時枠内を出力画像とし枠外をマスクす
る。 910はシフトメモリ907から出力され濃度処理部908を
経て2値信号となった画像データを出力制御するアンド
ゲート、917は前述のマスク部分を白として出力するか
黒として出力するかを決定するアンドゲートで、BBはそ
れを制御する信号で1の時黒、0の時白を出力する。 911はゲート910,917により出力される画像出力をVIDE
Oとして出力するオアゲート、909は画像データを白黒反
転制御する排他オアゲート、INはそれを制御する信号で
1の時オリジナル通りの画像で、0の時は反転させる。
各信号は、CPU301がオペレータの指定したモードにより
出力する。 STカウンタ912及びENカウンタ913は各々決められた領
域のみに画像を出力するためのスタートビツトカウンタ
及びエンドビツトカウンタで、これらには、I/Oを介し
てOPU301がゲートの為のカウントデータをプリセツトす
る。 フリツプフロツプ914はSTカウンタ912のカウントアツ
プでセツトされ、ENカウンタ913のカウントアツプでリ
セツトされる。 例えばOF信号が1の場合STカウンタ912のカウントア
ツプでF/F914のQが1となるゲート915の出力が0とな
って、ENカウンタ913がカウントアツプする迄ゲート910
の出力はなく、マスクされる。かわりにゲート916の出
力はその間1なのでBB信号が1の時ゲート917は1であ
り、ゲート911は1を出力し、黒マスクとなる。逆にOF
=1,BB=0の時は白マスクされる。又OF=0とするとゲ
ート915,916の出力が各々その間1,0となるのでBB=1の
時はトリミング領域外が黒、OF=0,BB=0の時はトリミ
ング領域外が白となる。 さて本実施例は、以上述べた手段を用いて、矩形もし
くは矩形を組み合わせた領域に対してトリミングやマス
キング等の編集処理を行う場合に有効である。 矩形もしくは矩形の組み合わせ領域とは主/副各走査
軸に平衡もしくは垂直な線分によってのみ囲まれる領域
の事であり、編集の対象をこのような領域に限定する事
は充分実用的であり、かつ大容量メモリを用いることな
く、低コストで編集機能を提供できるという点において
有用である。 このような限定にもとづいてオペレータは所望の領域
を囲むように離散的に座標を入力し、かつそれらの座標
を入力順に結んだ線分が主/副各走査軸に対して極力水
平もしくは垂直になるように入力するものとする。 しかしながら現実にはフリーハンドによるペン入力に
より水平、垂直に結ばれる2点を入力することは、座標
入力装置の実用的な分解能から見て不可能である為、以
下のような手順でオペレータの入力座標を補正する。 第2図に本実施例による領域指定方式の概略例を図示
する。 まず、すでに設定されている座標を全てクリアする
為、クリアキーを押す。 第1点P1(PX1,PY1)を入力する。 第2点P2(PX2,PY2)を入力する。この時、 |PX2−PX1|と|PY2−PY1|を比較して、 |PX2−PX1|>|PY2−PY1|だから入力点P2を図示の如く
T2(TX2,TY2)=(PX2,PY1)に補正する。 第3点P3(PX3,PY3)を入力する。この時、補正済第
2点T2と第3点P3から|PX3−TX2|<|PY3−TY2|となる
故、図示の如くP3をT3(TX3,TY3)=(PX2,PY3)の様に
補正する。 第4点P4(PX4,PY4)も補正済第3点T3と比較してT4
(TX4,TY4)=(PX4,PY3)と補正する。以下同様に、 第5点P5(PX5,PY5)はT5(TX5,TY5)=(PX4,PY5
へと 第6点P6(PX6,PY6)はT6(TX6,TY6)=(PX6,PY5
へと補正する。 所望の領域の各コーナーの入力が完了したらOKキーを
押す。 OKキーが入力されたら第1点P1(PX1,PY1)と補正済
最終点T6=(TX6,TY6)=(PX6,PY5)から後述の終点処
理により第1点P1(X1,Y1)をT1(TX1,TY1)=(PX6,PY
1)へと補正する。 以上の手順で入力座標を補正制御することでオペレー
の所望の領域を垂直線分及び垂直線分で構成することが
できる。 第6図に前述の補正処理の詳細なフローチヤートを示
す。まず入力座標点数を示すRAM上のカウンタiを0ク
リアする(601)。座標入力があれば(602)、そのX成
分をRAM上のエリアPXi,TXiにY成分を同じくPYi,TYiに
セツトする(603)。i=0つまり1点目ならば(60
4)、2点目入力を待つべく、カウンタiをインクリメ
ントする(615)。i≧1ならば(604)、1点前の補正
済座標(TXi-1,TYi-1)と今回の入力座標(PXi,PYi)の
X,Y成分毎の差分の絶対値α、βを求める(605)。 オペレータは各点を結ぶ線分が極力軸に対して水平、
垂直になるよう入力するという前提に基づいてαとβの
大小比較を行う(606)。α<βならばオペレータがY
軸に平行になる様座標入力しようとしたと判定して注目
点PiのY座標PYiをそのままTYiとして採用し、X座標PX
iはキヤンセルして一点前のX座標TXi-1をTXiとして採
用する(608)。逆にα/βならばオペレータがX軸に
平衡になる様、座標入力を行ったと判定して注目点Piの
X座標PXiはそのままTXiとして採用し、Y座標PYiはキ
ヤンセルし一点前のY座標TYi-1をTYiとして採用する
(607)。607,608の補正により入力点PiはTiに補正さ
れ、線分 がX線もしくはY軸に平行になった後、次に線分 とその一本前の線分 が直交するか否か調べる。i=1ならば線分は1本しか
生成されないので第3点入力を待つべくカウンタiを1
インクリメントする(609,610,615)。i≧2ならばTXi
-2=TXiすなわち注目の2線分がY軸に平行な同一線分
上にあるか否か(612)もしくはTYi-2=TYiすなわち注
目する2線分がX軸に平行な同一線分上にあるか否か
(611)を調べ、もしNOならば次の入力を待つべくカウ
ンタiを1インクリメント(615)。もしYESならばこれ
ら2線分を1線分にまとめるべく なる和ベクトルをあらためて と置きかえる(613,614)。つまり1点前の入力Ti-1
キヤンセルしTiをTi-1として扱い、再びTi入力を待つ
為、カウンタiをインクリメントせず、次の座標を待
つ。新たな入力を待つべくカウンタiをインクリメント
した後、最新の入力点Ti-1により生成された線分 がそれ迄に入力された全ての線分 と何回交差するか否かをチエツクする(616)。その詳
細フローは後述する。 交差検出の結果全く交差しない時は次の座標入力を待
つ(617,602)。2回以上交差するようならばTi-1を無
効入力とし、再入力を待つべくカウンタiを1デクリメ
ントする(617→619)。1回だけ交差する場合は少なく
とも閉領域が1つ生成されたため、領域指定を終了する
為のOKキー入力もしくは点Ti-1をキヤンセルする為のク
リアキー入力を待つ。もしクリアキー入力があればカウ
ンタiを1デクリメントし再入力を待つ(618→619)。
もしOKキー入力があれば後述の終点処理に進む(62
4)。 ステツプ602において座標入力がない時、クリアキー
入力があれば、最新の入力点Ti-1をキヤンセルして再入
力を待つ為カウンタiを1デクリメントする(623)。O
Kキー入力があれば(624)後述の終点処理に進む(62
4)。終点処理の結果領域が確定したら終了し、未確定
ならば再び座標入力もしくはクリアキー入力を待つ。 第7図に交差検出の制御フローを示し、以下に説明す
る。まず交差回数を示すRAM上のカウンタkを0クリア
する(701)。i<4の時は高々4点つまり3辺しか入
力されていないので検出処理を終了する。i5の時は
交差チエツクの為のRAM上のカウンタjにi−4をセツ
トする(703)。その後、点Ti-1,Ti-2,Tj,Tj-1の座標を
用いて値A,B,C,Dを求める(704,705,706,707)。値算出
には次に示す関数Fを用いる。 F(Tm,Tn)=−1:TXm=TXn又はTYm=TYnの時 0:TXm<TXnかつTYm<TYnの時 1:TXm<TXnかつTYm=>Ynの時 2:TXm>TXnかつTYm>TYnの時 3:TXm=TXnかつTYm<TYnの時 関数Fは2点Tm,Tnの位置関係を5つの場合に分類し
て値を割りつけるもので、第8図に図解する。すなわち
2点Tm,Tnから生成されるベクトル がX軸かY軸に平行な時に値“−1"を、右上りの時“0"
を、左上りの時“1"を、左下りの時“2"を、右下りの時
“3"を出力する関数である。 もし値A,B,C,Dの中に1つでも“−1"があればは接することはあっても交差はしないのでjを更新する
(708→709)。“−1"がなければ以下711〜718の様に、
値A,B,C,Dがその順で値“0",“1",“2",“3",を昇番順
もしくは降番順にローテーシヨンした値をとるか否かを
調べる。第9図にステツプ711でYESと判定される例を挙
げる。 以下第9図に例を時計回りに90゜ずつ回転させると71
2,713,714で“YES"と判定される4点の位置関係なる。
また第9図の例を に線対称に折り返した位置関係の時ステツプ715でYESと
判定され、以下反時計回りに90゜ずつ回転させて行くと
各々716,717,718で“YES"と判定される。以上の8つの
ケースで交差すると判断された時、ステツプ719で交差
回数カウンタkを1インクリメントし、 が交差した を特定するカウンタ値j−1をlにセツトする。ステツ
プ709でjを更新し、ステツプ710でj<0となる迄、チ
エツクを続ける。 ステツプ709でjを2デクリメントするのは1だけデ
クリメントした時の と平行である為である。 第12図に終点処理フローを示し以下に説明する。 まずカウンタiをチエツクし(1001)、もしi<2な
らば、高々2点の入力しかない為、領域が確定しない為
(1012)再び点入力を待つべく終了する。i3ならば
カウンタi値が最新入力点番号を示すように1デクリメ
ントする(1002)。 次に始点T0から第2点T1へのベクトル の方向コードDoを第10図に基づいて決定し(1003)、同
じく最新点Tiに向かう点Ti-1からのベクトル の方向コードDi-1も同様に決定する(1004)。その後、
第13図に示す終点処理タイプテーブルに従って2つの方
向コードDoとDi-1及び点Toの座標TX0,TY0及び点Tiの座
標TXi,TYiの4つの座標と位置関係から終点処理タイプ
を選択し、表1に記載の処理内容に応じた処理を施す
(1005)。 表1に記載した各タイプ毎の処理内容による補正例を
第14図に示す。表1の処理を施してあらたに決定された
始点(Sp)Toと終点(Ep)Tiにより辺▲▼が生
成され、かつ辺▲▼及び辺 と直角をなす場合は再処理の必要はないが、そうでない
場合は補正されたTo,Ti及びiを用いて再びステツプ100
1以下の処理を行う(1006→1001)。 以上の手順で領域を構成し得る各コーナーの座標を確
保した後、ToからTiまでの各点を順に結んでできる線分
が互いに交差することはないか、前述の交差検出論理を
各辺に対応させて実効し(1007)、もし1ヶ所でも交差
する時は領域不確定とし再び点入力を待つかクリアキー
入力による入力点のキヤンセルを待つ(1008→1012)。 ステツプ1009においては点Toから点Tiの中でそのY成
分が最小値を示す点の中でさらにそのX成分が最小のも
のTsを領域原点とし(1009),さらにその領域原点Tsを
あらためてToとして以下新しいToから時計回りに点列を
たどってT1,T2,…,Tiとあらたに付番して(1010),領
域を確定し(1011),領域指定を終了する。 ステツプ1009,1010の処理例を第11−1図〜第11−3
図に示す。 ところで、凹凸エリアのコーナー点を順次入力してゆ
く方法の場合、変化点が各画像処理の開始の変化点であ
るのか終了の変化点であるのか判別がつきにくい。第16
−1図に示す凹凸エリアを指定した場合、第16−2図に
示す情報が必要となる。しかし、該領域を第16−3図に
示す様に3つの矩形に分けて入力すれば、第16−2図に
示す情報を即得ることができる。以下、矩形の分割方法
について説明する。 〔矩形分割〕 エリア別画像処理や凹凸エリアの処理を可能にするた
めに、入力データを矩形の対角2端点のデータの集合に
変換する必要がある。又、省メモリの点からも、分割は
最適に行う必要がある。 第17−1図に凹凸エリアを最適に分割する1つの方法
を示す。このように人間が考える場合は、垂直線もしく
は、水平線どちらか一方のみで最適分割を行える。本実
施例では垂直線で分割する方法について説明する。 矩形分割処理は、第18−1図〜第18−4図に示すアル
ゴリズムに基づいて実行する。これに必要な諸量を以下
に示す。 PBXOO(入力データ)…入力点のY値,X値が入力した順
に入っている。これを、Y値が最小値である線分中のX
値が大きい方の点(第17−2図に示す)を原点とし、右
回りにソートしたものである。 SCD TBL…ペア点検索時に各入力点の属性(後述)をセ
ツトする為のワークエリアである(第19−1図,第19−
2図)。尚ペア点とは分割された矩形の対角をなす2点
を示す。本実施例では16×16(byte)を割り当てる。 AREA POINT CNT…入力点数を表わす。前記終点処理に
よって必ず偶数個である。 ここで、点の属性として ・指定全点…入力された全ての点 ・残存指定点…指定全点の中で、ペア点を構成するも
の。尚、残存指定点であれば指定全点に含まれる。 ・新規候補点…凹凸エリアを構成する水平線分中で、Y
値の変化点上にあるすべての点。 ・新規決定点…新規候補点のなかで、ペア点を構成する
もの。尚、新規決定点であれば新規候補点に含まれる。 以上の4つの属性を定義する。 更に、点の方向を以下の様に定義する。 現在ポインタのある点(指定全点)をPiとし、PiのY
座標をYPiとしたとき、 YPi−YPi+1>0の時、方向フラグ(PNT DRF)を下
にセツト YPi−YPi+1<0の時、方向フラグ(PNT DRF)を上
にセツト 方向は、方向フラグを参照して決定される。 また、本実施例では入力可能な点の最大を30点とし、
それにより分割可能な矩形の数は15個となる。従って、
X方向,Y方向とも変化点の最大数を15とする。 第18−1図〜第18−4図に示す各フローが行う各処理
を説明する。 (1)SCD TBL SET1…入力データに基き、指定全点、
残存指定点、新規決定点をSCD TBLにセツトする。 まず、ポインタ(i)をリセツトし、ポインタが前述
の原点を指すようにする(2−1)。点の方向を決定す
る方向フラグを上または下にセツトし(2−2)、現在
ポインタがある点に指定全点及び方向フラグに応じた方
向をセツトし(2−3)、現在ポインタがある点の次の
点には、残存指定点(指定全点でもある)及び方向フラ
グに応じた方向をセツトする(2−4)。さらに、上記
の2点の間にY方向の変化点があるか否か判断し(2−
5)、あるならばすべての点に新規決定点、方向をセツ
トする(2−6)。最後に、ポインタカウンタ(i)を
2増加させる(2−7)。 以上の作業を入力点数分繰り返す(2−8)。 (2)SCD TBL SET2…前記のSCD TBL SET1でセツト
した新規決定点の中で矩形分割に不要な点を新規候補点
とし格下げする。 まず、カウンタlを0にリセツトし(3−1)、前述
のSCD TBL SET1で新規決定点としてセツトされた中か
ら同一Y値内で隣合う新規点の方向が異る場合は、その
両点を新規決定点から新規候補点に降格させる(3−
2)。そしてカウンタlを1つインクリメントする(3
−3)。これをSCD TBLの座標の最大値15になるまで繰
り返す(3−4)、次に再びカウンタlを0にクリア
(3−5)する。 その後に、同一Y値内で隣合う点の属性を見た時、 上方向でかつ指定全点(残存指定点を含む)の次に下
方向の新規候補点がある。 上方向でかつ新規候補点の次に下方向の指定全点(残
存指定点を含む)がある。 これらの場合は、新規候補点を新規決定点として再度
セツトする(3−6)。そしてポインタlを1つインク
リメントし、l=15になるまで繰り返す(3−8)。 (3)PAIR POINT…SCD TBLの内容をもとにペア点を
検索する。 『ペアを成す点は、残存指定点か新規決定点であり、
上方向の点と、その斜め右上最短距離にある下方向の点
がペアを成す』 ことをペア点検索の基本原則とする。 尚、第18−3図,第18−4図のアルゴリズムでは、第
17−3図のような指定入力にも対処できるように、ペア
点検索の条件を拡張し、 残存指定点か新規決定点で、方向の異る2点が1つの
ペアを成す。 対角2点の左側の点を始点、右側を終点とすると、終
点は始点の斜め右最短距離にある。但し、同一X値で
は、斜め右上の点が斜め右下の点より優先される。 この2つの条件として定義する。 尚、Skを始点のYカウンタ、Slを始点のXカウンタ、
Ekを終点のYカウンタ、Elを終点のカウンタとする。 まず、カウンタSk,Slを0にクリアし(4−1,4−
2)、矩形エリアの2端点の始点の条件を持つ点を探す
(4−3)。その条件とは 残存指定点もしくは新規決定点 未使用点(このペア点検索が始ってからまだ始点又は
終点として登録されていない点) であることである。 次に、見つかった始点に対応する終点を探す(4−
4)。 終点検索の方法は、まず終点の存在するY座標を見つ
け、次にX座標を見つける。 始点がある位置と同じX座標値で、始点よりも右で
(Y座標が大きい)、最短距離の指定全点(残存指定点
を含む)か新規決定点をさがし、これを終点検索の基準
点とする(5−3,5−12)。見つかったら基準点の位置
からX値を1つずつ増し(5−4)、 未使用点である。 始点と方向が逆 残存指定点or新規決定点 以上の終点条件をすべて備えた点を探す(5−5)。
見つからないときは、基準点からX値を1つずつ減らし
同様に終点をさがす(5−6,5−7,5−8)。終点の条件
を満たす点が見つかったときは、その点を終点と決定し
て、始点と終点のX座標を入れ替える(5−9)。さら
に見つからないときは、基準点のY値を1増やし(5−
10)、先程と同じように基準点の検索からやり直す。入
力座標補正処理や終点処理が行われているため、1つの
始点には必ず1つの終点が対応する。始点と終点が見つ
かったら、この2点に仕様済のフラグをたてて、(5−
11)次のペア点を探す。 以上の処理を経て凹凸エリアの座標情報は、矩形の二
端点の集合に変換される。 次に第20−1図に示すようなエリアを指定した場合を
例にして具体的に説明する。 第20−1図に示すエリアを指定し、終点処理を行い、
データ・ソートが終了した時点では、入力諸量は以下の
ようになる。 PBXOO…60,10,60,20,50,20,50,40,70,40,70,60,60,60,6
0,70,50,70,50,50,10,50,10,20,20,20,20,40,40,40,40,
30,30,30,30,10 AREA POINT CNT…18 これをもとに、SCD TBLをセツトする。 第20−2図に第20−1図の領域をSCD TBLの座標に変
換した様子を示してある。 第18−1図に示すSCD TBL SET1が終了した時点での
SCD TBLの様子を第19−1図に、又第18−2図に示すSC
D TBL SET2が終了した時点でのSCD TBLの様子を第19
−2図に示す。 この第19−2図に示す状態のSCD TBLをもとにペア点
の検索を行う。 最初に(2,0)(第19−2図に示すSCD TBL上の座
標)に始点の条件を満たす点が見つかる。 そこで、始点の1つ右を見るとそこ(2,1)に終点を
探す為の基準点が見つかる。 次に、基準点の上方を探ってゆくと、(5,1)に今回
の始点に対応した終点の条件を持った点がある。よっ
て、この2点をペアと見て登録し使用済とする。 再び始点の検索を開始すると、(0,1)に2つめの始
点を見つけることができ、以下先程と同じようにしてペ
ア点を見つけてゆく。 このようにしてペア点検索をすることにより、以下の
ような矩形エリア2端点データの集合が第20−1図に対
応して得られ、7つの矩形領域に分割される。 以上のように指定領域を矩形に分割することで例え
ば、第20−1図の領域の場合、18点で定義されていたも
のが14点で定義されることになり、領域データの記憶の
為のメモリ容量や伝送に要する時間の節約に役立てる。
またこのように複雑に入り組んだ領域の例えばトリミン
グ処理制御も容易となる。 第20−1図のように分割された領域を編集する為には
例えばY=30での主走査ライン上で見れば分かるように
X=10〜20とX=30〜50の2つの区間で、例えばトリミ
ング処理を行う必要があるが、このような場合は第5図
で示したカウンタ912,913及びゲート909,910,915,916,9
17を少なくとも2組持てば実現できる。今2組のカウン
タ912,913をSTカウンタ1,ENカウンタ1及びSTカウンタ
2,ENカウンタ2とすると第20−1図の領域をトリミング
する場合、光学系がY=10に達した時、STカウンタ1に
30、ENカウンタ1に60をセツトしSTカウンタ2,ENカウン
タ2には同じ値をセツトする。次に光学系がY=20に達
した時、STカウンタ2に10,ENカウンタ2に20,ENカウン
タ1に50をセツトする。さらに光学系がY=30に達した
時STカウンタ1に10,ENカウンタ1に70,カウンタ2には
同じ値をセツトし、以下同様な手順でカウンタを制御す
れば所望の編集が可能となる。 〔効 果〕 以上説明したように本発明によれば、座標入力装置に
より主/副各走査方向に水平/垂直な線分で囲まれる様
に指定される、矩形とは異なる閉領域の複数のコーナー
の座標を記憶し、記憶された複数のコーナーの座標に基
づいて上記閉領域を複数の矩形領域に分割し、分割され
た複数の矩形領域を表わす座標を発生することにより、
直角多角形の複雑な指定領域に対しても容易に画像処理
を行うことができ、また、ビットマップメモリのような
大容量メモリを用いずとも、複雑な形状の指定領域の座
標を記憶すること可能となる。
DETAILED DESCRIPTION OF THE INVENTION [Industrial applications]   The present invention is applied to a coordinate input device in an image processing apparatus.
The method relates to a method of processing a force area. (Prior art)   Conventionally, one of the methods to specify an area is to set a rectangular area diagonally
How to specify with two end points on the line, and further specify
When the area is a combination of rectangles (hereinafter referred to as uneven areas)
Then, there is a method of sequentially inputting the corner points.   In such an input method, the horizontal and vertical
Switch the image processing content with the direction change point as the boundary.
Method is used.   However, the complex combination of multiple rectangles
It was difficult to perform image processing on the area. [Problems to be solved by the invention]   Therefore, a method of performing image processing on an area with a complicated shape
As a way to have bitmap memory for editing work
Conceivable. This corresponds to the image reading area as shown in FIG.
Write the contents of the specified area to the
While referring to this bitmap memory,
Perform control. With this method, multiple images that perform different image processing
There is an advantage that the area can be easily processed. But on the other hand,
Extremely large memory capacity required for Tsutmap memory
There is a disadvantage that. As an example, an image of A4 (296 x 210)
To process a single image with a resolution of 0.5 mm x 0.5 mm in the area
Then, about 250,000 bits are needed. Also, this process is real
・ It is difficult to process in time. 〔Purpose〕   The present invention has been made in view of the above points, and has a complicated shape.
Image processing can be easily performed on the designated area
To make the area storable with a small amount of memory.
It is an object to provide an area processing method.   That is, the present invention provides a main / sub scanning method using a coordinate input device.
Rectangle specified to be surrounded by horizontal / vertical segments
Area of the image processing device that performs desired processing on a closed area different from
In the area processing method, a closed area different from the specified rectangle
Memorize the coordinates of the plurality of corners of the
Into a plurality of rectangular areas based on the coordinates of the
Divide and generate coordinates representing multiple divided rectangular areas
In the area processing method. 〔Example〕   Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
You.   FIG. 1-2 is an external view of a copying apparatus to which the present invention can be applied.
is there. The original reading unit 101 includes an original platen glass (not shown) and an illumination lamp.
2: 1 optical system consisting of pump and mirror, lens, CCD, etc.
The optical system photoelectrically converts the original image while performing sub-scanning, and
Output as a signal. The print unit 102 is a so-called laser
-The printer receives the electric signal from the reading unit 101 and modulates it.
Electrophotography by scanning the photoreceptor with the laser beam
Print by method. The reading unit 101 is an operation unit 103,
A coordinate input device 104 and a coordinate input pen 105
You. FIG. 1-1 shows a diagram of the coordinate input device 104 viewed from above.
Show. 106 is the effective coordinate input surface, 107 is the original 114 as the input surface
Abutment reference point for placing, 108 is to specify the area
Key is used to input a series of input coordinates.
Clear key 110 to cancel input of area designation
OK key, 111 is a trimming mode that outputs only the specified area
Mode selection key, 112 is a maskin that erases only the specified area
Key 113 selects the inside of the designated area from the outside.
Is an image separation mode selection key output in the following processing.   Examples of these operations will be described.   The operator pushes the document 114 to the reference point 107 as shown.
Touch and place, enter the area designation mode by key 108,
For example, the black circle in the area surrounded by the dotted line by the input pen 105
Enter each corner clockwise or counterclockwise and then OK
Press key 110 to complete the entry. Then, in the designated area
The contents of processing to be performed on each key are 111, 112 and 113.
To instruct.   FIG. 3 is a schematic block diagram of the copying apparatus according to the present embodiment.
You. Reference numeral 302 denotes an image reading unit. The image reading unit 302 is a CCD,
Signal amplification circuit, A / D conversion circuit, and shading correction circuit
The corrected signal is input to the image processing unit 303.   The image processing unit 303 temporarily stores the image signal in the shift memory
After that, zooming, moving, trimming / masking density conversion, etc.
Performs image processing and outputs the result as an external unit as a VIDEO signal.
It is output to the title 312. The external unit 312 is used in this embodiment.
A so-called laser printer is assumed, but electronic
Controllers and memory devices such as files and fax machines
Is also good. External unit is connected to image signal V via cable 313.
Other than IDEO, for example, a serial signal line consisting of multiple signal images
Performs serial signal by SRAL and controls the entire system
You. Preset when the external unit 312 is a laser printer
Receives the horizontal synchronizing signal BD from the
Clock for internal operation is generated by 304 and read as described above.
This is given to the unit 302 and the processing unit 303.   CPU 301 is a ROM3 that stores control programs and control data.
05, RAM 306 for storing processing data, etc., timer times
A reading unit 302, a processing unit 303, and an external unit.
Fluorescent light for document illumination, in addition to controlling communication with the printer 312
Motor driver for driving driver circuit 309 and optical system
It controls the circuit 308, the operation unit 311 and the coordinate input device 310.
You.   FIG. 4 shows a block diagram of the coordinate input device 310.   The timing circuit 402 is clocked by the built-in oscillator.
The address is generated and given to the address counter 403. Address
The counter 403 is pressed when a switch built in the pen 412 is pressed.
While you are, the cout works. During the count operation, first X
The decoder 409 operates, and the pulse voltage is sequentially applied to the X on the input surface 411.
Two-way dynamic scan on the direction electrode, and then Y deco
The pulse voltage is sequentially applied to the input surface 411 in the Y direction.
A two-cycle dynamic scan is performed on the direction electrode. Input surface 411
When the pen switch is turned on, the switches in the X and Y directions
When the can reaches the pen position, the pen
Voltage is induced in the input signal of the pen
Amplified by 4. X-direction scan first pen input
The count value is set in the X register 406 by the signal,
X register 406 according to pen input signal during second scan
And the count value are compared by the comparator 405 to find a match.
Then, a match signal is output to CPU 401. Similarly in the Y direction
Also, the Y register 408 is set during the first scan.
Are compared in the second scan time comparator 407
If a match signal is output to the CPU 401, the CPU 401
When a match signal is obtained, fetch the coordinate values from the X and Y registers
Communication to the main CPU 301 by, for example, serial communication.
I can know. Note that if the X register 406 matches the counter value,
If there is no input, it is determined that the input is invalid. The same is true for the Y direction.
You.   FIG. 5 shows the inside of the image processing unit 303, in particular, the shift memory.
FIG. The shift memory has two lines.
Minute shift memory is provided, but its control is common.
Therefore, FIG. 5 shows only one shift memory,
The control configuration will be described. The write address counter 904 is
Address counter when writing data to the shift memory 907
Then, the read address counter 905 reads from the shift memory 907
This is an address counter for reading data. Ad
The selector 906 sends a command from the CPU 301 to the I / O port 901.
Via the write address counter 904
Signal and address signal of read address counter 905
Select one of them and address shift memory 907
It is for. I / O registers 902 and 903 are write address
Counter 904 and read address counter 905, respectively.
This is a register for the CPU 301 to give a preset value.   Write address counter 904, read address count
905 are both down counters and count operation
WST and RST signals to start
Also, write clock WCLK to shift memory 907 and shift
The read clock RCLK from the memory is input.   915,916 are exclusive OR gates to determine the image area,
The signal OF is a signal for controlling the signal OF.
2.Mask the inside of the frame determined by EN counter 913 and output outside the frame
Image, and the inside of the time frame of 0 is set as the output image and the outside of the frame is masked.
You.   Reference numeral 910 denotes a density processing unit 908 output from the shift memory 907.
Output control of image data that has become a binary signal
Whether the gate and 917 output the aforementioned mask part as white
An AND gate that determines whether to output as black, BB
A black signal is output when the signal is 1 and a white signal is output when the signal is 0 according to a signal for controlling the signal.   911 VIDE the image output output by gates 910 and 917
OR gate that outputs as O
Exclusive OR gate that controls inversion, IN is a signal that controls it
When the value is 1, the image is the original image. When the value is 0, the image is inverted.
Each signal is output by CPU301 according to the mode specified by the operator.
Output.   ST counter 912 and EN counter 913
Start bit counter to output an image only to the area
And end-bit counters, which are accessed via I / O.
OPU301 presets count data for gate
You.   The flip-flop 914 counts up the ST counter 912.
Set by the counter and reset by the count-up of EN counter 913.
Set.   For example, when the OF signal is 1, the ST counter 912 counts
The output of the gate 915 when the Q of the F / F 914 becomes 1 at the tip becomes 0
Gate 910 until the EN counter 913 counts up.
Is not output and is masked. Gate 916 instead
Since the force is 1 during that time, when the BB signal is 1, gate 917 is 1
Thus, the gate 911 outputs 1 to be a black mask. Conversely OF
When = 1 and BB = 0, a white mask is applied. If OF = 0, then
The output of 915,916 is 1,0 during that time, so BB = 1
Is black outside the trimming area, and trim when OF = 0, BB = 0.
The area outside of the switching area becomes white.   Now, this embodiment uses the above-described means to make a rectangular image.
Or trimming or masking the area combining rectangles
This is effective when performing editing processing such as King.   Rectangle or rectangle combination area is main / sub scanning
Area enclosed only by segments equilibrium or perpendicular to the axis
It is important to limit editing to such areas.
Is practical enough and does not require the use of
In that it can provide editing functions at low cost
Useful.   Based on these limitations, the operator can
Enter coordinates discretely so that they surround
Are connected to the main / sub scanning axes as much as possible
Input shall be flat or vertical.   However, in practice, freehand pen input
Entering two points that are connected more horizontally and vertically is the coordinate
Since it is impossible from the practical resolution of the input device,
The operator's input coordinates are corrected in the following procedure.   FIG. 2 shows a schematic example of the area designation method according to the present embodiment.
I do. First, clear all the coordinates that have already been set
Press the clear key. 1st point P1(PX1, PY1). 2nd point PTwo(PXTwo, PYTwo). This time,   | PXTwo−PX1| And | PYTwo−PY1Compare |   | PXTwo−PX1| > | PYTwo−PY1| So input point PTwoAs shown
TTwo(TXTwo, TYTwo) = (PXTwo, PY1). 3rd point PThree(PXThree, PYThree). At this time, the corrected
2 points TTwoAnd the third point PThreeTo | PXThree−TXTwo| <| PYThree−TYTwoBecomes |
Therefore, as shown in the figure, PThreeTo TThree(TXThree, TYThree) = (PXTwo, PYThreeLike)
to correct. 4th point PFour(PXFour, PYFour) Also corrected third point TThreeT compared toFour
(TXFour, TYFour) = (PXFour, PYThree). Similarly, 5th point PFive(PXFive, PYFive) Is TFive(TXFive, TYFive) = (PXFour, PYFive)
To 6th point P6(PX6, PY6) Is T6(TX6, TY6) = (PX6, PYFive)
Correct to. After entering each corner of the desired area, press the OK key.
Push. 1st point P when OK key is input1(PX1, PY1) And corrected
Final point T6= (TX6, TY6) = (PX6, PYFive) To end point processing described later
The first point P1(X1, Y1T)1(TX1, TY1) = (PX6, PY
1).   The operation is performed by correcting and controlling the input coordinates in the above procedure.
The desired area can be composed of vertical segments and vertical segments.
it can.   FIG. 6 shows a detailed flowchart of the above-described correction processing.
You. First, the counter i on the RAM indicating the number of input coordinate points is cleared to 0.
Rear (601). If there is a coordinate input (602), the X component
To the area PXi, TXi on the RAM and the Y component to PYi, TYi
Set (603). If i = 0, that is, the first point (60
4) Increment counter i to wait for the input of the second point.
(615). If i ≧ 1 (604), one point before correction
Completed coordinates (TXi-1, TYi-1) And the input coordinates (PXi, PYi)
The absolute values α and β of the differences for each of the X and Y components are obtained (605).   The operator must make the line connecting the points as horizontal as possible
Based on the assumption that the input is vertical, α and β
The size is compared (606). If α <β, the operator is Y
Judging that you tried to input coordinates so that they are parallel to the axis
The Y coordinate PYi of the point Pi is adopted as it is as TYi, and the X coordinate PX
i is the X coordinate TXi of one point before canceling-1As TXi
(608). Conversely, if α / β, the operator moves to the X axis.
It is determined that coordinate input has been performed so that
The X coordinate PXi is adopted as it is as TXi, and the Y coordinate PYi is
Y-cell Y-coordinate TYi just before-1Adopt as TYi
(607). The input point Pi is corrected to Ti by the correction of 607 and 608.
The line segment Becomes parallel to the X-ray or Y-axis, then the line segment And the previous line segment Check whether are orthogonal. If i = 1, only one line segment
Since it is not generated, the counter i is set to 1 to wait for the third point input.
Increment (609,610,615). TXi if i ≧ 2
-2= TXi, that is, the same line segment where the two line segments of interest are parallel to the Y axis
Above or not (612) or TYi-2= TYi or note
Whether the two line segments of interest are on the same line segment parallel to the X axis
Check (611) and if NO, wait for next input
Increment i by 1 (615). If yes this
To combine two lines into one line A new sum vector (613,614). That is, the input Ti one point before-1To
Cancel and Ti to Ti-1And wait for Ti input again
Therefore, the counter i is not incremented, and the next coordinate is waited.
One. Increment counter i to wait for new input
After that, the latest input point Ti-1Line segment generated by Are all the segments that have been entered so far Check how many times it crosses with (616). Details
The detailed flow will be described later.   If there is no intersection as a result of intersection detection, wait for the next coordinate input.
(617,602). Tis if they cross more than once-1Nothing
Counter i is decremented by 1 to wait for re-input.
(617 → 619). If you only cross once
Ends the area specification because one closed area was generated
Key input or point Ti for-1To cancel
Wait for the rear key input. If there is clear key input, cow
The counter i is decremented by one and waiting for re-input (618 → 619).
If there is an OK key input, the process proceeds to the end point process described below (62
Four).   When there is no coordinate input in step 602, clear key
If there is an input, the latest input point Ti-1Cancel and re-enter
In order to wait for the force, the counter i is decremented by 1 (623). O
If there is a K key input (624), the process proceeds to end point processing described later (62).
Four). When the result area of the end point processing is determined, the process ends, and it is not determined
If so, wait for the coordinate input or clear key input again.   FIG. 7 shows a control flow of intersection detection, which will be described below.
You. First, clear the counter k on the RAM indicating the number of intersections to 0
(701). When i <4, only 4 points or 3 sides are included
Since the power has not been input, the detection process ends. When i5
Set i-4 to the counter j on the RAM for the cross check.
(703). Then point Ti-1, Ti-2, Tj, Tj-1The coordinates of
The values A, B, C, and D are obtained using the values (704, 705, 706, 707). Value calculation
The following function F is used.   F (Tm, Tn) =-1: When TXm = TXn or TYm = TYn                   0: When TXm <TXn and TYm <TYn                   1: When TXm <TXn and TYm => Yn                   2: When TXm> TXn and TYm> TYn                   3: When TXm = TXn and TYm <TYn   Function F classifies the positional relationship between two points Tm and Tn into five cases.
The values are assigned as shown in FIG. Ie
Vector generated from two points Tm and Tn Is "-1" when is parallel to the X or Y axis, and "0" when it is to the upper right
"1" when going up left, "2" when going down left, and when going down right
This function outputs “3”.   If any one of the values A, B, C, D has "-1"Update j because they touch but do not intersect
(708 → 709). Without “−1”, like below 711-718,
The values A, B, C, and D are the values “0”, “1”, “2”, “3” in ascending order.
Or whether to take the value rotated in descending order
Find out. FIG. 9 shows an example in which YES is determined in step 711.
I can.   The example shown in Fig. 9 is now rotated by 90 ° clockwise by 90 °.
There is a positional relationship between the four points determined as “YES” in 2,713,714.
Also, referring to the example of FIG. When the positional relationship is symmetrically folded back to step 715, YES
Judgment, and then rotate 90 ° counterclockwise each time
"YES" is determined for each of 716, 717, and 718. The above eight
Intersect at step 719 when it is determined to intersect in the case
Increment the counter k by one, Crossed Is set to l. Stets
J is updated in step 709, and until j <0 in step 710,
Continue Etsuk.   In step 709, decrementing j by 2 is only 1
When you increment Because it is parallel.   FIG. 12 shows an end point processing flow, which will be described below.   First, the counter i is checked (1001), and if i <2
Since there are only two points at most, the area is not fixed
(1012) The process ends to wait for the point input again. If i3
1 decrement so that the counter i value indicates the latest input point number.
(1002).   Then start point T0From the second point T1Vector to The direction code Do is determined based on FIG. 10 (1003).
Point Ti to the latest point Ti-1Vector from Direction code Di-1Is similarly determined (1004). afterwards,
According to the end point processing type table shown in FIG.
Direction codes Do and Di-1And coordinates TX of point To0, TY0And point Ti
End point processing type based on the coordinates and positional relationship of the four targets TXi and TYi
Is selected and processing is performed according to the processing contents described in Table 1.
(1005).  Examples of corrections for each type of processing described in Table 1
As shown in FIG. It was newly decided by applying the processing of Table 1.
Side ▲ ▼ is created by start point (Sp) To and end point (Ep) Ti
And the sides ▲ ▼ and side If it is at right angles, there is no need for reprocessing, but it is not
In this case, step 100 is performed again using the corrected To, Ti, and i.
Perform the following processing (1006 → 1001).   Use the above procedure to determine the coordinates of each corner that can constitute the area.
Line segment that connects each point from To to Ti in order
Do not intersect each other.
Executes in accordance with each side (1007), and intersects even one place
When you do, make the area indefinite and wait for point input again or clear key
Wait for input point cancellation by input (1008 → 1012).   In step 1009, the Y component
In the point where the minute shows the minimum value, the X component is the minimum
Is defined as the region origin (1009), and the region origin Ts is defined as
Again as a To, a dot sequence clockwise from the new To below
Follow T1, TTwo,…, Ti and new numbers (1010)
The area is determined (1011), and the area specification ends.   The processing example of steps 1009 and 1010 is shown in FIGS. 11-1 to 11-3.
Shown in the figure.   By the way, input the corner points of the uneven area sequentially.
Method, the change point is the change point at the start of each image processing.
It is difficult to determine whether the change point is the end point or the end point. No. 16
When the uneven area shown in Fig. 1 is specified,
Information to indicate is required. However, this area is shown in FIG. 16-3.
As shown in Fig. 16-2, if you input by dividing into three rectangles
The information shown can be obtained immediately. Below, the method of dividing the rectangle
Will be described. [Rectangular division]   Enables image processing by area and processing of uneven areas
Input data into a set of data at the two diagonal ends of the rectangle.
Need to convert. Also, in terms of memory saving, the division is
It needs to be done optimally.   Fig. 17-1 One method of optimally dividing uneven areas
Is shown. When humans think like this, the vertical line or
Can be optimally divided by only one of the horizontal lines. Real truth
In the embodiment, a method of dividing the vertical line will be described.   The rectangular division processing is performed by the algorithm shown in FIGS. 18-1 to 18-4.
Execute based on the algorithm. Below are the necessary quantities for this
Shown in PBXOO (input data): The order in which the Y and X values of the input point were input
Is in. This is calculated as X in the line segment whose Y value is the minimum value.
The point with the larger value (shown in Fig. 17-2) is the origin,
Sorted around. SCD TBL: Saves the attributes (described later) of each input point when searching for paired points.
This is a work area for cutting (Fig. 19-1 and Fig. 19-
2). The paired points are two points that form the diagonal of the divided rectangle
Is shown. In this embodiment, 16 × 16 (byte) is allocated. AREA POINT CNT: Indicates the number of input points. For the end point processing
Therefore, it is always an even number.   Where the attributes of the point ・ All designated points… All input points ・ Remaining designated point: Of all designated points, also constitutes a paired point
of. Note that the remaining designated points are included in all designated points. -New candidate point: Y in the horizontal line segment forming the uneven area
All points on the value change point. -New decision point: A pair point is constructed from new candidate points.
thing. Note that a new decision point is included in a new candidate point.   The above four attributes are defined.   Further, the direction of the point is defined as follows.   The point where the current pointer is located (all designated points) is Pi, and Y of Pi is
When the coordinates are YPi,   When YPi−YPi + 1> 0, lower the direction flag (PNT DRF)
Set   When YPi−YPi + 1 <0, raise the direction flag (PNT DRF)
Set The direction is determined with reference to a direction flag.   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 becomes 15. Therefore,
The maximum number of change points is set to 15 in both the X and Y directions.   Each process performed by each flow shown in FIGS. 18-1 to 18-4
Will be described. (1) SCD TBL SET1: Based on input data, all designated points,
Set the remaining designated point and new decision point in SCD TBL.   First, the pointer (i) is reset, and the pointer
(2-1). Determine the direction of a point
Set the direction flag up or down (2-2).
Pointer at the point where all specified points and direction flags
The direction is set (2-3).
Points include remaining designated points (also designated all points) and direction flags.
The direction corresponding to the setting is set (2-4). In addition,
It is determined whether there is a change point in the Y direction between the two points (−2).
5) If there are any points, set new decision points and directions.
(2-6). Finally, the pointer counter (i) is
Increase by 2 (2-7).   The above operation is repeated for the number of input points (2-8). (2) SCD TBL SET2: Set by the above SCD TBL SET1
Points that are unnecessary for rectangle division among new decision points
And downgrade.   First, the counter 1 is reset to 0 (3-1).
Set as a new decision point in SCD TBL SET1
If the directions of adjacent new points are different within the same Y value,
Demote both points from the new decision point to the new candidate points (3-
2). Then, the counter l is incremented by one (3
-3). This is repeated until the maximum value of the SCD TBL coordinates reaches 15.
Return (3-4), then clear counter l to 0 again
(3-5).   Then, when looking at the attributes of adjacent points within the same Y value, Upward and below all designated points (including remaining designated points)
There is a new candidate point for the direction. All specified points in the upward direction and next to the new candidate point in the downward direction (remaining
(Including existing points).   In these cases, the new candidate point is used as the new decision point again.
Set (3-6). Then, pointer 1 is
It repeats until 1 = 15 (3-8). (3) PAIR POINT: Pair points based on the contents of SCD TBL
Search for.   "The points that make a pair are the remaining designated points or new decision points,
Upward point and downward point at the shortest upper right diagonal distance
Form a pair This is the basic principle of pair point search.   The algorithm of FIGS. 18-3 and 18-4
In order to handle the designated input as shown in Fig. 17-3,
Expand the conditions of point search, One of the remaining designated points or the new decision point,
Make a pair. The starting point is the point on the left of the two diagonal points and the end point is the right point.
The point is located diagonally to the right of the starting point. However, with the same X value
, The upper right diagonal point has priority over the lower right diagonal point.   These two conditions are defined.   Note that Sk is a starting point Y counter, Sl is a starting point X counter,
Let Ek be the end point Y counter and El be the end point counter.   First, the counters Sk and Sl are cleared to 0 (4-1, 4-
2) Search for a point that satisfies the conditions of the start point of the two end points of the rectangular area
(4-3). What are the conditions Remaining designated point or new decision point Unused point (the starting point or
Point not registered as end point) It is to be.   Next, an end point corresponding to the found start point is searched (4-
4).   To search for the end point, first find the Y coordinate where the end point exists.
Then, find the X coordinate.   At the same X coordinate value as the position where the start point is located,
(Large Y coordinate), all specified points of the shortest distance (remaining specified points
) Or a new decision point, and use this as the criteria for the end point search.
(5-3, 5-12). If found, the position of the reference point
The X value is increased one by one from (5-4), It is an unused point. Start point and direction are reversed Remaining designated point or new decision point   A point that satisfies all of the above end point conditions is searched (5-5).
If not found, decrease the X value by one from the reference point
Similarly, find the end point (5-6, 5-7, 5-8). End condition
If a point that satisfies is found, that point is determined as the end point.
Then, the X coordinates of the start point and the end point are exchanged (5-9). Further
If not found, the Y value of the reference point is increased by 1 (5-
10), start again from the reference point search as before. Entering
Since force coordinate correction processing and end point processing are performed,
One start point always corresponds to the start point. Find start and end points
If so, set the specified flag on these two points and (5-
11) Find the next pair point.   After the above processing, the coordinate information of the uneven area is
Converted to a set of endpoints.   Next, the case where the area as shown in Fig. 20-1 is specified
This will be specifically described by way of example.   Specify the area shown in Fig. 20-1 and perform end point processing.
At the end of data sorting, the input quantities are
Become like PBXOO… 60,10,60,20,50,20,50,40,70,40,70,60,60,60,6
0,70,50,70,50,50,10,50,10,20,20,20,20,40,40,40,40,
30,30,30,30,10 AREA POINT CNT… 18   Based on this, set the SCD TBL.   Fig. 20-2 shows the area of Fig. 20-1 transformed into the coordinates of SCD TBL.
FIG.   When the SCD TBL SET1 shown in Fig. 18-1 is completed
The state of the SCD TBL is shown in Fig. 19-1 and the SC shown in Fig. 18-2.
The state of SCD TBL at the end of D TBL SET2 is shown in Chapter 19.
-2.   Based on the SCD TBL in the state shown in FIG.
Perform a search.   First, (2,0) (located on SCD TBL shown in Fig. 19-2
A point that satisfies the condition of the starting point is found at (marker).   So, if you look to the right of the starting point, there is an end point at (2,1).
Find a reference point to search for.   Next, when searching above the reference point, (5,1)
There is a point having an end point condition corresponding to the start point of. Yo
Then, these two points are registered as a pair and used.   When the start point search is started again, the second start point is set at (0,1).
You can find a point, and in the same way
We find point A.   By performing a pair point search in this way, the following
A set of such rectangular area 2 end point data is shown in Fig. 20-1.
And is divided into seven rectangular regions.   By dividing the specified area into rectangles as described above
For example, in the case of the area shown in Fig. 20-1,
Is defined by 14 points, and the storage of area data is
This helps save memory capacity and the time required for transmission.
In addition, such complex areas as trimine
This also facilitates the control of the processing.   To edit the divided area as shown in Fig. 20-1
For example, as you can see on the main scanning line at Y = 30
In two sections of X = 10-20 and X = 30-50, for example, trim
In such a case, it is necessary to perform
Counters 912,913 and gates 909,910,915,916,9
This can be achieved by holding at least two sets of 17. Now two sets of couns
912 and 913 as ST counter 1, EN counter 1 and ST counter
2, if EN counter 2 is used, the area shown in Fig. 20-1 is trimmed.
When the optical system reaches Y = 10, the ST counter 1
30, set 60 to EN counter 1, set ST counter 2, EN counter
The same value is set in data 2. Next, the optical system reaches Y = 20
When ST counter 2 is set to 10, EN counter 2 is set to 20, EN counter
Set 50 in data 1. Further, the optical system reached Y = 30
Hour ST counter 1 is 10, EN counter 1 is 70, counter 2 is
Set the same value and control the counter in the same procedure.
Then, the desired editing can be performed. (Effect)   As described above, according to the present invention, the coordinate input device
More surrounded by horizontal / vertical segments in each of the main / sub scanning directions
Multiple corners of a closed area different from the rectangle specified in
And store the coordinates of the corners based on the stored coordinates of the plurality of corners.
Then, the closed area is divided into a plurality of rectangular areas.
By generating coordinates representing a plurality of rectangular areas,
Easy image processing even for complex designated areas of right-angled polygons
Can also be done, like bitmap memory
Even if a large capacity memory is not used,
Marks can be stored.

【図面の簡単な説明】 第1−1図は座標入力装置を示す図、 第1−2図は本発明を適用できる複写装置の外観図、 第2図は座標補正の例を示す図、 第3図は装置全体の概略ブロツク図、 第4図は座標入力装置のブロツク図、 第5図は編集に係わる処理ブロツク図、 第6図は入力座標補正の制御フローチヤート、 第7図は交差検出の制御フローチヤート、 第8図は交差検出に用いる函機Fの説明図、 第9図は交差例、 第10図は領域辺の方向コード図、 第11−1図〜第11−3図は入力点列並べかえの例を示す
図、 第12図は座標入力終了後の終点処理制御フローチヤー
ト、 第13図は終点処理タイプテーブルを示す図、 第14図は終点処理例を示す図、 第15図はエリア編集の為のピツトマツプメモリーの例を
示す図、 第16−1図〜第16−3図は矩形分割の効果を示す図、 第17−1図〜第17−3図は矩形分割の概念図、 第18−1図〜第18−4図は矩形分割処理のフローチヤー
ト、 第19−1図,第19−2図は矩形分割に用いるスケジユー
ルテーブル(SCD TBL)を示す図、 第20−1図は矩形分割を説明するための図、 第20−2図は第20−1図の領域をスケジユールテーブル
の座標に変換した図である。 104は座標入力装置、105は座標入力用ペン、106は有効
座標入力面、912はスタートカウンタ、913はエンドカウ
ンタである。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1-1 shows a coordinate input device, FIG. 1-2 shows an external view of a copying apparatus to which the present invention can be applied, FIG. 2 shows an example of coordinate correction, 3 is a schematic block diagram of the entire apparatus, FIG. 4 is a block diagram of a coordinate input device, FIG. 5 is a processing block diagram relating to editing, FIG. 6 is a control flow chart of input coordinate correction, and FIG. 7 is intersection detection. FIG. 8 is an explanatory view of a box machine F used for intersection detection, FIG. 9 is an example of intersection, FIG. 10 is a direction code diagram of an area side, and FIGS. 11-1 to 11-3 are FIG. 12 is a diagram illustrating an example of rearrangement of input point sequences, FIG. 12 is a flowchart illustrating an end point processing control after coordinate input is completed, FIG. 13 is a diagram illustrating an end point processing type table, FIG. The figure shows an example of a pit map memory for area editing, and FIGS. 16-1 to 16-3 are rectangular. FIG. 17-1 to FIG. 17-3 are conceptual diagrams of rectangular division, FIG. 18-1 to FIG. 18-4 are flowcharts of rectangular division processing, FIG. FIG. 19-2 is a diagram showing a schedule table (SCD TBL) used for rectangular division, FIG. 20-1 is a diagram for explaining rectangular division, and FIG. 20-2 is a diagram showing the region of FIG. It is the figure converted into the coordinates of the table. 104 is a coordinate input device, 105 is a coordinate input pen, 106 is an effective coordinate input surface, 912 is a start counter, and 913 is an end counter.

Claims (1)

(57)【特許請求の範囲】 1.座標入力装置により主/副各走査方向に水平/垂直
な線分で囲まれる様に指定される、矩形とは異なる閉領
域に所望の処理を行う画像処理装置の領域処理方法にお
いて、 指定された矩形とは異なる閉領域の複数のコーナーの座
標を記憶し、記憶された複数のコーナーの座標に基づい
て上記閉領域を複数の矩形領域に分割し、分割された複
数の矩形領域を表わす座標を発生することを特徴とする
領域処理方法。 2.特許請求の範囲第1項において、上記閉領域の複数
のコーナーの座標と、各コーナーを順次結んで生成され
るベクトルの方向成分に基づき、上記閉領域を複数の矩
形領域に分割することを特徴とする領域処理方法。
(57) [Claims] In an area processing method of an image processing apparatus for performing a desired process on a closed area different from a rectangle, which is specified by a coordinate input device so as to be surrounded by horizontal / vertical segments in each of the main / sub scanning directions. The coordinates of a plurality of corners of a closed area different from a rectangle are stored, and the closed area is divided into a plurality of rectangular areas based on the stored coordinates of the plurality of corners, and coordinates representing the plurality of divided rectangular areas are obtained. A region processing method characterized by generating. 2. 3. The method according to claim 1, wherein the closed area is divided into a plurality of rectangular areas based on coordinates of a plurality of corners of the closed area and a directional component of a vector generated by sequentially connecting the corners. Area processing method to be used.
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 JPS63215166A (en) 1988-09-07
JP2791017B2 true 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)

Family Cites Families (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
JPS63215166A (en) 1988-09-07

Similar Documents

Publication Publication Date Title
US4965678A (en) Area designation apparatus in image processing system
JPS6132888A (en) Image display
JP3428678B2 (en) Image processing apparatus and method
US4852024A (en) Picture processing apparatus
JP2791017B2 (en) Area processing method
US5148294A (en) Image processing apparatus and method for painting a memory with plural colors
JPH04328956A (en) Picture data read method
EP0314080B1 (en) Image paralleling and rotating system
EP0383305A2 (en) Data processing apparatus
JPH01168163A (en) Picture processing unit
JPH0831130B2 (en) Line image processing method
KR0152350B1 (en) Image compiling device and method of digital copier
JP2840306B2 (en) Area processing method of image processing apparatus
JPH0773332B2 (en) Area designation method
JPH0766385B2 (en) Document creation device
KR920001414B1 (en) Maintenance system for swithing center
JPS6132109A (en) Data setting screen display system in numerical controller
JP2945028B2 (en) Image processing designated area information calculation device
JP3096123B2 (en) Document processing apparatus and method
JPH02190896A (en) Cursor movement control system for input picture
JP2710635B2 (en) Image reading device
JPS6117189A (en) Graphic processor
JPH04321376A (en) Picture processing unit
JPS63196929A (en) Picture input display device
JPH0540851A (en) Method and device for character recognition

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term