JPH03180985A - Method and device for detecting color information in image processing - Google Patents
Method and device for detecting color information in image processingInfo
- Publication number
- JPH03180985A JPH03180985A JP1320882A JP32088289A JPH03180985A JP H03180985 A JPH03180985 A JP H03180985A JP 1320882 A JP1320882 A JP 1320882A JP 32088289 A JP32088289 A JP 32088289A JP H03180985 A JPH03180985 A JP H03180985A
- Authority
- JP
- Japan
- Prior art keywords
- color
- image processing
- condition
- detected
- coordinates
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Image Analysis (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要〕
画像情報における色情報を検出して処理する画像処理に
おける色情報検出方法及び色情報検出装置に関し、
色情報の検出を容易かつ最小限のロスタイムで高速に実
行され、外部のアプリケーションプログラムを容易に作
成できることを目的とし、所定のコマンド処理を行うた
めに、画像情報を走査し、所定のモードによって指定さ
れた条件色の先端を検出する画像処理における色情報検
出方法において、前記条件色の先端を走査する工程と、
該条件色の先端が検出された場合に1.該先端の座標を
第1のレジスタに記憶させる二[稈と、前記モードによ
り、該条件色の先端の座標より、該条件色の後端まで走
査を続行する”[程と、該条件色の後端が検出された場
合に、該後端の座標を第2のレジスタに記憶させる工程
と、を有するように構成する。[Detailed Description of the Invention] [Summary] Regarding a color information detection method and a color information detection device in image processing that detect and process color information in image information, the detection of color information is easily performed at high speed with minimal loss time. Color information detection in image processing scans image information and detects the leading edge of a condition color specified by a predetermined mode in order to perform predetermined command processing. In the method, scanning the leading edge of the condition color;
1. When the tip of the condition color is detected. 2. Store the coordinates of the tip in the first register. 2. In the above mode, continue scanning from the coordinates of the tip of the conditional color to the rear end of the conditional color. The method is configured to include the step of, when the rear end is detected, storing the coordinates of the rear end in a second register.
〔産業上の利用分野]
本発明は画像情報における色情報を検出し処理を行う画
像処理における色情報検出方法及び色情報検出装置に関
する。[Industrial Application Field] The present invention relates to a color information detection method and a color information detection device in image processing for detecting and processing color information in image information.
近年、画像処理における色情報の検出は、ペイント等に
頻繁に使用されており、色情報検出の高速性、処理プロ
グラムの簡易化が要求されている。In recent years, detection of color information in image processing has been frequently used for painting and the like, and there is a demand for high-speed detection of color information and simplification of processing programs.
このため、処理情報を与えるためのロスタイムを最小限
にし、処理結果の判断を容易にする必要がある。Therefore, it is necessary to minimize the loss time for providing processing information and to make it easy to judge the processing results.
従来より、画像処理では、色情報の検出を、画像処理メ
モリに記憶された画像情報を境界色サーチ等により画像
処理プロセッサで行い、ペイント等の処理を行っている
。Conventionally, in image processing, color information is detected by an image processing processor using a boundary color search or the like on the image information stored in an image processing memory, and processing such as painting is performed.
画像処理プロセッサにおける境界色サーチは、画像情報
の水平方向にスキャン(走査)して境界色が1回検出し
た時点で処理を終了する。そして、これに基づいてペイ
ント処理を行う場合、第1の段階としてオペレータから
の指定する座標から水平方向に境界色を算出し、第2の
段階として該境界色の座標から該境界色がなくなるまで
再度水平方向にスキャンする。つづいて、第3の段階と
して該境界色がな(なった点の座標から次の境界色まで
スキャンする。そして、第4の段階として該境界色がな
くなった点の座標を原点として次の境界色までの座標を
終点として直線を引く。これらの処理を繰返すことによ
り任意領域にペイントを行っている。The boundary color search in the image processing processor ends when a boundary color is detected once by scanning the image information in the horizontal direction. When performing painting processing based on this, the first step is to calculate the border color in the horizontal direction from the coordinates specified by the operator, and the second step is to calculate the border color from the coordinates of the border color until the border color disappears. Scan horizontally again. Next, in the third step, the coordinates of the point where the boundary color disappears are scanned to the next boundary color.Then, in the fourth step, the coordinates of the point where the boundary color disappears are used as the origin, and the next boundary color is scanned. A straight line is drawn with the coordinates up to the color as the end point. By repeating these processes, arbitrary areas are painted.
しかし、オペレータの指定する座標から、境界色まで、
さらに次の境界色までスキャンさせる処理は、処理パラ
メータ(サーヂ開始座標、ザーヂ完了座標)を、オペレ
ータにおいて画像処理プロセッサに対して与えなければ
ならない。従って、各段階の処理を開始するまで所定の
時間を要することからロスタイムを生じることになり、
処理速度が低下するという問題がある。加えて、該ロス
タイムは1ライン走査毎の時間であり、任意領域のペイ
ントでは垂直方向の分が乗されて多大なロスタイムを生
じるという問題がある。However, from the coordinates specified by the operator to the border color,
Furthermore, in order to scan to the next boundary color, the operator must provide processing parameters (surge start coordinates, surge completion coordinates) to the image processing processor. Therefore, it takes a certain amount of time to start processing each stage, resulting in loss time.
There is a problem that processing speed decreases. In addition, the loss time is the time for each line scan, and when painting an arbitrary area, there is a problem in that it is multiplied by the amount in the vertical direction, resulting in a large amount of loss time.
また、上記第1段階から第4段階までの処理におけるパ
ラメータの設定及び処理結果の判断等(境界色があった
か否か等〉を、第1段階から第3段階までに画像処理プ
ロセッサ外部のアプリケジョン〈目的達成のための仕事
)において処理が終了する毎に判断しなければならない
。すなわち、上記判断は一度には行えないことから、ア
プリケーションプログラムが複雑になるという問題があ
る。In addition, the settings of parameters and the judgment of processing results (whether or not there is a boundary color, etc.) in the processing from the first stage to the fourth stage are performed by an application external to the image processing processor from the first stage to the third stage. A decision must be made every time a process is completed in <work to achieve a goal. That is, since the above judgment cannot be made all at once, there is a problem that the application program becomes complicated.
そこで、本発明は上記課題に名みなされたもので、色情
報の検出を容易かつ最小限のロスタイムで高速に実行さ
れ、外部のアプリケーションプログラムを容易に作成で
きる画像処理における色情報検出り法及び色情報検出装
置を提供することを目的どする。SUMMARY OF THE INVENTION The present invention has been made to address the above-mentioned problems, and includes a method and method for detecting color information in image processing that allows color information to be detected easily and at high speed with minimal loss time, and that makes it possible to easily create an external application program. The purpose of the present invention is to provide a color information detection device.
(課題を解決するための手段)
第1図に、本発明における第1の発明の詳細な説明図を
示す。第1図に示す第1の発明は、所定のコマンド処理
を行うために、画像情報を走査し、所定のモードによっ
て指定された条件色の先端を検出する色情報検出方法で
あって、図中、ステップ1の工程は指定された条件色の
先端を走査する。(Means for Solving the Problems) FIG. 1 shows a detailed explanatory diagram of the first aspect of the present invention. The first invention shown in FIG. 1 is a color information detection method that scans image information and detects the leading edge of a condition color specified by a predetermined mode in order to perform predetermined command processing. , Step 1 scans the leading edge of the specified condition color.
ステップ2の工程は、該条件色の先端が検出された場合
に、該先端の座標を第1のレジスタに記憶させる。ステ
ップ3の工程は、モードにより、該条件色の先端の座標
より、該条件色の後端まで走査を続行する。ステップ4
のL程は、該条件色の後端が検出された場合に、該後端
の座標を第2のレジスタに記憶させる。In step 2, when the leading edge of the condition color is detected, the coordinates of the leading edge are stored in the first register. In step 3, depending on the mode, scanning continues from the coordinates of the leading edge of the conditional color to the trailing edge of the conditional color. Step 4
When the trailing edge of the condition color is detected, the coordinates of the trailing edge are stored in the second register.
また、第2図に第2の発明の原理説明図を示す。Further, FIG. 2 shows a diagram explaining the principle of the second invention.
第2図中、ステップ10.11A、12.13Aは第1
図のステップ1.2.3.4とそれぞれ同様である。ス
テップ11Bは、前記条件色の先端が検出された場合に
(ステップ10)、該先端の座標を第1のレジスタに記
憶させると共に(ステップ11A)、第1のフラグをセ
ットする。ステップ13Bは、前記条件色の後端が検出
された場合に(ステップ12)、該後端の座標を第2の
レジスタに記憶させると共に〈ステップ13A)、第2
のフラグをセットする。In Figure 2, steps 10.11A and 12.13A are the first
These steps are respectively similar to steps 1.2.3.4 in the figure. In step 11B, when the leading edge of the condition color is detected (step 10), the coordinates of the leading edge are stored in a first register (step 11A), and a first flag is set. In step 13B, when the trailing edge of the condition color is detected (step 12), the coordinates of the trailing edge are stored in a second register, and <step 13A)
set the flag.
さらに、第3の発明は、第1の発明における条件色の後
端を検出するための色情報検出装置であり、所定のコマ
ンド処理を行うために、画像情報を走査し、所定のモー
ドによって指定された条件色の先端を検出する画像処理
プロセラ勺を有する画像処理における色情報検出装置に
おいて、前記画像処理プロセッサは、前記条件色の先端
を検出した後、該条件色の非検出まで走査を続行し、該
条件色の後端を検出する処理手段を有するように構成す
る。Furthermore, a third invention is a color information detection device for detecting the trailing edge of the condition color in the first invention, which scans image information and specifies a color according to a predetermined mode in order to perform predetermined command processing. In the color information detection device for image processing having an image processing processor that detects the leading edge of a condition color, the image processing processor continues scanning after detecting the leading edge of the condition color until the condition color is not detected. and a processing means for detecting the trailing edge of the condition color.
第1図に示すように、第1の発明は所定のモードによっ
て、画像情報を走査して最初の条件色(モードによって
指定された条件の色)の先端を検出した後、該条件色の
後端まで走査を続行させている。そして、−度の」マン
ト処理で条件色の先端の座標と該条件色の後端の座標を
記憶させている。このような色情報検出方法における条
件色の後端の検出は、第3の発明である色情報検出装置
の画像処理プロセッサにおける処理手段により実現され
る。As shown in FIG. 1, the first invention scans image information in a predetermined mode to detect the leading edge of the first condition color (condition color specified by the mode), and then The scan continues until the end. Then, the coordinates of the leading edge of the conditional color and the coordinates of the trailing edge of the conditional color are stored in the cloak process of -degree. Detection of the trailing edge of the condition color in such a color information detection method is realized by the processing means in the image processing processor of the color information detection device according to the third aspect of the invention.
これにより、ペイント等で使用される色情報検出が容易
に行うことができ、最小限のロスタイムで高速に実行す
ることが可能となる、。This makes it easy to detect color information used in painting, etc., and enables high-speed execution with minimal loss time.
また、第2の発明は、条件色の先端及び後端の座標を記
憶させ、これと同時にそれぞれのフラグをセットしてい
る。Further, in the second invention, the coordinates of the leading edge and trailing edge of the condition color are stored, and at the same time, respective flags are set.
従って、−度のコマンド処理実行後にそれぞれのフラグ
を読出すことにより、複数モードであっても外部のアプ
リケーションプログラムを容易に作成可能となる。Therefore, by reading each flag after executing command processing twice, it is possible to easily create an external application program even in multiple modes.
〔実施例)
第3図に本発明の一実施例の構成ブロック図を示す。第
3図は画像処理装置を示しており、CPU1.画像処理
プロセッサ21画像処理メモリ3及びCRT4により構
成され、画像処理プロセッサ2に本発明を実施する色情
報検出装置が含まれる。CPU1は、画像処理プロセラ
υ2に、例えばrLINEJ、rsRc口」等のコマン
ド及び例えば始点、終点、色比較色等のパラメータを供
給する。画像処理プロセッサ2はCPU1により指示さ
れたコマンド、パラメータ及び所定のモード(後述する
)に基づいて、指示された各種パラメータに従い画像処
理を行う。画像処理メモリ3は、画像処理プロセッサ2
における描画データ等の処理結果を記憶させるためのメ
モリであり、このメモリ3のデータに対応してCRT4
上に画像が表示される。そして、コマンドがrsRc日
」〈ザーヂ)時には、画像処理メモリ3の情報を画像処
理プロセッサ2が読出すことにより色比較を行うもので
ある。[Embodiment] FIG. 3 shows a configuration block diagram of an embodiment of the present invention. FIG. 3 shows an image processing device, in which CPU1. The image processing processor 21 is composed of an image processing memory 3 and a CRT 4, and the image processing processor 2 includes a color information detection device implementing the present invention. The CPU 1 supplies the image processing processor υ2 with commands such as "rLINEJ, rsRc 口" and parameters such as a starting point, an ending point, and a color comparison color. The image processing processor 2 performs image processing according to various parameters instructed by the CPU 1, based on commands, parameters, and a predetermined mode (described later). The image processing memory 3 is connected to the image processing processor 2
This is a memory for storing processing results such as drawing data in the CRT 4 corresponding to the data in this memory 3.
The image is displayed above. When the command is rsRc, the image processing processor 2 reads information from the image processing memory 3 to perform color comparison.
次に、第4図に画像処理プロセッサ2の概略構成ブロッ
ク図を示す。第4図中、5はホストバスIF(インター
フェース)であり、CPU1とのインターフェース及び
CPU1からのコマンド解析を行うもので、コマンド解
析結果及びCPU1からの各種パラメータ(始点、終点
情報等)を描画7490部6に送出する1、描画マイク
ロ部6は、格納されているマイクロプログラムにより、
ホストバスIF5を介して入力されるCPU1のコマン
ドとコマンド解析の結果を、ラスタ処理部7で動作可能
に環境を整える。例えば、CPLJlから送られてくる
始点、終点情報である(0.0>。Next, a schematic block diagram of the image processing processor 2 is shown in FIG. In FIG. 4, 5 is a host bus IF (interface), which interfaces with the CPU 1 and analyzes commands from the CPU 1. It draws 7490 the command analysis results and various parameters (start point, end point information, etc.) from the CPU 1. 1, the drawing micro unit 6 sends the data to the micro program stored in it.
An environment is prepared so that the raster processing section 7 can operate on the commands of the CPU 1 and the results of command analysis input via the host bus IF5. For example, it is the start point and end point information sent from CPLJl (0.0>.
(10,10>のような座標情報をアドレスに変換し、
rsRc日]時のモードを解析し、適切な処理コマンド
をラスタ処理部7に発行する。この描画マイクロ部6が
本発明の第1及び第2の発明の第1及び第2のレジスタ
を有し、第1及び第2のフラグをセラ1〜する。また、
ラスタ処理部7は、描画マイクロ部6より入力したコマ
ンド及び各種情報(パラメータ等)に基づいて描画処理
及び色情報検出処理を行う。このラスタ処理部7が第3
の発明における処理手段を含むものである。そして、グ
ラフィックIF8は、リフレッシュアドレス(情報消失
防止のための書直しアドレス)の発生及びラスタ処理部
7からのアドレス、描画ブタ及び表示アドレスを調停し
て、画像処理プロセッサ2の外部の画像処理メモリ3(
第3図)に送出する。(Convert coordinate information such as 10, 10> to an address,
rsRc date] and issues an appropriate processing command to the raster processing unit 7. This drawing micro section 6 has first and second registers according to the first and second aspects of the present invention, and sets the first and second flags. Also,
The raster processing section 7 performs drawing processing and color information detection processing based on commands and various information (parameters, etc.) input from the drawing micro section 6. This raster processing section 7
This invention includes the processing means in the invention. Then, the graphic IF 8 generates a refresh address (a rewrite address to prevent information loss), arbitrates the address from the raster processing unit 7, the drawing button, and the display address, and generates a refresh address (a rewrite address to prevent information loss) and arbitrates the address, drawing button, and display address to the image processing memory external to the image processing processor 2. 3(
Figure 3).
次に、第5図にラスタ処理部7の構成ブロック図を示す
。第5図中、9はDDA (デジタル微分解析〉であり
、描画マイクロ部6からデータバスを介して送出される
コマンド及び始点、終点等の各種情報を基に、−度に処
理可能なピクセル(画素〉数を副筒する。そして、DD
A9は、別に直線が正方向又は負方向に引かれるのかの
情報を発生し、また、直線処理が最後まで行われたかの
情報を発生し、さらに、水平方向の処理が終了して垂直
方向にポインタを動かすべき信号を発生する1
機能を有する。10はアドレスS1算部であり、DDA
9からの情報により次にアクセスすべきアドレスを■算
し、又はDDA9及び内包されるアドレス計算用ALU
(演算論理装置〉等の各部を制御する。このアドレス引
算部10がラスタ処理部7の主制御的働きをしており、
第3の発明における処理手段の主要部を構成する。11
はアクセス制御部であり、グラフィックIF8ヘラスタ
処理部7で割算されたアドレスを送出し、画像プロセッ
サ2(第3図)の外部に出力させる等のグラノイツクア
ドレスの出力要求をグラフィックIF8に出力する。そ
して、12は論理演算部であり、グラフィックIF8を
介して画像処理プロセッサ2の外部から取込まれた画像
データ又は情報と、画像処理プロセッサ2内に蓄えられ
ている情報とを、論理演算又は色比較(又は大小比較〉
を行う。Next, FIG. 5 shows a block diagram of the configuration of the raster processing section 7. In FIG. 5, 9 is DDA (Digital Differential Analysis), which processes pixels ( DD
A9 separately generates information on whether the straight line is drawn in the positive direction or negative direction, and also generates information on whether the straight line processing has been completed to the end, and also displays the pointer in the vertical direction when the horizontal direction processing is completed. It has the function of generating a signal to move the 10 is an address S1 calculation unit, and DDA
■ Calculate the address to be accessed next based on the information from DDA 9, or DDA 9 and the included ALU for address calculation.
(Controls each part of the arithmetic logic unit) etc. This address subtraction unit 10 functions as the main control of the raster processing unit 7.
It constitutes the main part of the processing means in the third invention. 11
is an access control unit, which sends out the address divided by the graphic IF 8 heraster processing unit 7 and outputs a request to output the granoic address to the graphic IF 8, such as outputting it to the outside of the image processor 2 (FIG. 3). . Reference numeral 12 denotes a logical operation section, which performs logical operation or color processing on image data or information taken in from outside the image processing processor 2 via the graphic IF 8 and information stored within the image processing processor 2. Comparison (or size comparison)
I do.
この論理演算部12で処理された結果を、画像処理プロ
セッサ2の外部に出力する場合には、Gデータバスを介
してグラフィックIF8に送出して行う。また、論理演
算部12は画像処理に必要な2
マスク情報(文字パターンの制御情報)を生成する。When outputting the results processed by the logic operation section 12 to the outside of the image processing processor 2, it is sent to the graphic IF 8 via the G data bus. Furthermore, the logic operation unit 12 generates 2 mask information (character pattern control information) necessary for image processing.
上記の装置における画像処理の概要を説明すると、まず
、CPU1より送出されるコマンド及びパラメータがホ
ストバスIF5を経て描画マイクロ部6に送られ、該描
画マイクロ部6で現存実行しなければならないコマンド
が解析される。実行コマンドがSRC口(サーチ−〉コ
マンドであれば、描画フィクロ部6中のフィクロプログ
ラムよりラスタ処理部7に対してサーチ処理要求及び各
種パラメータ(始点、終点情報等〉が送出される。そし
て、ラスタ処理部7では、描画マイクロ部6からの各種
条件に基づき1ラスタ分の処理を行い、この処理中に比
較色を検出する。To give an overview of the image processing in the above device, first, commands and parameters sent from the CPU 1 are sent to the drawing micro section 6 via the host bus IF5, and the commands that must be currently executed in the drawing micro section 6 are Parsed. If the execution command is an SRC (search) command, a search processing request and various parameters (start point, end point information, etc.) are sent to the raster processing section 7 from the fic program in the drawing fic section 6. The raster processing section 7 processes one raster based on various conditions from the drawing micro section 6, and detects a comparison color during this processing.
また、この検出処理中に比較色が検出されると、その結
果を描画マイクロ部6のマイクロプログラムに通知して
ラスタ処理を終了する。そして、マイクロプログラムは
通知された結果に応答して、比較色が検出された時点の
X、Y座標を第1のレジスタ及び(又は)第2のレジス
タに記憶させるものである。Further, when a comparison color is detected during this detection process, the result is notified to the microprogram of the drawing micro section 6, and the raster process is ended. Then, in response to the notified result, the microprogram stores the X and Y coordinates at the time when the comparison color was detected in the first register and/or the second register.
次に、上記のような色情報検出装@(画像処理プロセッ
サ2)における色情報検出方法を説明する。Next, a method of detecting color information in the color information detection device (image processing processor 2) as described above will be explained.
第6図は、CPU 1から画像処理プロセッサ2へ送出
されるSRC口(サーチ)コマンドの場合のコマンド体
系図(第6図〈八))、及び色情報検出における画像情
報を走査するパラメータの体系図(第6図(B)〉であ
る3、第6図(A>はモード指定のフィールドであり、
例えば、ビット並びで14.15D−ドの指定で4種類
のモードが選択される(なお、13コードはDon′t
Careである〉。また、第6図(B)は画像情報を
走査する座標を指定するためのフィールド及び色比較の
基準となる色(条件色)を指定する比較色コードのフィ
ールドである。なお、走査は水平方向の場合を示してお
り、従ってY座標の始点と終点とは同一であり、終点に
おける16〜31]−ドは1)on−t Care テ
あル5.また、比較色−1−t’ ハ任意に設定される
。Fig. 6 shows a command system diagram (Fig. 6 (8)) in the case of the SRC search command sent from the CPU 1 to the image processing processor 2, and a parameter system for scanning image information in color information detection. Figure 6 (B) is a field for specifying the mode; Figure 6 (A) is a mode specification field;
For example, four types of modes are selected by specifying the bit sequence 14.15D-code (13 code is Don't
Care〉 Further, FIG. 6(B) shows a field for specifying coordinates for scanning image information and a comparison color code field for specifying a color (condition color) serving as a reference for color comparison. Note that the scanning is shown in the horizontal direction, so the starting point and ending point of the Y coordinate are the same, and the 16 to 31]-does at the ending point are 1) on-t Care 5. Also, the comparison color -1-t' can be set arbitrarily.
次に、以上のようなコマンドの4種類のモードにおける
走査及び色比較を各モード別によって説明する。なお、
この場合の走査、検出における概念図が第7図に示され
るもので、白丸は比較色以外の色の情報であり、黒丸が
比較色の情報である。Next, scanning and color comparison in the four types of command modes as described above will be explained for each mode. In addition,
A conceptual diagram of scanning and detection in this case is shown in FIG. 7, where white circles are information on colors other than the comparison color, and black circles are information on the comparison color.
モードO(」−ドroO,l)の場合、始点パラメータ
によって指定されたX、Y座標より走査を開始してサー
チし、終点パラメータで指定された×1座票に達するま
でに、比較色パラメータで示された色が検出(条件色の
先@)された場合(条件成立)、又は、比較色が検出さ
れずに終点に達した場合(条件不成立)にコマンドが終
了する。条件成立の場合(第7図<A)Pl)には、比
較色が検出された座標を、描画マイクロ部6の第1のレ
ジスタに記憶させると共に、第1のフラグをセットし、
第2のフラグをクリアする(第2のレジスタには何も記
憶させない)。一方、条件不成立の場合は(第7図(B
)P2>、第1及び第2のレジスタには何も記憶させず
、第1及び第2のフラグをクリアする。なお、第1及び
第2のレジス5
り並びに第1及び第2のフラグについては後述する。In the case of mode O (''-doroO,l), scanning starts from the X, Y coordinates specified by the starting point parameter, and the comparison color parameter The command ends when the color indicated by is detected (before the condition color @) (condition met), or when the end point is reached without the comparison color being detected (condition not met). If the condition is satisfied (FIG. 7<A)Pl), the coordinates at which the comparison color was detected are stored in the first register of the drawing micro section 6, and a first flag is set.
Clear the second flag (do not store anything in the second register). On the other hand, if the condition is not satisfied (see Figure 7 (B)
)P2>, nothing is stored in the first and second registers, and the first and second flags are cleared. Note that the first and second registers and the first and second flags will be described later.
次に、モード1(′]コード01−1>の場合は、モー
ドOにおける検出色が比較色パラメータでボされた色以
外の色である場合である。条件成立の場合(第7図(C
)P3)、比較色以外の色が検出〈条件色の先端〉され
た座標を第1のレジスタに記憶させると共に、第1のフ
ラグをセットし、第2のフラグをクリアする。一方、条
件不成立の場合は(第7図(D)P4)、第1及び第2
のフラグをクリアする。Next, in the case of mode 1 (') code 01-1>, the detected color in mode O is a color other than the color omitted by the comparison color parameter.If the condition is satisfied (see Fig. 7 (C
)P3), the coordinates at which a color other than the comparison color is detected (the leading edge of the condition color) are stored in the first register, the first flag is set, and the second flag is cleared. On the other hand, if the condition is not satisfied (Fig. 7 (D) P4), the first and second
clear the flag.
また、モード2(コードMOJ)の場合は、始点パラメ
ータによって指定されたX、Y座標より走査し、終点パ
ラメータで指定された×1座標に達するまでに比較色パ
ラメータで示された色を検出しく条件色の先端P5)、
さらに走査を続行して該比較色でなくなった時点(条件
色の後端〉でコマンドを終了する〈第7図(E)P6)
。この場合、比較色が検出された座標P5を第1のレジ
スタに記憶させ、比較色でなくなった座標P66
を第2のレジスタに記憶させると共に、第1及び第2の
フラグをセットする。又は、比較色を検出した後に、比
較色がなくなる前に終点に達した場合にコマンドが終了
する(第7図(F)P7)。In addition, in the case of mode 2 (code MOJ), scan from the X and Y coordinates specified by the start point parameter, and detect the color indicated by the comparison color parameter before reaching the ×1 coordinate specified by the end point parameter. Condition color tip P5),
Continue scanning further and end the command when the comparison color is no longer used (at the rear end of the condition color) (Figure 7 (E) P6)
. In this case, the coordinate P5 where the comparison color was detected is stored in the first register, the coordinate P66 which is no longer the comparison color is stored in the second register, and the first and second flags are set. Alternatively, the command ends when the end point is reached after the comparison color is detected but before the comparison color runs out (FIG. 7(F) P7).
この場合、比較色が検出された亭標を第1のレジスタに
記憶させると共に、第1のフラグをセットし、第2のフ
ラグをクリアする。又は、比較色コードで指定された色
が終点(Xl)に達するまでに検出できない場合におい
てもコマンドを終了する(第7図(G)P8)。この場
合、第1及び第2のフラグはクリアされる。In this case, the marker whose comparison color was detected is stored in the first register, the first flag is set, and the second flag is cleared. Alternatively, even if the color specified by the comparison color code cannot be detected before reaching the end point (Xl), the command is terminated (P8 in FIG. 7(G)). In this case, the first and second flags are cleared.
次に、モード3(コードr11.l)の場合は、始点パ
ラメータによって指定されたX、Y座標より走査を開始
し、終点パラメータで指定された×1座票に達するまで
の間に、比較色パラメータで求められた色以外の色を検
出しく条件色の先端P9)、さらに走査を続行して該比
較色が検出された場合に(条件色の後端)、コマンドを
終了する〈第7図(ロ)PIO)。この場合、比較色以
外の色が検出された座標P9を第1のレジスタに記憶さ
せ、比較色が検出された座標P10を第2のレジスタに
記憶させると共に、第1及び第2のフラグをセットする
。又は、比較色以外の色を検出した後に、比較色が検出
される前に終点に達した場合にコマンドを終了する(第
7図(I)Pll〉。この場合、比較色以外の色が検出
された座標P9を第1のレジスタに記憶させると共に、
第1のフラグをセットし、第2のフラグをクリアする。Next, in the case of mode 3 (code r11.l), scanning starts from the X and Y coordinates specified by the starting point parameter, and the comparison color If a color other than the color determined by the parameter is detected (at the leading edge of the condition color P9), and the scanning is continued and the comparison color is detected (at the trailing edge of the condition color), the command is terminated (Fig. 7). (b) PIO). In this case, the coordinate P9 at which a color other than the comparison color was detected is stored in the first register, the coordinate P10 at which the comparison color was detected is stored in the second register, and the first and second flags are set. do. Alternatively, after a color other than the comparison color is detected, the command is terminated if the end point is reached before the comparison color is detected (Fig. 7 (I) Pll>. In this case, if a color other than the comparison color is detected, the command is terminated. The coordinate P9 thus obtained is stored in the first register, and
Set the first flag and clear the second flag.
又は、比較色以外の色が終点に達するまでに検出できな
い場合においてもコマンドを終了する(第7図(J)F
12)。この場合、第1及び第2のフラグはクリ、アさ
れる。Alternatively, the command is terminated even if a color other than the comparison color cannot be detected before reaching the end point (Fig. 7 (J) F).
12). In this case, the first and second flags are cleared.
ここで、第1及び第2のレジスタ並びに第1及び第2の
フラグを第8図に示し、説明する。Here, the first and second registers and the first and second flags are shown in FIG. 8 and will be explained.
第1のレジスタ(REGl )は、その構造が第8図(
A)に示され、総てのモードで有効なものである。モー
ド0.1の場合には始点XO,YOから比較色又は比較
色以外の色(条件色の先端)が検出されたときに、その
座標が記憶され、該座標が出力される。モード2.3の
場合には始点X0、YOから最初に比較色又は比較色以
外の色が検出(条件色の先端)されたときに、その座標
が記憶され、該座標が出力される。The structure of the first register (REGl) is shown in FIG.
It is shown in A) and is valid in all modes. In the case of mode 0.1, when a comparison color or a color other than the comparison color (the tip of the condition color) is detected from the starting points XO, YO, its coordinates are stored and output. In the case of mode 2.3, when a comparison color or a color other than the comparison color is first detected from the starting point X0, YO (the tip of the condition color), its coordinates are stored and output.
第2のレジスタ(REG2)は、その構造が第8図(B
)に示され、モード2.3のみに有効なものである1、
モード2,3の場合に、最初に比較色又は比較色以外の
色が検出されてから、終点×1、Ylまでにその条件が
なくなった点(条件色の後@)の座標が記憶され、該座
標が出力される。The structure of the second register (REG2) is shown in FIG.
1, which is shown in ) and is valid only for mode 2.3.
In the case of modes 2 and 3, the coordinates of the point (@ after the condition color) where the condition disappears from the time when the comparison color or a color other than the comparison color is first detected until the end point x 1, Yl are stored, The coordinates are output.
第1及び第2のフラグ(Fl、F2)は、第8図(C)
に示すように、12及び13コードにおいてセット又は
クリアされる。第1のフラグF1は、総てのモードで有
効なフラグである。モード0.1の場合、比較色又は比
較色以外の色が検出(条件色の先端)されたときにセッ
トされ、それ以外のときにクリアされる。モード2,3
の場合、最初に比較色又は比較色以外の色が検出(条件
色の先端)されたときにセットされ、それ以外のときに
クリアされる。The first and second flags (Fl, F2) are shown in Figure 8 (C).
Set or cleared on codes 12 and 13, as shown in FIG. The first flag F1 is a flag that is valid in all modes. In the case of mode 0.1, it is set when a comparison color or a color other than the comparison color is detected (at the leading edge of the condition color), and is cleared at other times. Mode 2, 3
In this case, it is set when the comparison color or a color other than the comparison color is first detected (at the leading edge of the condition color), and is cleared at other times.
第2の7ラグF2は、モード2.3のみで有効 9
なフラグであり、最初の条件が成立した後に該条件がな
くなったときに(条件色の後@)セットされ、それ以外
のときにクリアされる1、なお、第8図(C)中のSは
、第1及び第2のフラグの補助的な役割を果すもので、
モード0.1時に第1の7ラグF1がセットされたとき
にセットされ、モード2.3時に第1及び第2のフラグ
F1.F2が共にセットされたときにセットされるもの
である。The second 7-lag F2 is a flag that is valid only in mode 2.3, and is set when the condition disappears after the first condition has been met (@ after the condition color), and is set at any other time. 1 to be cleared, S in FIG. 8(C) plays a supplementary role to the first and second flags,
It is set when the first 7-lag F1 is set in mode 0.1, and the first and second flags F1. This is set when F2 is also set.
次に、画像処理プロセッサ2の描画フィクロ部6がモー
ド2,3時にマイクロプログラムにおいてコマンドを処
理する場合を第9図のノローチャトに示す。まず、第1
及び第2の7ラグFl。Next, a case in which the drawing physic section 6 of the image processing processor 2 processes commands in a microprogram in modes 2 and 3 is shown in the norow chart of FIG. First, the first
and a second 7-lag Fl.
F2をクリアする〈ステップ20>。そして、ラスタ処
理部7に比較色と一致するまで検出を行わせるコマンド
を発行する(ステップ21)。これに基づきラスタ処理
部7は1ラスタ処理を行い〈ステップ22)、その結果
をマイクロプログラムに通知する。この通知結果が条件
成立であれば(ステップ23)、条件が成立した座標を
第1の0
レジスタREGIに記憶させ、第1の7ラグF1をセッ
トする(ステップ24〉。そして、モードを判断して(
ステップ25)、モードがモード2のときに比較色と不
一致になるまで検出を行わせるコマンドをラスタ処理部
7に対して送出する(ステップ26)。ラスタ処理部7
は、該コマンドに基づいて処理を行い、その結果をマイ
クロプログラムに通知する(ステップ27)。この通知
結果が条件成立すれば(ステップ28)、第2の7ラグ
F2をセットし、条件が成立した座標を第2のレジスタ
REG2に記憶させ、処理を終了するものである。ここ
で、ステップ25において、モードがモード3の場合は
、マイクロプログラムがラスタ処理部7に、次の比較色
が一致するまで検出を行わせるコマンドを発行する。Clear F2 <Step 20>. Then, a command is issued to cause the raster processing unit 7 to perform detection until the color matches the comparison color (step 21). Based on this, the raster processing unit 7 performs one raster processing (step 22), and notifies the microprogram of the result. If the notification result is that the condition is met (step 23), the coordinates at which the condition was met are stored in the first 0 register REGI, and the first 7-lag F1 is set (step 24).Then, the mode is determined. hand(
Step 25), when the mode is mode 2, a command is sent to the raster processing unit 7 to perform detection until the color matches the comparison color (step 26). Raster processing section 7
performs processing based on the command and notifies the microprogram of the results (step 27). If the notification result satisfies the condition (step 28), the second 7-lag F2 is set, the coordinates for which the condition is satisfied are stored in the second register REG2, and the process is terminated. Here, in step 25, if the mode is mode 3, the microprogram issues a command to the raster processing section 7 to perform detection until the next comparison color matches.
このように、1回のコマンド発行で比較色及び比較色以
外の色を検出した座標を認識することができ、これによ
り走査処理毎にオペレータがパラメータを設定する必要
がなく、最小限のロスタイムで高速に任意領域のサーブ
−及びペイントを行うことができる。また、フラグF1
.F2を参照することで指定されたラスク内で比較色が
検出されたか、又はその検出された比較色がなくなった
かを同時に認識することができることから、ベイン1〜
等の処理プログラムを画像処理プロセッサの外部で作成
することが容易となる。さらに、複数のモードを備える
ことで、画像処理プロセッサの外部で作成されるアプリ
ケーションに応じた様々な使用方法を提供することがで
きる。In this way, by issuing a single command, it is possible to recognize the coordinates at which the comparison color and colors other than the comparison color are detected. This eliminates the need for the operator to set parameters for each scanning process, and can be done with minimal loss time. It is possible to serve and paint any area at high speed. Also, flag F1
.. By referring to F2, it is possible to simultaneously recognize whether a comparison color has been detected within the specified rask or whether the detected comparison color has disappeared.
It becomes easy to create processing programs such as the above outside the image processing processor. Furthermore, by providing a plurality of modes, it is possible to provide various usage methods depending on applications created outside the image processing processor.
なお、上記実施例では色情報を検出するに当り、比較色
との一致、不一致を判断しているが、これに限らず所定
モードによって大小比較させても同様の効果を有する。Note that in the above embodiment, when detecting color information, it is determined whether the color information matches or does not match the comparison color, but the same effect is not limited to this, and the same effect can be obtained even if the size is compared in a predetermined mode.
以上のように本発明によれば、第3の発明のように処理
手段により条件色の先端から後端まで検出させ、また第
1の発明のようにこれらの座標を記憶させることにより
、最小限のロスタイムで高速に任意領域のサーチ、ペイ
ントを行うことができると共に、第2の発明のように条
件色の先端と後端でフラグをセットすることにより、外
部におけるアプリケーションプログラムの作成が容易と
なり、様々な使用方法を提供することができる。As described above, according to the present invention, the processing means detects from the leading edge to the trailing edge of the condition color as in the third aspect, and by storing these coordinates as in the first aspect, In addition to being able to search and paint any arbitrary area at high speed with no loss time, by setting flags at the leading and trailing ends of the condition color as in the second invention, it is easy to create external application programs. Various usage methods can be provided.
【図面の簡単な説明】
第1図は本発明の第1の発明の原理説明図、第2図は本
発明の第2の発明の原理説明図、第3図は本発明の一実
施例の構成ブロック図、第4図は画像処理プロセッサの
概略構成ブロック図、
第5図はラスク処理部の構成ブロック図、第6図はCP
Uから画像処理プロセッサに送出されるコマンド及びパ
ラメータの体系図、第7図は画像情報の色情報検出の概
念図、第8図はレジスタ及びフラグの体系図、第9図は
描画マイクロ部におけるフローチャートである。
3
図において、
1はcpu。
2は画像処理プロセッサ、
3は画像処理メモリ、
4はCRT。
5はホストバスIF。
6は描画マイクロ部、
7はラスク処理部、
8はグラフィックIF
を示す。[BRIEF DESCRIPTION OF THE DRAWINGS] Fig. 1 is an explanatory diagram of the principle of the first invention of the present invention, Fig. 2 is an explanatory diagram of the principle of the second invention of the invention, and Fig. 3 is an illustration of the principle of the second invention of the invention. 4 is a schematic block diagram of the image processing processor, 5 is a block diagram of the rask processing unit, and 6 is a block diagram of the CP.
A system diagram of commands and parameters sent from U to the image processing processor, Figure 7 is a conceptual diagram of color information detection of image information, Figure 8 is a system diagram of registers and flags, and Figure 9 is a flowchart in the drawing micro section. It is. 3 In the figure, 1 is a CPU. 2 is an image processing processor, 3 is an image processing memory, and 4 is a CRT. 5 is the host bus IF. 6 is a drawing micro section, 7 is a rask processing section, and 8 is a graphic IF.
Claims (3)
査し、所定のモードによつて指定された条件色の先端を
検出する画像処理における色情報検出方法において、 前記条件色の先端を走査する工程(ステップ1)と、 該条件色の先端が検出された場合に、該先端の座標を第
1のレジスタに記憶させる工程(ステップ2)と、 前記モードにより、該条件色の先端の座標より、該条件
色の後端まで走査を続行する工程(ステップ3)と、 該条件色の後端が検出された場合に、該後端の座標を第
2のレジスタに記憶させる工程(ステップ4)と、 を有することを特徴とする画像処理における色情報検出
方法。(1) In a color information detection method in image processing, in which image information is scanned and the leading edge of a conditional color specified by a predetermined mode is detected in order to perform predetermined command processing, the leading edge of the conditional color is scanned. (Step 1); When the leading edge of the conditional color is detected, storing the coordinates of the leading edge in a first register (Step 2); , a step of continuing scanning to the rear end of the condition color (step 3), and a step of storing the coordinates of the rear end in a second register when the rear end of the condition color is detected (step 4). ); A method for detecting color information in image processing, comprising:
させる工程(ステップ11A)には、第1のフラグをセ
ットすることを含み(ステップ11B)、 前記条件色の後端の座標を第2のレジスタに記憶させる
工程(ステップ13A)には、第2のフラグをセットす
ることを含む(ステップ13B)ことを特徴とする請求
項(1)記載の画像処理における色情報検出方法。(2) The step of storing the coordinates of the leading edge of the condition color in a first register (step 11A) includes setting a first flag (step 11B), and storing the coordinates of the trailing edge of the condition color in a first register (step 11A). 2. The color information detection method in image processing according to claim 1, wherein the step of storing in the second register (step 13A) includes setting a second flag (step 13B).
査し、所定のモードによって指定された条件色の先端を
検出する画像処理プロセッサを有する画像処理における
色情報検出装置において、前記画像処理プロセッサは、 前記条件色の先端を検出した後、該条件色の非検出まで
走査を続行し、該条件色の後端を検出する処理手段を有
することを特徴とする画像処理における色情報検出装置
。(3) In a color information detection device for image processing having an image processing processor that scans image information and detects the leading edge of a condition color specified by a predetermined mode in order to perform predetermined command processing, the image processing processor A color information detection device for image processing, comprising a processing means for detecting a leading edge of the conditional color, continuing scanning until the conditional color is not detected, and detecting a trailing edge of the conditional color.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1320882A JPH03180985A (en) | 1989-12-11 | 1989-12-11 | Method and device for detecting color information in image processing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1320882A JPH03180985A (en) | 1989-12-11 | 1989-12-11 | Method and device for detecting color information in image processing |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH03180985A true JPH03180985A (en) | 1991-08-06 |
Family
ID=18126320
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1320882A Pending JPH03180985A (en) | 1989-12-11 | 1989-12-11 | Method and device for detecting color information in image processing |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH03180985A (en) |
-
1989
- 1989-12-11 JP JP1320882A patent/JPH03180985A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3170279B2 (en) | Interpretation of image position in graphics system | |
| JPH03180985A (en) | Method and device for detecting color information in image processing | |
| JPH1021377A (en) | Image processing device | |
| JP2001357077A (en) | CAD system | |
| JP3129717B2 (en) | Image processing apparatus and image processing method | |
| JPH07325927A (en) | Image data processing device and system using the same | |
| JP2634905B2 (en) | How to paint shapes | |
| JP4214643B2 (en) | Two-dimensional pattern generation method and apparatus | |
| JP2575636B2 (en) | Graphic display device | |
| JPH0969166A (en) | Information processing apparatus and method, and storage medium | |
| JPH06290226A (en) | Graphic processing device | |
| JP2721344B2 (en) | Image processing method | |
| JP2001357076A (en) | Image display method in CAD system | |
| JPH02201688A (en) | Image data editing device | |
| JPH10334250A (en) | Anti-alias processor and image processing unit | |
| JPS6169094A (en) | Graphic processing method and apparatus | |
| JPH06202796A (en) | Information storage method | |
| JPH01244585A (en) | Graphic data clipping processing system | |
| JPH0397081A (en) | graphic display device | |
| JPH0241576A (en) | Polygon picking processing device and method | |
| JPH02281292A (en) | Multiwindow display control system | |
| JPH07302070A (en) | Image data processing device and system using the same | |
| JP2004326178A (en) | Simple creation system for unix(r) picture program | |
| JPH05113866A (en) | Image display window control method | |
| JPH02238581A (en) | Closed-area surface painting-out processing system for graphic drawing |