JPH0634237B2 - Image clipping method - Google Patents

Image clipping method

Info

Publication number
JPH0634237B2
JPH0634237B2 JP61038540A JP3854086A JPH0634237B2 JP H0634237 B2 JPH0634237 B2 JP H0634237B2 JP 61038540 A JP61038540 A JP 61038540A JP 3854086 A JP3854086 A JP 3854086A JP H0634237 B2 JPH0634237 B2 JP H0634237B2
Authority
JP
Japan
Prior art keywords
clipping
vector
image
calculation
vertex
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 - Fee Related
Application number
JP61038540A
Other languages
Japanese (ja)
Other versions
JPS62196772A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP61038540A priority Critical patent/JPH0634237B2/en
Publication of JPS62196772A publication Critical patent/JPS62196772A/en
Publication of JPH0634237B2 publication Critical patent/JPH0634237B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、描かれた図形を光学的に画像スキャナによ
り走査してランレングスデータとして定義し、更に図形
変換演算を実行して、その一部の矩形領域をクリッピン
グする場合の画像クリッピング方法に関するものであ
る。
DETAILED DESCRIPTION OF THE INVENTION [Industrial application] The present invention optically scans a drawn figure by an image scanner to define it as run-length data, and further executes a figure conversion operation. The present invention relates to an image clipping method for clipping a rectangular area of a part.

〔従来の技術〕[Conventional technology]

最初に画像処理技術において一般的に行われているラン
レングスベクトルについて説明する。第4図は紙面上に
描かれた図形“A”のランレングスベクトルを示す図
で、図において、1は読取対象となる白地の図面、2は
図面1に黒で描かれた図形、3はスキャンの軌跡、4は
スキャン内で図形2の黒がどの始点から終点まで連続し
ているかを示すランレングスベクトル、5はそのランレ
ングスベクトル4の始点、6はランレングスベクトルの
終点で、X,Yは座標軸である。
First, the run length vector that is generally used in the image processing technique will be described. FIG. 4 is a diagram showing the run-length vector of the figure “A” drawn on the paper. In the figure, 1 is a white background to be read, 2 is a figure drawn in black in FIG. A locus of scan, 4 is a run length vector indicating from which start point to end point the black of the figure 2 is continuous in the scan, 5 is the start point of the run length vector 4, 6 is the end point of the run length vector, X, Y is a coordinate axis.

ここで、スキャンは、X軸上を一定間隔で行い、図面全
体についてランレングスデータを得るものである。
Here, the scanning is performed on the X-axis at regular intervals to obtain run-length data for the entire drawing.

次に、従来の図形変換方式におけるランレングスベクト
ルデータの演算アルゴリズムについて以下に説明する。
(1)式は図形のゆがみ補正を行う場合に適用される変
換式で、a〜hは定数である。
Next, a run length vector data calculation algorithm in the conventional figure conversion method will be described below.
The equation (1) is a conversion equation applied when correcting the distortion of the figure, and a to h are constants.

ここで、(1)式におけるx,yはランレングスベクト
ルの始点又は終点を表わし、X,Y軸上の座標値で、
x′,y′は、前記座標値(x,y)に対応する変換後
のX,Y軸上の点の座標値である。
Here, x and y in the equation (1) represent the start point or the end point of the run length vector and are coordinate values on the X and Y axes,
x ′ and y ′ are coordinate values of points on the X and Y axes after conversion corresponding to the coordinate value (x, y).

パラメータa,b,c,d,e,f,g,hは第5図に
示す様に入力図上のスキャンデータにおける4点の座標
(x,y),(x,y),(x,y),
(x,y)と、その4点に対応する出力図上の座標
(x′,y′),(x′,y′),(x′,
′),(x′,y′)とから(2)式を解くこ
とによって得る。
Parameters a, b, c, d, e, f, g, and h are coordinates (x 1 , y 1 ) and (x 2 , y 2 ) of four points in the scan data on the input diagram as shown in FIG. , (X 3 , y 3 ),
(X 4 , y 4 ) and the coordinates (x 1 ′, y 1 ′), (x 2 ′, y 2 ′), (x 3 ′, on the output diagram corresponding to the four points,
It is obtained by solving the equation (2) from y 3 ′) and (x 4 ′, y 4 ′).

この場合、上記入力図上のスキャンデータにおける4点
の座標と、その4点に対応する出力図上の座標は、例え
ば周知のようにデータ入力手段で上記スキャンデータを
表示画面に出し、その表示画面を見たオペレータの指示
によって得るものである。この指示方法の例を第6図に
示す。第6図(a)は、スキャンデータの画面表示例であ
り、斜線部はスタイラスペンを用いて4点を指示した結
果を領域表示したものである。
In this case, the coordinates of the four points in the scan data on the input diagram and the coordinates on the output diagram corresponding to the four points are displayed by displaying the scan data on a display screen by a data input means as is well known. It is obtained by the instruction of the operator who sees the screen. An example of this instruction method is shown in FIG. FIG. 6 (a) is an example of a screen display of scan data, and the shaded area is an area display of the result of pointing at four points using a stylus pen.

(1)式の演算後は、同一スキャン内のランレングスデ
ータであっても、始点・終点の座標値x′(又はy′)
は一般に等しいものとはならない。
After the calculation of equation (1), the coordinate value x ′ (or y ′) of the start point / end point is obtained even if the run length data is in the same scan.
Are generally not equal.

(1)式の演算後のランレングスベクトルデータに対し
て、一部の矩形領域を第6図(a)から同図(b)に示す様に
クリッピングするには、従来は例えば「パソコンCAD
実践活用法」(技術評論社 昭和59年8月)26頁〜
28頁に示されている以下の手法が用いられていた。
For clipping a part of the rectangular area of the run-length vector data after the calculation of the equation (1) as shown in FIGS. 6 (a) to 6 (b), conventionally, for example, "PC CAD
"Practical use" (Technical Review, August 1984), page 26-
The following procedure, shown on page 28, was used.

クリッピング領域の中と範囲外とで、第7図に示すよう
に空間を9分割し、第7図のとおり4bitで符号化す
る。この4bitを左から第1,第2,第3,第4bitとす
ると、第1bitが1であることはクリッピング領域のエ
ッジ上限より上であることを意味し、第2bitが1であ
ることはクリッピング領域のエッジ下限より下であるこ
とを意味し、第3bitが1であることはクリッピング領
域のエッジ右限より右であることを意味し、第4bitが
1であることはクリッピング領域のエッジ左限より左で
あることを意味する。
As shown in FIG. 7, the space is divided into 9 parts in the clipping region and outside the range, and 4 bits are encoded as shown in FIG. If these 4 bits are the 1st, 2nd, 3rd and 4th bits from the left, the fact that the 1st bit is 1 means that it is above the upper edge limit of the clipping region, and that the 2nd bit is 1 means that clipping It is below the edge lower limit of the area, the third bit being 1 means to the right of the edge right limit of the clipping area, and the fourth bit being 1 means the edge left edge of the clipping area. Means more to the left.

次にベクトルの始点と終点が、それぞれどの空間に入る
かを分類し、それぞれの4bitコードの論理積をとる。
その結果が0000でなければ、ベクトルとクリッピン
グ領域の全く外となり全く描画する必要はない。
Next, which space each of the start point and the end point of the vector falls into is classified, and the logical product of each 4-bit code is taken.
If the result is not 0000, it is completely outside the vector and clipping area, and there is no need to draw at all.

前記の4bitコードの論理積が0000である場合に
は、ベクトルの始点と終点のそれぞれの4bit符号の1
となっているbitの意味に応じてベクトルの切り取りを
行う。
When the logical product of the above 4-bit codes is 0000, 1 of each 4-bit code of the start point and end point of the vector
The vector is cut according to the meaning of the bit.

例えば第8図に示すようにベクトルABは最初にACが
切り取られベクトルCBとなり、次にCDが切り取ら
れ、最終的にベクトルDBとなり、クリッピング領域内
のベクトルが得られる。
For example, as shown in FIG. 8, in the vector AB, AC is first cut out to become the vector CB, then CD is cut out, and finally the vector DB is obtained, and the vector in the clipping area is obtained.

また、第9図−(1),(2)のフローチャートにおけ
る7は「補正定数算出」ステップ、8は「スキャン行カ
ウンタ初期設定」ステップ、9は「スキャン行終点」を
示す判定ステップ、10は「スキャン内ランレングス終
了」の判定ステップ、11は前記「(1)式の演算」ス
テップ、12は「スキャン行カウントアップ」ステッ
プ、13は「始点x′方向分類」ステップ、14は「始
点y′方向分類」ステップ、15は「終点x′方向分
類」ステップ、16は「終点y′方向分類」ステップ、
17は空間符号論理積」ステップ、18は「論理積判
定」ステップ、19は「ベクトルの方程式算出」ステッ
プ、20は「bitカウンタ初期設定」ステップ、21は
「始点の符号bit判定」ステップ、22は「2直線の交
点算出、不要ベクトル切り取り」ステップ、23は「bi
tカウンタ値カウントアップ」ステップ、24は「4bit
終了」の判定ステップ、25は「bitカウンタ初期設
定」ステップ、26は「終点の符号bit判定」ステッ
プ、27は「2直線の交点算出、不要ベクトル切り取
り」ステップ、28は「bitカウント値カウントアッ
プ」ステップ、29は「4bit終了」の判定ステップ、
30は「ベクトル描画」ステップである。
Further, in the flowcharts of FIGS. 9- (1) and (2), 7 is a “correction constant calculation” step, 8 is a “scan row counter initial setting” step, 9 is a “scan row end point” determination step, and 10 is a "Run end length within scan" determination step, 11 "calculation of equation (1)" step, 12 "scan row count up" step, 13 "start point x'direction classification" step, 14 "start point y"'Directionclassification' step, 15'end point x'direction classification 'step, 16'end point y'direction classification' step,
17 is a spatial code logical product step, 18 is a logical product judgment step, 19 is a vector equation calculation step, 20 is a bit counter initial setting step, 21 is a start point code bit judgment step, 22 Is the step of “calculating the intersection of two straight lines and cutting out unnecessary vectors”, and 23 is “bi
"Count up counter value" step, 24 is "4bit
"End" determination step, 25 is "bit counter initial setting" step, 26 is "end point code bit determination" step, 27 is "two straight line intersection calculation, unnecessary vector cutout" step, 28 is "bit count value count up" Step, 29 is a step of judging "4bit end",
30 is a "vector drawing" step.

更に、一般の画像処理システム(例えば、画像情報ファ
イル装置)の構成例を第10図に示す。すなわち、
(A)は画像入出力装置で、(B)の画像メモリ装置と
共にイメージバス(C)を介してイメージプロセシング
デバイス(D)に接続されている。
Furthermore, FIG. 10 shows a configuration example of a general image processing system (for example, an image information file device). That is,
(A) is an image input / output device, which is connected to an image processing device (D) through an image bus (C) together with the image memory device of (B).

(E)は登録検索処理デバイスでデータプロセッサ、C
RT、キーボード等より構成され、データバス(F)を
介してフロッピディスクや磁気ディスク等のインデック
ス管理デバイス(G)に接続され、所定の演算を行なう
ものである。
(E) is a registration search processing device, which is a data processor, C
It is composed of an RT, a keyboard and the like, and is connected to an index management device (G) such as a floppy disk or a magnetic disk via a data bus (F) to perform a predetermined calculation.

次に第9図−(1),(2)の動作について説明する。
まずステップ7の「補正定数算出」で、前記(1)式の
パラメータa,b,c,d,e,f,g,hを算出し、
ステップ8の「スキャン行カウンタ初期設定」で対象と
するスキャン行の初期設定を実行した後に、ステップ9
の「スキャン行終了」の判定で対象とするスキャン行が
ない場合にはその動作を終了し、また、対象とすべきス
キャン行が存在する場合にはステップ10に移行する。
Next, the operation of FIG. 9- (1) and (2) will be described.
First, in step 7 “calculation of correction constant”, the parameters a, b, c, d, e, f, g and h of the equation (1) are calculated,
After performing the initial setting of the target scan line in the “scan line counter initial setting” of step 8, step 9
If there is no scan line of interest in the "scan line end" determination, the operation is ended, and if there is a scan line of interest, the process proceeds to step 10.

そして、ステップ10の「スキャン内ランレングス終
了」の判定で、対象とするスキャン行内の変換演算を実
施していないランレングスデータが存在していない場合
には、ステップ12の「スキャン行カウントアップ」に
移り、存在する場合にはステップ11の「(1)式の演
算」に移る。そして、前記ステップ11では「(1)式
の演算」を、ランレングスベクトルの始点と終点の座標
値について行い、対応するランレングスベクトルの座標
値を得る。
If it is determined in step 10 that "run length within scan" is complete, and there is no run length data for which conversion operation has not been performed in the target scan row, "scan row count up" in step 12 If it exists, the process proceeds to “Operation of Expression (1)” in step 11. Then, in step 11, "calculation of equation (1)" is performed on the coordinate values of the start point and the end point of the run length vector to obtain the coordinate value of the corresponding run length vector.

ステップ11の「(1)式の演算」後は、ステップ13
の「始点x′方向分類」、ステップ14の「始点y′方
向分類」、ステップ15の「終点x′方向分類」、ステ
ップ16の「終点y′方向分類」を行ない、ベクトルの
始点と終点のそれぞれについて第7図の9分割空間の分
類を行う。
After "calculation of equation (1)" in step 11, step 13
"Starting point x'direction classification", Step 14 "Starting point y'direction classification", Step 15 "Ending point x'direction classification", Step 16 "Ending point y'direction classification". The 9-division space of FIG. 7 is classified for each.

次に、ステップ17の「空間符号論理積」にて、ベクト
ルの始点の空間分類符号とベクトルの終点の空間分類符
号の論理積をとる。そして、ステップ18の「論理積判
定」にて、前記論理積が0000である場合はステップ
19に分岐し、0000がなければベクトルはクリッピ
ング領域にかかっていないのでステップ10に戻る。
Next, in "spatial code AND" of step 17, the logical product of the spatial classification code at the start point of the vector and the spatial classification code at the end point of the vector is calculated. Then, in the "logical product determination" of step 18, if the logical product is 0000, the process branches to step 19, and if there is no 0000, the vector is not in the clipping region, so the process returns to step 10.

ステップ19の「ベクトルの方程式算出」にて、ベクト
ルの始点を通る直線の方程式を求める。ステップ20の
「bitカウンタ初期設定」にて、空間符号4bitのbitを
カウントするためのカウンタを初期設定し、ステップ2
3の「bitカウンタ値カウントアップ」とステップ24
の「4bit終了」の判定により、ベクトル始点の空間符
号4bitに対してステップ21とステップ22の処理を
行う。
In "calculation of vector equations" in step 19, an equation of a straight line passing through the starting point of the vector is obtained. In the "bit counter initial setting" of step 20, the counter for counting the bits of the spatial code 4 bits is initialized, and step 2
"Count up the bit counter value" in step 3 and step 24
According to the determination of "4 bit end" in step 4, the process of step 21 and step 22 is performed on the spatial code 4 bit of the vector start point.

ステップ21の「始点の符号bit判定」では、bitカウン
タにて示される始点の空間符号bitが1であるかどうか
を判定し、1であれば、ステップ22の「2直線の交点
算出・不要ベクトルの切り取り」に進み、ベクトルの直
線方程式とクリッピング領域エッジの直線方程式との交
点を求め、ベクトルの始点をその交点に変更することで
ベクトルの不要部を切り取る。
In the "start point code bit determination" in step 21, it is determined whether or not the start point spatial code bit indicated by the bit counter is 1, and if it is 1, "two straight line intersection calculation / unnecessary vector" is determined in step 22. "Cut" and find the intersection of the linear equation of the vector and the linear equation of the clipping region edge, and change the start point of the vector to that intersection to clip the unnecessary part of the vector.

ステップ20,21,22,23,24はベクトル始点
に対するベクトルの切り取りであるが、全く同様に、ス
テップ25,26,27,28,29にてベクトル終点
に対してベクトルの切り取りを行い、ステップ30の
「ベクトル描画」にて不要部のないクリッピング領域内
のみとなったベクトルを出力デバイスに出力する。
Steps 20, 21, 22, 23, and 24 are cutting of the vector with respect to the vector start point, but in the same way, in steps 25, 26, 27, 28, and 29, the vector is cut with respect to the vector end point, and step 30 is performed. The vector which is only in the clipping area with no unnecessary part is output to the output device by "Vector drawing".

例えば、総スキャン数が1000行で、1スキャン内に
ランレングスベクトルが平均10本あり、クリッピング
領域内に総ランレングスベクトルの1/4が存在する場
合には、図面全体では、概ね以下の演算量となる。
For example, if the total number of scans is 1000 and there are an average of 10 run length vectors in 1 scan, and 1/4 of the total run length vectors exist in the clipping area, the following calculation is performed in the entire drawing. It becomes the amount.

なお、各ステップは、例えばFORTRAN言語を用い
たプログラミングは、2行前後でプログラム出来る量を
目処にしているが、ステップ7の「補正定数算出」だけ
はFORTRANで100行程度を要する。ステップ7
は1回しか実行しないので、全体の演算量から見ると無
視できる量である。
In each step, for example, in programming using the FORTRAN language, the amount that can be programmed is about two lines, but only “correction constant calculation” in step 7 requires about 100 lines in FORTRAN. Step 7
Since it is executed only once, it is an amount that can be ignored from the viewpoint of the total calculation amount.

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

従来のクリッピング方法は以下のように行なわれている
ので、図形の変換演算を行う前のランレングスベクトル
データの座標値X(又はY)は同一スキャン内で一定で
ある性質を採用せずに、図形変換演算後のランレングス
ベクトルをクリッピングしていたため、クリッピングに
伴う判定・演算処理が複雑となり、演算時間を多く必要
とする問題点があった。
Since the conventional clipping method is performed as follows, the coordinate value X (or Y) of the run length vector data before performing the graphic conversion operation does not adopt the property of being constant in the same scan, Since the run-length vector after the graphic conversion calculation is clipped, there is a problem that the determination / calculation process accompanying the clipping becomes complicated and a long calculation time is required.

この発明は上記のような問題点を解消するためになされ
たもので、図形変換演算を行う前のランレングスベクト
ルデータの座標値(X軸又はY軸)は同一スキャン内で
は一定であることを利用してクリッピング処理すること
によって、演算の効率化を計るようにしたクリッピング
方法を提供することを目的とする。
The present invention has been made to solve the above-mentioned problems, and it is necessary that the coordinate value (X axis or Y axis) of the run length vector data before the graphic conversion operation is constant within the same scan. It is an object of the present invention to provide a clipping method designed to improve the efficiency of calculation by utilizing the clipping process.

〔問題点を解決するための手段〕[Means for solving problems]

この発明に係る画像クリッピング方法は、画像のゆがみ
補正を行う変換演算式に用いる補正定数を求め、前記変
換演算式による変換演算後のクリッピング矩形領域が変
換演算前にはどこに位置するかを算出する逆変換演算式
に用いるクリッピング定数を求め、X軸の座標値を基準
にして前記クリッピング矩形領域に対する前記画像のY
軸方向の上限または下限を算出しクリッピング処理し、
前記補正定数を適用して前記変換演算式を実行し、前記
クリッピング演算処理された画像のゆがみを補正するも
のである。
An image clipping method according to the present invention obtains a correction constant used in a conversion calculation expression for correcting image distortion, and calculates where the clipping rectangular area after the conversion calculation by the conversion calculation expression is located before the conversion calculation. The clipping constant used in the inverse transformation calculation formula is obtained, and the Y value of the image for the clipping rectangular area is calculated based on the coordinate value of the X axis.
Calculate the upper or lower limit in the axial direction and perform clipping processing,
The correction constant is applied to execute the conversion arithmetic expression to correct the distortion of the image subjected to the clipping arithmetic processing.

〔作用〕[Action]

この発明における画像クリッピング方法は、ランレング
スベクトルデータに図形変換演算を施してクリッピング
を行う際に、ランレングスデータが同一スキャン内では
座標値が一定であることを用い、同一スキャン内の不変
パラメータをスキャン毎に計算してスキャン内のランレ
ングスベクトルデータに適用することにより、処理時間
が短縮され、高速図形クリッピング処理を実現する。
The image clipping method according to the present invention uses the fact that the run-length vector data has a constant coordinate value in the same scan when the graphic conversion operation is performed on the run-length vector data to perform clipping. By calculating for each scan and applying it to the run-length vector data in the scan, the processing time is shortened and high-speed graphic clipping processing is realized.

〔実施例〕〔Example〕

第1図−(1),(2)はこの発明の一実施例を示すフ
ローチャートで、前記第9図−(1),(2)と同一の
機能は同一の符号をもって図示した。第1図−(1),
(2)において、31は「クリッピング定数算出」ステ
ップ、32は「x方向分類」ステップ、33は「範囲
外」の判定ステップ、34は「y方向上限算出」ステッ
プ、35は「y方向下限算出」ステップ、36は「始点
y≦上限」の判定ステップ、37は「終点y≧下限」の
判定ステップ、38は「始点y<下限」の判定ステッ
プ、39は「始点y=下限」ステップ、40は「終点y
>上限」の判定ステップ、41は「終点y=上限」ステ
ップである。
FIGS. 1- (1) and (2) are flow charts showing an embodiment of the present invention, and the same functions as those in FIGS. 9- (1) and (2) are indicated by the same reference numerals. Fig. 1- (1),
In (2), 31 is a "clipping constant calculation" step, 32 is an "x direction classification" step, 33 is an "out of range" determination step, 34 is a "y direction upper limit calculation" step, and 35 is a "y direction lower limit calculation". Step, 36 is a “start point y ≦ upper limit” determination step, 37 is an “end point y ≧ lower limit” determination step, 38 is a “start point y <lower limit” determination step, 39 is a “start point y = lower limit” step, 40 Is the end point y
> Upper limit ”determination step, and 41 is an“ end point y = upper limit ”step.

まず、この発明の動作の概要について説明する。(1)
式は第2図の(a)から(b)への変換式であるが、逆
に(b)から(a)への変換式(3)式は(4)式を解
くことによって得る。
First, the outline of the operation of the present invention will be described. (1)
The expression is a conversion expression from (a) to (b) in FIG. 2, but the conversion expression (3) from (b) to (a) is obtained by solving the expression (4).

次に第2図に示すごとく、(1)式の変換演算後のクリッ
ピング矩形領域「頂点(x′C1,y′C1),(x′C2
y′C2),(x′C3,y′C3),(x′C4,y′C4)」
が(1)式の変換演算前にはどこに位置するか「頂点(x
C1,yC1),(xC2,yC2),(xC3,yC3),
(xC4,yC4)」を(3)式を用いて算出する。
Next, as shown in FIG. 2, the clipping rectangular area “vertices (x ′ C1 , y ′ C1 ), (x ′ C2 ,
y ′ C2 ), (x ′ C3 , y ′ C3 ), (x ′ C4 , y ′ C4 ) ”
Where is located before the conversion operation of equation (1) "vertices (x
C1 , y C1 ), (x C2 , y C2 ), (x C3 , y C3 ),
(X C4 , y C4 ) ”is calculated using the equation (3).

そして、(1)式の変換演算前のxy座標にて、頂点(x
C1,yC1)と頂点(xC2,yC2)を結ぶ直線、頂点(x
C2,yC2)と頂点(xC3,yC3)を結ぶ直線、頂点(x
C3,yC3)と頂点(xC4,yC4)を結ぶ直線、頂点(x
C4,yC4)と頂点(xC1,yC1)を結ぶ直線の方程式4
本を求める。
Then, the vertices (x
C1 , y C1 ) and the vertex (x C2 , y C2 ), the vertex (x
C2 , y C2 ) and the vertex (x C3 , y C3 ), the vertex (x
C3 , y C3 ) and the vertex (x C4 , y C4 ), the vertex (x
Equation 4 of the straight line connecting C4 , y C4 ) and the vertex (x C1 , y C1 ).
Ask for a book.

以下、第2図の例をもとに説明する。Hereinafter, description will be made based on the example of FIG.

(1)式の変換演算前のランレングスベクトルのスキャ
ン行、すなわちx座標が頂点(xC4,yC4)のx座標未
満であるか、又は頂点(xC2,yC2)のx座標を越えて
いればそのベクトルは完全にクリッピング領域の外にな
り、描画する必要はない。
The scan row of the run-length vector before the conversion operation of Expression (1), that is, the x coordinate is less than the x coordinate of the vertex (x C4 , y C4 ), or exceeds the x coordinate of the vertex (x C2 , y C2 ). If so, the vector is completely outside the clipping region and does not need to be drawn.

(1)式の変換前のランレングスベクトルのx座標が頂
点(xC4,yC4)のx座標以上であり、かつ、頂点(x
C1,yC1)のx座標未満である場合には、頂点(xC3
C3)と頂点(xC4,yC4)を結ぶ直線が上限であり、
頂点(xC4,yC4)と頂点(xC1,yC1)を結ぶ直線が
下限であるので、この範囲外のベクトルを切り取って出
力デバイスに出力する。
The x-coordinate of the run-length vector before conversion in equation (1) is greater than or equal to the x-coordinate of the vertex (x C4 , y C4 ), and the vertex (x
C1 , y C1 ) is less than the x coordinate, the vertex (x C3 ,
The straight line connecting y C3 ) and the vertex (x C4 , y C4 ) is the upper limit,
Since the straight line connecting the vertex (x C4 , y C4 ) and the vertex (x C1 , y C1 ) is the lower limit, a vector outside this range is cut and output to the output device.

同様に(1)式の変換前のランレングスベクトルのx座
標が頂点(xC1,yC1)のx座標以上であり、かつ、頂
点(xC3,yC3)のx座標以下である場合には頂点(x
C3,yC3)と頂点(xC4,yC4)を結ぶ直線が上限であ
り、頂点(xC1,yC1)と頂点(xC2,yC2)を結ぶ直
線が下限である。
Similarly, if the x-coordinate of the run-length vector before conversion in equation (1) is greater than or equal to the x-coordinate of the vertex (x C1 , y C1 ) and less than or equal to the x-coordinate of the vertex (x C3 , y C3 ). Is the vertex (x
The straight line connecting C3 , y C3 ) and the vertex (x C4 , y C4 ) is the upper limit, and the straight line connecting the vertex (x C1 , y C1 ) and the vertex (x C2 , y C2 ) is the lower limit.

又、(1)式の変換演算前のランレングスベクトルのx
座標が頂点(xC3,yC3)のx座標を越えていて、か
つ、頂点(xC2,yC2)のx座標以下である場合には、
頂点(xC2,yC2)と頂点(xC3,yC3)を結ぶ直線が
上限であり、頂点(xC1,yC1)と頂点(xC2,yC2
を結ぶ直線が下限となる。
Further, x of the run length vector before the conversion calculation of the equation (1)
If the coordinate exceeds the x coordinate of the vertex (x C3 , y C3 ) and is less than or equal to the x coordinate of the vertex (x C2 , y C2 ), then
The straight line connecting the vertex (x C2 , y C2 ) and the vertex (x C3 , y C3 ) is the upper limit, and the vertex (x C1 , y C1 ) and the vertex (x C2 , y C2 )
The straight line connecting is the lower limit.

ランレングスベクトルの上下限チェックと、ベクトルの
不要部の切り取りは以下のように行う。
The upper and lower limits of the run length vector are checked and unnecessary portions of the vector are cut out as follows.

第3図に示すように、42,43,44,45,46が
対象スキャン内のランレングスベクトルであり、47が
上限、48が下限であるとき、まず、ランレングスベク
トルの始点のy座標が上限以下であり、かつ、終点のy
座標が下限以上であるベクトルすなわち、第3図43,
44,45のみが出力の対象となる。
As shown in FIG. 3, when 42, 43, 44, 45, and 46 are run length vectors in the target scan, 47 is the upper limit, and 48 is the lower limit, first, the y coordinate of the start point of the run length vector is Y that is less than or equal to the upper limit and is the end point
Vectors whose coordinates are greater than or equal to the lower limit, that is, FIG.
Only 44 and 45 are output targets.

そして、この出力対象ベクトルに対して、始点のy座標
が下限以下であれば下限以下の部分を切り取り、ベクト
ルの終点のy座標が上限以上であれば上限以上の部分を
切り取る。すなわち、第3図43と45のベクトルの不
要部が切り取られる。
Then, if the y coordinate of the starting point is less than or equal to the lower limit for this output target vector, the portion below the lower limit is cut off, and if the y coordinate of the end point of the vector is above the upper limit, the portion above the upper limit is cut out. That is, unnecessary portions of the vectors of FIGS. 43 and 45 are cut off.

次に第1図のフローチャートに基づいて動作を詳細に説
明する。まず、ステップ7の「補正定数算出」で(1)
式のパラメータa,b,c,d,e,f,g,hを算出
し、ステップ31の「クリッピング定数算出にて(3)
式のパラメータa′,b′,c′,d′,e′,f′,
g′,h′ならびに(1)式の演算後のクリッピング矩
形領域に対応する(1)式の演算前の四角形領域の4辺
の直線の方程式を求め、ステップ8の「スキャン行カウ
ンタ初期設定」で対象とするスキャン行カウンタの初期
設定を実行し、ステップ9の「スキャン行終了」の判定
で対象とするスキャン行がない場合にはその動作を終了
し、また、対象とすべきスキャン行が存在する場合には
ステップ32に移行する。
Next, the operation will be described in detail based on the flowchart of FIG. First, in the step 7 "correction constant calculation" (1)
The parameters a, b, c, d, e, f, g, and h of the formula are calculated, and in step 31, “In clipping constant calculation (3)
The parameters of the formula a ', b', c ', d', e ', f',
g ', h', and the equations of the straight lines on the four sides of the rectangular area before the calculation of the expression (1) corresponding to the clipping rectangular area after the calculation of the expression (1) are obtained, and the "scan line counter initial setting" in step 8 The initial setting of the target scan line counter is performed in step 9, and if there is no target scan line in the determination of "scan line end" in step 9, the operation is terminated, and the target scan line is determined. If it exists, the process proceeds to step 32.

そしてステップ32の「x方向分類」にて対象スキャン
行が全く描画の必要のない「頂点(xC4,yC4)のx座
標未満であるか、頂点(xC2,yC2)のx座標を越えて
いる」ものか、あるいは、頂点(xC4,yC4)のx座標
以上で頂点(xC1,yC1)のx座標未満であるか、頂点
(xC1,yC1)のx座標以上であり、頂点(xC3
C3)のx座標以下であるか、(xC3,yC3)のx座標
を越えていて頂点(xC2,yC2)のx座標以下であるか
を分類する。
Then, in the "x direction classification" of step 32, the target scan line is less than the x coordinate of the vertex (x C4 , y C4 ) which does not need to be drawn at all, or the x coordinate of the vertex (x C2 , y C2 ) is set. or beyond are "ones, or vertex (x C4, y C4) or is less than the x-coordinate of the vertex (x C1, y C1) in the x-coordinate or more, more x-coordinate of the vertex (x C1, y C1) And the vertex (x C3 ,
x Do is the coordinates following y C3), to classify or less than the x coordinate of (vertices not exceed the x-coordinate of x C3, y C3) (x C2, y C2).

ステップ32の後、ステップ33の「範囲外」の判定
で、対象スキャン行が全く描画の必要のないものである
と分類されている場合はステップ12に移行し、それ以
外の分類であればステップ34へ移行する。ステップ1
2の「スキャン行カウントアップ」ではスキャン行のカ
ウントを1つ増加させステップ9に移行する。
After step 32, if the target scan line is classified as a line that does not need to be drawn in the “out of range” determination in step 33, the process proceeds to step 12. If it is any other classification, the process proceeds to step 12. Move to 34. Step 1
In the "scan row count-up" of 2, the scan row count is incremented by 1 and the process proceeds to step 9.

ステップ34の「y方向上限算出」では、ステップ32
の分類とステップ31の算出定数をもとにy方向の上限
を求め、ステップ35の「y方向下限算出」で、同様に
y方向を求め、ステップ10の「スキャン内ランレング
ス終了」の判定で、対象とするスキャン行内のクリッピ
ング演算と変換演算を実施していないランレングスデー
タが存在していない場合には、前述のステップ12の
「スキャン行カウントアップ」に移行し、存在する場合
にはステップ36に移行する。
In the “y-direction upper limit calculation” of step 34, step 32
The upper limit in the y-direction is obtained based on the classification of No. and the calculation constant in step 31, and the y-direction is similarly obtained in the “y-direction lower limit calculation” in step 35, and in the determination of “in-scan run length end” in step 10. If there is no run length data for which the clipping calculation and the conversion calculation have not been executed in the scan line of interest, the process moves to “scan line count up” in step 12 described above, and if there is, the step is executed. Move to 36.

ステップ36の「始点y≦上限」の判定で、ランレング
スベクトルの始点y座標が上限以下であればステップ3
7に移行し、上限を越えていればステップ10に移行す
る。ステップ37の「終点y≧下限」の判定で、ランレ
ングスベクトルの終点のy座標が下限以上であればステ
ップ38に移行し、下限未満であればステップ10に移
行する。
If the start point y coordinate of the run length vector is less than or equal to the upper limit in the determination of “start point y ≦ upper limit” in step 36, step 3
If it exceeds the upper limit, the process proceeds to step 10. If the y coordinate of the end point of the run length vector is equal to or larger than the lower limit in the determination of "end point y ≧ lower limit" in step 37, the process proceeds to step 38, and if it is less than the lower limit, the process proceeds to step 10.

ステップ38の「始点y<下限」の判定で、ランレング
スベクトルの始点のy座標が下限未満である場合はステ
ップ39の「始点y=下限」にて始点のy座標を下限値
としてベクトルの不要部を切り取ってからステップ40
に移行し、ランレングスベクトルの始点のy座標が下限
以上である場合はただちにステップ40に移行する。
If the y-coordinate of the start point of the run-length vector is less than the lower limit in the determination of "start point y <lower limit" in step 38, the vector is unnecessary with the y-coordinate of the start point as the lower limit value in "start point y = lower limit" in step 39. Step 40 after cutting off parts
If the y-coordinate of the start point of the run-length vector is not less than the lower limit, the process immediately proceeds to step 40.

同様にステップ40の「終点y>上限」で、ランレング
スベクトルの終点のy座標が上限値を越えている場合に
は、ステップ41の「終点y=上限」にてベクトルの不
要部を切り取る。
Similarly, in step 40 "end point y> upper limit", if the y coordinate of the end point of the run-length vector exceeds the upper limit value, unnecessary portions of the vector are cut out in step 41 "end point y = upper limit".

そして、ステップ11の「(1)式の演算」にて、不要
部の切り取られたベクトルの始点と終点の座標について
(1)式の演算を行ない、ステップ30の「ベクトル描
画」にて出力デバイスに出力する。
Then, in "calculation of formula (1)" in step 11, the calculation of formula (1) is performed for the coordinates of the start point and the end point of the vector of the unnecessary portion, and the output device is calculated in "vector drawing" in step 30. Output to.

すなわち、ステップ31でクリッピング定数算出、ステ
ップ8でスキャン行初期設定し、ステップ9でスキャン
行終了かを判断し、NOであればステップ12,32,3
3,34,35の演算を行ない(ただし、ステップ3
4,35の実行はステップ33の判定結果による)、ラ
ンレングスベクトルがクリッピング領域内に存在し得る
スキャン行内のランレングスベクトルに対してステップ
10,36,37,38,39,40,41,11を行
なう(ただし、ステップ38,39,40,41,11
はクリッピング領域内に存在するランレングスベクトル
に対してだけ実行される)。
That is, in step 31, the clipping constant is calculated, in step 8, the scan line is initialized, and in step 9, it is determined whether the scan line is finished. If NO, steps 12, 32, 3
3, 34, 35 are calculated (however, step 3
4 and 35 are executed according to the determination result of step 33), and the step 10, 36, 37, 38, 39, 40, 41, 11 is executed for the run length vector in the scan row in which the run length vector may exist in the clipping area. (However, steps 38, 39, 40, 41, 11
Is only performed on run-length vectors that lie in the clipping region).

例えば、総スキャン数が1000行で、同一スキャン内
にランレングスベクトルが平均10本あり、クリッピン
グ領域内に全体の1/2のスキャン行と総ランレングス
ベクトルの1/4のランレングスベクトルが存在する場
合には、図面全体では、概ね以下の演算量となる。
For example, the total number of scans is 1000, the average number of run length vectors is 10 in the same scan, and half the scan lines and 1/4 of the total run length vector are in the clipping region. In that case, the calculation amount is approximately as follows in the entire drawing.

なお、各ステップは、例えばFORTRAN言語を用い
たプログラミングでは2行前後でプログラム出来る量で
ある。ただし、ステップ7と31はFORTRANで約
100行程度を要すが1回しか実行しないので、全体の
処理量から見れば無視できる。
Note that each step is a quantity that can be programmed in about two lines in programming using the FORTRAN language, for example. However, steps 7 and 31 require about 100 lines in FORTRAN but are executed only once, so they can be ignored in terms of the total processing amount.

上記実施例では第2図に示すように(1)式演算前のク
リッピング領域の頂点がx座標値の小さい方から頂点
(xC4,yC4)、頂点(xC1,yC1)、頂点(xC3,y
C3)、頂点(xC2,yC2)の順に並んでいるが、一般に
は(1)式演算前のクリッピング領域の頂点をx座標値
の小さい順にソートし、頂点(xC1,yC1)と頂点(x
C2,yC2)、頂点(xC2,yC2)と頂点(xC3
C3)、頂点(xC3,yC3)と頂点(xC4,yC4)、頂
点(xC4,yC4)と頂点(xC1,yC1)がそれぞれ接続
している関係から、あるスキャンに対する上限値と下限
値を求める。
In the above-described embodiment, as shown in FIG. 2, the vertices of the clipping region before the calculation of the expression (1) are the vertexes (x C4 , y C4 ), the vertices (x C1 , y C1 ), the vertices ( x C3 , y
C3 ) and the vertices (x C2 , y C2 ) are arranged in this order. Generally, the vertices of the clipping region before the calculation of equation (1) are sorted in ascending order of the x coordinate value, and the vertices (x C1 , y C1 ) are obtained. Vertex (x
C2 , y C2 ), vertex (x C2 , y C2 ) and vertex (x C3 ,
y C3 ), vertex (x C3 , y C3 ) and vertex (x C4 , y C4 ), vertex (x C4 , y C4 ) and vertex (x C1 , y C1 ) are connected to each other Find the upper and lower limits for.

又、(1)式の図形変換演算は特願昭60−7213号
に示されている高速演算方式としてもよい。
The graphic conversion operation of the equation (1) may be the high speed operation method shown in Japanese Patent Application No. 60-7213.

なお、上記実施例では入力画像の(1)式の変換演算後
の一部の矩形領域をクリッピングしたが、矩形領域は一
般に四角形なら何でもよい。又、クリッピング領域内の
ベクトルのみを描画する例を記したが、反対にクリッピ
ング領域外のベクトルのみを描画することを同様に実現
できる。
Although a part of the rectangular area of the input image after the conversion calculation of the expression (1) is clipped in the above embodiment, the rectangular area may be any rectangular shape. Further, although the example of drawing only the vector inside the clipping area is described, conversely, drawing only the vector outside the clipping area can be similarly realized.

〔発明の効果〕〔The invention's effect〕

以上のように、この発明によれば、曲がってセットされ
た入力図形を一定間隔にスキャンしてランレングスデー
タを得た後、画像のゆがみ補正を行う変換演算式に用い
る補正定数を求め、また、同一スキャン内では一定であ
る座標値に基づいてクリッピング処理した後、このクリ
ッピング処理されたランレングスベクトルを上記補正定
数を用いてゆがみ補正するようにしたので、演算の効率
化により、処理時間が短縮化され、高速図形クリッピン
グ処理を実現することができるという効果がある。
As described above, according to the present invention, after the input figure set in a curved manner is scanned at a constant interval to obtain run length data, the correction constant used in the conversion calculation formula for correcting the image distortion is obtained, and , After the clipping process is performed based on the coordinate value that is constant in the same scan, the run length vector subjected to the clipping process is subjected to the distortion correction using the correction constant, so that the processing time is improved by the efficiency of the calculation. There is an effect that it is shortened and high-speed graphic clipping processing can be realized.

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

第1図−(1),(2)はこの発明の一実施例を示すク
リッピング方法のフローチヤート、第2図は図形変換演
算を施す前後のクリッピング領域説明図、第3図はこの
発明の一実施例におけるベクトルの切り取り説明図、第
4図はランレングスベクトルの一般説明項、第5図は図
形変換演算を施す前後の画像領域全体の説明図、第6図
はクリッピングの一般説明図、第7図は従来のクリッピ
ング方法における空間符号説明図、第8図は従来のクリ
ッピング方法における1つのベクトルのクリッピング説
明図、第9図−(1),(2)は従来のクリッピング方
法のフローチヤート、第10図は画像処理システム図で
ある。 11は1式の演算、(A)は画像入出力装置、(B)は
画像メモリ装置、(D)はイメージプロセシングデバイ
ス。 なお、図中、同一符号は同一又は相当部分を示す。
1- (1) and (2) are flow charts of a clipping method showing an embodiment of the present invention, FIG. 2 is an explanatory view of a clipping area before and after performing a graphic conversion operation, and FIG. FIG. 4 is a general explanatory diagram of a run length vector, FIG. 5 is an explanatory diagram of the entire image area before and after performing a graphic conversion operation, FIG. 6 is a general explanatory diagram of clipping, and FIG. FIG. 7 is an explanatory diagram of a space code in the conventional clipping method, FIG. 8 is an explanatory diagram of clipping of one vector in the conventional clipping method, and FIGS. 9- (1) and (2) are flow charts of the conventional clipping method. FIG. 10 is an image processing system diagram. 11 is a set of operations, (A) is an image input / output device, (B) is an image memory device, and (D) is an image processing device. In the drawings, the same reference numerals indicate the same or corresponding parts.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】画像スキャナによって図形を一定間隔でス
キャンニングし、そのスキャンニングによって得た図形
のランレングスデータを、画像メモリデバイスに取込
み、イメージプロセシングデバイスによって変換演算式
を実行し、前記演算の結果の一部の矩形領域をクリッピ
ングして、出力デバイスに出力する画像クリッピング方
法において、前記画像のゆがみ補正を行う変換演算式に
用いる補正定数を求める工程と、前記変換演算式による
変換演算後のクリッピング矩形領域が変換演算前にはど
こに位置するかを算出する逆変換演算式に用いるクリッ
ピング定数を求める工程と、同一スキャン内では一定で
ある座標値に基づいて前記クリッピング矩形領域に対す
る前記画像の該座標値と直交する軸方向の上限または下
限を算出しクリッピング処理する工程に、前記補正定数
を適用して前記変換演算式を実行し前記クリッピング演
算処理された画像のゆがみを補正する工程とからなるこ
とを特徴とする画像クリッピング方法。
1. A graphic is scanned by an image scanner at regular intervals, run length data of the graphic obtained by the scanning is taken into an image memory device, and a conversion arithmetic expression is executed by an image processing device to execute the arithmetic operation In the image clipping method of clipping a part of the rectangular area of the result and outputting it to the output device, a step of obtaining a correction constant used in a conversion arithmetic expression for correcting the distortion of the image, and a step of performing a conversion arithmetic operation after the conversion arithmetic expression A step of obtaining a clipping constant used in an inverse transformation calculation formula for calculating where the clipping rectangular area is located before the transformation operation, and a step of obtaining the clipping rectangular area of the image for the clipping rectangular area based on a coordinate value that is constant in the same scan. Calculate the upper or lower limit in the axial direction orthogonal to the coordinate value and clip The step of graying process, the image clipping method characterized by comprising a step of correcting the distortion of the by applying the correction constant execute the transformation computation equation the clipping processing images.
JP61038540A 1986-02-24 1986-02-24 Image clipping method Expired - Fee Related JPH0634237B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61038540A JPH0634237B2 (en) 1986-02-24 1986-02-24 Image clipping method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61038540A JPH0634237B2 (en) 1986-02-24 1986-02-24 Image clipping method

Publications (2)

Publication Number Publication Date
JPS62196772A JPS62196772A (en) 1987-08-31
JPH0634237B2 true JPH0634237B2 (en) 1994-05-02

Family

ID=12528115

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61038540A Expired - Fee Related JPH0634237B2 (en) 1986-02-24 1986-02-24 Image clipping method

Country Status (1)

Country Link
JP (1) JPH0634237B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11748923B2 (en) 2021-11-12 2023-09-05 Rockwell Collins, Inc. System and method for providing more readable font characters in size adjusting avionics charts
US11915389B2 (en) 2021-11-12 2024-02-27 Rockwell Collins, Inc. System and method for recreating image with repeating patterns of graphical image file to reduce storage space
US11887222B2 (en) 2021-11-12 2024-01-30 Rockwell Collins, Inc. Conversion of filled areas to run length encoded vectors
US11954770B2 (en) 2021-11-12 2024-04-09 Rockwell Collins, Inc. System and method for recreating graphical image using character recognition to reduce storage space
US11842429B2 (en) 2021-11-12 2023-12-12 Rockwell Collins, Inc. System and method for machine code subroutine creation and execution with indeterminate addresses

Also Published As

Publication number Publication date
JPS62196772A (en) 1987-08-31

Similar Documents

Publication Publication Date Title
JP2790815B2 (en) Image data compression method
US5268999A (en) Modeling method and system using solid data having functional structure and normal projection drawing dimensional format
JP2690110B2 (en) Scan conversion method
US4766556A (en) Three-dimensional solid object manipulating apparatus and method therefor
US5774124A (en) Finite element modeling method and computer system for converting a triangular mesh surface to a quadrilateral mesh surface
US5091976A (en) Image coding method for extracting, segmenting, and coding image contours
EP0279156A2 (en) Apparatus and method for vectorization of incoming scanned image data
JP3391864B2 (en) Image data processing method and apparatus and graphic system
US5398311A (en) Character processing apparatus and method for processing character data as an array of coordinate points of contour lines
EP0596667A1 (en) Processing image data
JPH01304588A (en) Clipping processing system
JPH10164370A (en) Method and device for interpolating gradation of image, image filtering method and image filter
JPH0634237B2 (en) Image clipping method
JP2002099911A (en) Raster image vector conversion method based on computerized automation
US5293471A (en) Graphics processing system for deleting one of overlapping line and graphics images
JP2837584B2 (en) How to create terrain data
JP3172498B2 (en) Image recognition feature value extraction method and apparatus, storage medium for storing image analysis program
JP2845107B2 (en) Image processing device
JPH06176107A (en) Method and device for processing distance picture
JPH06274149A (en) Method and device for varying width of outline font
JPH09106453A (en) Picture deforming method
JP3305395B2 (en) Figure division device
JP2557872B2 (en) Image feature extraction method
US7512253B2 (en) Method of digitizing graphic information
JP2637395B2 (en) Figure conversion method

Legal Events

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