JP2941810B2 - Image processing method and apparatus - Google Patents

Image processing method and apparatus

Info

Publication number
JP2941810B2
JP2941810B2 JP5965888A JP5965888A JP2941810B2 JP 2941810 B2 JP2941810 B2 JP 2941810B2 JP 5965888 A JP5965888 A JP 5965888A JP 5965888 A JP5965888 A JP 5965888A JP 2941810 B2 JP2941810 B2 JP 2941810B2
Authority
JP
Japan
Prior art keywords
image
image data
processing
arrangement
memory
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
JP5965888A
Other languages
Japanese (ja)
Other versions
JPH01233575A (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 JP5965888A priority Critical patent/JP2941810B2/en
Publication of JPH01233575A publication Critical patent/JPH01233575A/en
Priority to US08/116,545 priority patent/US5384900A/en
Application granted granted Critical
Publication of JP2941810B2 publication Critical patent/JP2941810B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Input (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、画像メモリに格納された画像データをプロ
グラム中でアクセスする際の画像処理方法及びその装置
に関する。
Description: TECHNICAL FIELD The present invention relates to an image processing method and an apparatus for accessing image data stored in an image memory in a program.

〔従来技術〕(Prior art)

画像処理システムは、従来より汎用ミニコンピュータ
などの計算機と(画像メモリ、画像処理プロセツサなど
を構成要素とする)画像専用のハードウエアから構成さ
れ、画像専用ハードウエアの機能による高速処理が実現
されていた。一方、近年、エンジニアリングワークステ
ーション(EWS)には、外部バス上の領域を直接仮想記
憶領域に割り付ける機能が付加され、これに対応して、
EWSの外部バス上のアドレスにより画像メモリが直接ア
クセス可能な形式の画像処理ハードウエアも市販されて
きた。画像処理システムには、高速性と共にソフトウエ
アによる柔軟性が望まれていたが、上記によりこの種の
システムの問題点であった主記憶と画像メモリ間のデー
タ転送が不必要もしくは非常に高速となり、高速性と柔
軟性を両立させたアプリケーションの作成が可能となっ
た。このようなシステムの実例としては、たとえばEWS
としてSunマイクロ社のSun3/260C、画像処理ハードウエ
アとしてnexus社製NEXUS6810およびVME拡張ボードを組
み合わせる事により実現できる。第1図はこのようなシ
ステムの構成を示したもので、大きくはホストとなるEW
S101と画像処理ハードウエア102から構成される。EWS10
1内には、CPU103があり、画像処理ハードウエア102内に
は、画像メモリ104及び画像処理プロセツサ105がある、
前記したタイプの機器をこのようなシステム構成とする
事により、画像メモリ104上の画像データは画像処理プ
ロセツサ104,CPU103のどちらでも処理することが可能と
なる。例えば、画像処理の例として、与えられた原画像
をi)エツジ強調し、ii)ノイズ除去処理(平滑化)し
た後、iii)デイザ処理を行うものを考えると、i),i
i)の処理は画像処理プロセツサで、iii)の処理はCPU
で処理されるといったように、このような画像処理シス
テムにおいてプログラムを作成した場合、画像処理プロ
セツサによる処理とEWSのCPUによる処理が混在して利用
される。
2. Description of the Related Art Conventionally, an image processing system is composed of a computer such as a general-purpose minicomputer and image-specific hardware (including an image memory and an image processing processor), and high-speed processing is realized by the function of the image-specific hardware. Was. On the other hand, in recent years, the engineering workstation (EWS) has been added with a function of directly allocating an area on an external bus to a virtual storage area.
Image processing hardware of a type in which an image memory can be directly accessed by an address on an external bus of the EWS has been commercially available. The image processing system was desired to have software flexibility as well as high speed. However, the above-mentioned problem caused the data transfer between the main memory and the image memory to be unnecessary or extremely fast. This makes it possible to create applications that are both fast and flexible. Examples of such systems include, for example, EWS
It can be realized by combining Sun Micro's Sun3 / 260C, Nexus NEXUS6810 and VME expansion board as image processing hardware. FIG. 1 shows the configuration of such a system.
It comprises S101 and image processing hardware 102. EWS10
1 includes a CPU 103, and an image processing hardware 102 includes an image memory 104 and an image processing processor 105.
By using the above-mentioned type of equipment with such a system configuration, image data in the image memory 104 can be processed by either the image processing processor 104 or the CPU 103. For example, as an example of image processing, i.e., i) edge enhancement of a given original image, ii) noise removal processing (smoothing), and iii) dither processing are performed.
The processing of i) is an image processing processor, and the processing of iii) is a CPU.
When a program is created in such an image processing system as described above, processing by the image processing processor and processing by the CPU of the EWS are used together.

ここで横X画素、縦Y画素の画像を取り扱うことを考
える。前述したような市販の画像処理ハードウエアでは
処理プロセツサの処理単位であるフレームとしてハード
ウエア的に固定された2次元のアドレスがあり、画像デ
ータはこの空間中で矩形となるようにしなければならな
い。従って、画像処理プロセツサを利用する場合、画像
メモリ上での画像データの配置は第2(a)図に示すよ
うな配置形式(以降、固定配置形式と呼ぶ)とする必要
がある。第2図(b)はEWSのCPUから第2図(a)の配
置を見た場合のメモリマツプである。一方、EWSのCPUで
処理する場合、既存のほとんどのソフトウエアでは、画
像データは、例えば、プログラミング言語FORTRANで
は、 DIMENSION IMAGE(512,512) プログラミング言語Cでは、 int image[512][512];で指定される様にX*Y
(画素分)の配列として連続した領域に配置されてい
た。この配置形式(以降、連続配置形式と呼ぶ)をフレ
ーム単位のアドレス形式、メモリマツプで示したものが
それぞれ第2図(c)、第2図(d)である。
Here, it is assumed that an image having horizontal X pixels and vertical Y pixels is handled. In the above-described commercially available image processing hardware, there is a two-dimensional address fixed in hardware as a frame, which is a processing unit of the processing processor, and the image data must be rectangular in this space. Therefore, when an image processing processor is used, it is necessary to arrange the image data in the image memory in an arrangement format as shown in FIG. 2A (hereinafter, referred to as a fixed arrangement format). FIG. 2B shows a memory map when the arrangement of FIG. 2A is viewed from the CPU of the EWS. On the other hand, when processing with the EWS CPU, in most existing software, image data is specified by, for example, DIMENSION IMAGE (512, 512) in the programming language FORTRAN, int image [512] [512]; in the programming language C. X * Y to be done
(For pixels) in a continuous area. FIGS. 2 (c) and 2 (d) show this arrangement format (hereinafter referred to as a continuous arrangement format) in an address format in frame units and a memory map.

このような画像データのメモリ上での配置形式の違い
により、画像処理プロセツサによる処理とEWSのCPUによ
る処理を混在して利用するためには、 処理モジユール適用直前の画像データの配置形式と
処理モジユールの前提とする配置形式が異なる場合に配
置形式の変換を行う。
Due to such differences in the arrangement format of image data on the memory, in order to use the processing by the image processing processor and the processing by the CPU of the EWS in a mixed manner, the arrangement format and the processing module of the image data immediately before the application of the processing module When the arrangement format presupposed by is different, the arrangement format is converted.

EWSのCPUによる処理モジユールを固定配置形式の画
像データを処理するように全面的に書き換える。
The processing module by the CPU of the EWS is completely rewritten so as to process the image data in the fixed arrangement format.

のいずれかの手段を採る必要があった。It was necessary to take one of the measures.

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

しかしながら、これらの方法をもちいた場合、 A.の手段では、プログラムが処理モジユールの内容・
画像データの状態に応じて配置変換のプログラムを作成
・利用する必要からプログラム作成のための負担が非常
に大きくなる。
However, if these methods are used, the means of A.
Since it is necessary to create and use a layout conversion program in accordance with the state of the image data, the burden for creating the program becomes very large.

B.の手段では、既存の多くのプログラムを書き換える
ための膨大な労力が必要となる。
Means B. require enormous effort to rewrite many existing programs.

C.モジユール内にはハードウエア構成の情報が含まれる
ため、ハードウエアの構成を変更時に、多くのプログラ
ムの修正が必要となる。
C. Since the hardware configuration information is included in the module, when the hardware configuration is changed, many programs need to be modified.

といった欠点があった。There was a drawback.

〔目 的〕〔Purpose〕

以上の点に鑑み、本発明の目的は、画像データを記憶
する記憶工程と、前記記憶工程により記憶された画像デ
ータを処理する画像処理工程と、前記記憶工程により記
憶された画像データを複数の異なる配置形式で管理する
管理工程と、前記記憶工程により記憶された画像データ
に対して前記画像処理工程より要求される配置形式が、
前記管理工程により管理されている配置形式と異なるか
否かを判断する判断工程と、前記判断工程により画像デ
ータの配置形式が異なると判断された場合、画像データ
の配置を変換する変換工程とを有することを特徴とする
画像処理方法を提供することにある。
In view of the above, an object of the present invention is to provide a storage step for storing image data, an image processing step for processing the image data stored in the storage step, and a plurality of image data stored in the storage step. A management step of managing in different arrangement forms, and an arrangement form required by the image processing step for image data stored by the storage step,
A determining step of determining whether or not the layout format is different from the layout format managed by the management process, and a converting process of converting the layout of the image data when the determining process determines that the layout format of the image data is different. An object of the present invention is to provide an image processing method characterized by having the above.

また、本発明の目的は、画像データを記憶する画像メ
モリと、前記画像メモリ内の画像データを処理する画像
処理手段と、前記画像メモリ内の画像データを複数の異
なる配置形式で管理する管理手段と、前記画像処理手段
から前記画像メモリに対する要求の配置形式が、前記管
理手段により管理されている配置形式と異なるか否か判
断する判断手段と、前記判断手段により画像データの配
置形式が異なると判断された場合、画像データの配置を
変換する配置変換手段とを有することを特徴とする画像
処理装置を提供することにある。
Further, an object of the present invention is to provide an image memory for storing image data, an image processing means for processing the image data in the image memory, and a management means for managing the image data in the image memory in a plurality of different arrangement formats. A determination unit that determines whether or not the layout format of the request from the image processing unit to the image memory is different from the layout format managed by the management unit; and that the layout format of the image data is different by the determination unit. It is another object of the present invention to provide an image processing apparatus having an arrangement conversion means for converting the arrangement of image data when it is determined.

〔実施例〕〔Example〕

第3図は、本発明の一実施例のブロツク図で、301は
実際の画像処理を行うプログラムを実行するプロセスで
あり、302は画像メモリの管理を行うプロセスである。
まず全体の動作の概略を説明する。
FIG. 3 is a block diagram of one embodiment of the present invention. Reference numeral 301 denotes a process for executing a program for performing actual image processing, and reference numeral 302 denotes a process for managing an image memory.
First, an outline of the entire operation will be described.

実行プロセス301は、画像メモリの領域が必要となっ
た時や不必要となった時などに領域の<登録>、<占有
−連続配置>、<占有−固定配置>、<解放>、<削除
>などの要求をプロセス間通信を用いて管理プロセス30
2に伝える。
The execution process 301 executes the <registration>, <occupation-continuous arrangement>, <occupation-fixed arrangement>, <occupation-fixed arrangement>, <release>, and <deletion> when the image memory area becomes necessary or unnecessary. Requests such as> management process 30 using inter-process communication
Tell 2

管理プロセス302は、受け取った要求の種類に従い、
内部に持つ画像データ管理テーブル、メモリ領域管理テ
ーブル(後出)を用いて、適切な空領域の割り当て、使
用状況の変更に応じた管理テーブルの内容の更新を行
う。続いて、割り当てた領域を指定する情報を実行プロ
セスに返す。また、占有要求(<占有−連続配置>ある
いは<占有−固定配置>)に対しては、画像データの占
有時に、要求受付時点で画像データ管理テーブルに記憶
されている配置形式(連続配置あるいは固定配置)と要
求される配置形式とが異なる場合に配置形式の変換を行
う。
The management process 302, according to the type of request received,
Using the internal image data management table and memory area management table (described later), an appropriate empty area is allocated and the contents of the management table are updated in accordance with a change in the use status. Subsequently, information specifying the allocated area is returned to the execution process. In response to an occupation request (<occupation-continuous arrangement> or <occupation-fixed arrangement>), when the image data is occupied, the arrangement format (continuous arrangement or fixed arrangement) stored in the image data management table at the time the request is accepted. When the required layout format differs from the required layout format, the layout format is converted.

ここで占有時に実行プロセスへ渡される情報の形態と
しては、画像処理プロセツサに対し画像データを指定す
るために利用でき、かつCPUからアクセスする際に仮想
記憶アドレスに変換できる情報形態であればよく、本実
施例では画像処理プロセツサが処理を実行する時の画像
メモリの領域の単位となるフレームの番号(以下、フレ
ーム番号)を用いる。
Here, the form of information passed to the execution process when occupied may be any information form that can be used to specify image data to the image processing processor and can be converted to a virtual storage address when accessed from the CPU. In this embodiment, a frame number (hereinafter, frame number), which is a unit of an area of an image memory when the image processing processor executes a process, is used.

実行プロセス301は、管理プロセス302から得られた領
域の情報(フレーム番号)に基づき、画像処理プロセツ
サもしくはCPUにより処理を実施する。
The execution process 301 is executed by the image processing processor or the CPU based on the area information (frame number) obtained from the management process 302.

第4図は、実際に画像処理が実行される過程での実行
プロセス301と管理プロセス302の間の通信と各々の動作
例の概略を示したものである。ここで、管理プロセス30
2はシステム起動時に一度だけ起動され、システム終了
時に停止させられるため、図示されていない過去に起動
されたものとする。実行プロセス301は、たとえば、OS
のコマンドインタープリタにコマンドを入力する事によ
り起動される。実行プロセスから管理プロセスへ受け渡
される要求メツセージは、第1ワードが要求の種類を示
す番号であり、第2ワード以降は要求の種類により決ま
るワード数だけ付属情報が送られる。
FIG. 4 schematically shows communication between the execution process 301 and the management process 302 in the process of actually executing the image processing, and an outline of each operation example. Here, the management process 30
2 is started only once when the system is started, and is stopped when the system ends, so it is assumed that it has been started in the past, not shown. The execution process 301 is, for example, the OS
It is started by inputting a command to the command interpreter. In the request message passed from the execution process to the management process, the first word is a number indicating the type of request, and the second and subsequent words are transmitted with the attached information for the number of words determined by the type of request.

起動後、実行プロセス301は、まず、画像データの<
登録>要求を発する(401)。管理プロセス302は、これ
を受けて画像データに新規な識別番号(以下画像idと呼
ぶ)を割り付け、画像データ管理テーブルにこの画像id
と画像データの横方向の大きさ(以下xsizeとする)、
縦方向の大きさ(以下ysizeとする)、1画素あたりの
データ量(以下nbyteとする)を書き込み、画像idを実
行プロセスに送り返す(402)。
After the activation, the execution process 301 first starts the image data <
Registration> Issue request (401). The management process 302 receives this and assigns a new identification number (hereinafter referred to as an image id) to the image data, and stores the image ID in the image data management table.
And the horizontal size of the image data (hereinafter referred to as xsize),
The vertical size (hereinafter referred to as ysize) and the data amount per pixel (hereinafter referred to as nbyte) are written, and the image id is sent back to the execution process (402).

プログラムの進行に伴い、画像データの読み書きが必
要になると、実行プロセス301は、画像データ領域の占
有要求(<占有−連続配置>もしくは<占有−固定配置
>)を発する(403)。管理プロセス302はこれを受け
て、画像データ領域の占有処理を実行する。
When it becomes necessary to read and write image data with the progress of the program, the execution process 301 issues a request for occupying the image data area (<occupation-continuous arrangement> or <occupation-fixed arrangement>) (403). In response to this, the management process 302 executes an occupation process of the image data area.

最初に画像データを入力する際や次に実行する処理の
結果のための領域を占有する場合には、管理プロセス
は、画像データ管理テーブルの状態値の項を参照してこ
の画像が初めてアクセスされる事を判断し、メモリ領域
管理テーブルを参照して必要な画像領域を満足する画像
メモリ中の空領域を探索する。続いて、占有要求により
指定された画像データの配置形式の種類を画像データ管
理テーブルへ書き込み、発見した空領域が再利用されな
いようにメモリ領域管理テーブルを更新し、発見した空
領域のフレーム番号を実行プロセス301に送り返す(40
4)。
When occupying the area for the first input of image data or for the result of the processing to be executed next, the management process refers to the status value section of the image data management table, and this image is accessed for the first time. Then, an empty area in the image memory that satisfies the required image area is searched for with reference to the memory area management table. Subsequently, the type of the arrangement format of the image data specified by the occupation request is written to the image data management table, the memory area management table is updated so that the found empty area is not reused, and the frame number of the found empty area is updated. Return to execution process 301 (40
Four).

実行プロセス301は、画像処理プロセツサを利用して
処理を行う場合は、画像処理プロセツサに処理コマンド
と処理対象であるフレーム番号、処理のパラメータなど
を受け渡して実際の処理を起動し、CPU側で受け取るべ
き処理結果がある場合にはこれを受け取る。この受け渡
し操作は、実際には汎用バスを経由して画像処理プロセ
ツサの内部メモリ、レジスタをCPUが読み書きする事に
よる。
When performing processing using an image processing processor, the execution process 301 starts a real process by passing a processing command, a frame number to be processed, a processing parameter, and the like to the image processing processor, and receives it on the CPU side. When there is a processing result to be received, this is received. This transfer operation is actually performed by the CPU reading and writing the internal memory and registers of the image processing processor via the general-purpose bus.

CPUが画像データを直接アクセスして処理を行う場合
には、まず前以って設定された画像メモリ103の先頭ア
ドレス(実アドレス)であるベースアドレス、画像メモ
リのフレームの大きさ、とフレーム番号から使用する領
域の先頭アドレス(実アドレス)を計算し、使用するサ
イズ分の仮想記憶領域を占有した後、画像メモリ上の使
用する領域の先頭アドレス(実アドレス)とそのサイズ
をもちいてこの領域を仮想記憶領域へ割り付る(この過
程を以下では仮想記憶領域へのマツピングと呼ぶ)。CP
Uはマツピングにより得られた仮想記憶領域のアドレス
(仮想記憶アドレス)を用いて画像データの参照・書き
込みなどを行う。
When the CPU directly accesses the image data and performs processing, first, the base address which is the head address (real address) of the image memory 103 set in advance, the frame size of the image memory, and the frame number are used. After calculating the start address (real address) of the area to be used and occupying the virtual storage area of the size to be used, this area is used by using the start address (real address) of the area to be used on the image memory and its size. Assigned to a virtual storage area (this process is hereinafter referred to as mapping to a virtual storage area). CP
U uses the virtual storage area address (virtual storage address) obtained by mapping to refer to and write image data.

モジユールなどの単位での一連のアクセスが終了する
と、実行プロセスは画像データ領域を解放する操作を行
う。CPUからアクセスした場合には使用した仮想記憶領
域を解放した後、画像処理プロセツサで処理した場合に
はそのまま、管理プロセスへ画像データ領域の<解放>
要求を発する(405)。ここで、<解放要求>は、画像
データが一時的にアクセス不要となった事を示すもの
で、これにより同一画像に対する別の占有要求の受け付
けが可能となる。画像データ自体が失われることはな
い。実際には、管理プロセスは<解放>要求に対し画像
データ管理テーブルの状態値の項を更新し、正常終了/
異常終了の状態値を送り返す(406)。
When a series of accesses in units such as a module is completed, the execution process performs an operation to release the image data area. After the used virtual storage area is released when accessed from the CPU, the image data area is released to the management process as it is when processed by the image processing processor.
Issue a request (405). Here, the <release request> indicates that the image data has become temporarily unnecessary to access, so that another occupation request for the same image can be accepted. The image data itself is not lost. Actually, the management process updates the status value item of the image data management table in response to the <release> request, and
The status value of the abnormal end is sent back (406).

実行プロセスの進行に伴い、既に存在する画像データ
への再度のアクセスが必要となった場合にも、実行プロ
セスは占有要求を発する(407)。管理プロセスは、こ
れを受け取り、画像データ管理テーブルの状態値の項を
読みだし、画像データが既に存在することとその配置形
式の種類の情報を得る。既に画像データが存在する場
合、管理プロセスは空領域の新たな割り当ては行わず、
配置形式の違いのみを処理する。占有要求の示す配置形
式の種類とこの時点での配置形式が異なる場合に管理プ
ロセスは画像データが要求された配置形式となるように
配置変換操作を行う(408)。続いて、画像データが格
納されているフレーム番号を実行プロセスに送り返す。
The execution process also issues an occupancy request when it is necessary to access the existing image data again with the progress of the execution process (407). The management process receives this, reads out the item of the status value in the image data management table, and obtains information that the image data already exists and the type of the arrangement format. If the image data already exists, the management process does not newly allocate an empty area,
Handles only the difference in arrangement format. When the type of the layout format indicated by the occupation request is different from the layout format at this time, the management process performs a layout conversion operation so that the image data has the requested layout format (408). Subsequently, the frame number in which the image data is stored is sent back to the execution process.

実行プロセスは、前述したアクセスの場合と同様の画
像データアクセス方法により画像データを処理し、一連
のアクセスが終了した場合に<解放>要求を発する。
The execution process processes the image data by the same image data access method as in the case of the access described above, and issues a <release> request when a series of accesses is completed.

この後、実行プロセス301は、画像データが不要とな
った時点で、管理プロセス302へこの画像データの〈削
除>を要求する(409)。管理プロセス302は画像データ
管理テーブルのこの画像データの行を初期化し、メモリ
管理領域テーブルを更新して対応するフレーム番号の領
域を未使用状態とする(410)。
Thereafter, when the image data becomes unnecessary, the execution process 301 requests the management process 302 to <Delete> the image data (409). The management process 302 initializes the row of the image data in the image data management table, updates the memory management area table, and sets the area of the corresponding frame number to an unused state (410).

EWSを前出のSun3/260C、OSをSunOSとした場合、プロ
セス間通信の機能はsocketなどのシステムコールにより
実現され、仮想記憶領域への割り当てはvalloc(仮想記
憶領域の占有の機能)・mmap(実アドレスの仮想記憶領
域への割り当ての機能)・free(仮想記憶領域の解放)
などのシステムコールにより実現される。
When the EWS is Sun3 / 260C and the OS is SunOS, the function of inter-process communication is realized by system calls such as socket, and the allocation to virtual storage area is valloc (function of occupying virtual storage area) mmmap (Function of assigning real address to virtual storage area)-free (release of virtual storage area)
This is realized by a system call such as

第5図(a)は管理プロセス302の内部動作の流れを
示すフローチヤートであり、第5図(b),(c),
(d),(e)はそれぞれ管理プロセスの登録、占有、
解放、削除の内部動作の流れを示すフローチヤートであ
る。第6図(a)は管理プロセス302が使用する画像デ
ータ管理テーブルIDTBLの構成、第6図(b)はメモリ
領域管理テーブルIMTBLの構成を示したものである。画
像データ管理テーブルIDTBLは、各行が1つの画像デー
タに対応し、各データの画像id・横方向の大きさxsize
・縦方向の大きさysize・1画素あたりのデータ幅nbyte
・画像データの使用状態を示す状態値・画像データの対
応する格納領域である対応フレーム・画像データの登録
者の識別子である作成者uidが格納される。メモリ領域
管理テーブルIMTBLでは、各行が画像メモリ中の1つの
フレームの情報に対応し、後述する一時フレーム用に残
されたフレーム以外のフレーム分だけの行がある。各行
には、そのフレームが未使用ならば0、使用中ならば各
画像データに対する情報としてその画像領域を占有した
ユーザの指定子uidが格納されている。
FIG. 5 (a) is a flowchart showing the flow of the internal operation of the management process 302, and FIGS. 5 (b), (c),
(D) and (e) are the registration and occupation of the management process, respectively.
5 is a flowchart showing a flow of an internal operation of release and deletion. FIG. 6A shows the configuration of the image data management table IDTBL used by the management process 302, and FIG. 6B shows the configuration of the memory area management table IMTBL. In the image data management table IDTBL, each row corresponds to one image data, and each data has an image id and a horizontal size xsize.
・ Vertical size ysize ・ Data width per pixel nbyte
A status value indicating the use state of the image data is stored. A corresponding frame which is a storage area corresponding to the image data. A creator uid which is an identifier of a registrant of the image data is stored. In the memory area management table IMTBL, each row corresponds to information of one frame in the image memory, and there are rows only for frames other than a frame left for a temporary frame described later. Each row stores a specifier uid of a user who has occupied the image area as information on each piece of image data if the frame is unused, and if the frame is in use.

以下、第5図及び第6図に従い、管理プロセス302の
動作を説明する。管理プロセス302は、まず、プロセス
間通信により送られてきた要求メツセージを読みだし
(501)、ついで、メツセージの先頭に記されている要
求の種類により要求処理部選択し、これに制御を移す。
各要求処理部の実行が終了すると要求メツセージの読み
出し(501)に戻り、この過程を終了要求が送られて来
るまで繰り返す(第5図(a))。
Hereinafter, the operation of the management process 302 will be described with reference to FIG. 5 and FIG. The management process 302 first reads out a request message sent by inter-process communication (501), and then selects a request processing unit according to the type of request described at the head of the message, and transfers control to this.
When the execution of each request processing unit is completed, the process returns to the reading of the request message (501), and this process is repeated until a termination request is sent (FIG. 5 (a)).

各要求処理部の動作としては、要求の種類が<登録>
であれば、続くメツセージの残りのデータを夫々画像デ
ータのxsize,ysize,nbyte,メツセージを送ったユーザの
uidとして受け取る。次いで、管理プロセス302は、最新
画像idを格納した内部変数の値を1増やした値(これが
前以て設定された最大値を越えた場合には1)を要求さ
れた画像データに対する画像idとし、この画像idを最新
画像idとして前記内部変数に格納する。続いて、画像デ
ータ管理テーブルIDTBLの各行の画像idの値を先頭から
順に読み出し、もし、格納されている値が0である行の
番号(つまり未登録行)が無ければ、異常終了メツセー
ジを実行プロセスへ送って登録処理を終了する。未登録
行がある場合には、この行に画像id,xsize,ysize,nbyt
e,uidを登録し、実行プロセスへ画像idを送って登録処
理を終了する(第5図(b))。
As the operation of each request processing unit, the type of request is <register>
If this is the case, the remaining data of the following message will be stored in the xsize, ysize, nbyte of the image data and the user who sent the message, respectively.
Receive as uid. Next, the management process 302 sets the value of the internal variable storing the latest image id, which is incremented by 1 (1 if this exceeds the preset maximum value), as the image id for the requested image data. This image id is stored in the internal variable as the latest image id. Subsequently, the values of the image ids of the respective rows of the image data management table IDTBL are sequentially read from the top, and if there is no row number having a stored value of 0 (that is, an unregistered row), an abnormal end message is executed. Send to the process and end the registration process. If there is an unregistered line, the image id, xsize, ysize, nbyt
The e and uid are registered, the image id is sent to the execution process, and the registration process is completed (FIG. 5 (b)).

要求の種類が<占有−連続配置>あるいは<占有−固
定配置>であれば、続くメツセージの残りのデータをそ
れぞれ使用する画像データの画像id、メツセージを送っ
たユーザのuidとして受け取る。次いで、管理プロセス3
02は、画像データ管理テーブルIDTBLの各行の画像idの
値を先頭から順に読み出し、もし、格納されている値が
要求された画像idと一致する行がない(つまり、画像デ
ータが未登録)もしくは画像idの一致する行の状態値が
1あるいは2(画像データが使用中)ならば、異常終了
メツセージを実行プロセスへ送って占有処理を終了す
る。画像データが登録済で使用中でないならば、この行
のxsize,ysize,nbyte,状態値,対応フレームを読み出し
て、以下に進む。
If the type of request is <occupied-continuous arrangement> or <occupied-fixed arrangement>, the remaining data of the subsequent message is received as the image id of the image data to be used and the uid of the user who sent the message. Then, management process 3
02 reads out the value of the image id of each row of the image data management table IDTBL in order from the top, and if there is no row whose stored value matches the requested image id (that is, the image data is not registered) or If the status value of the row with the matching image id is 1 or 2 (image data is in use), an abnormal end message is sent to the execution process, and the occupation process ends. If the image data has been registered and is not being used, the xsize, ysize, nbyte, state value, and corresponding frame of this row are read, and the process proceeds to the following.

もし、状態値が0(画像データなしを示す)ならば、
メモリ領域管理テーブルIMTBLの各行の値を順に読み出
し、画像の大きさ分だけの空領域(メモリ領域管理テー
ブルIMTBLの値が0で示される)を見つける。適当な空
領域が無いならば、異常終了メツセージを実行プロセス
へ送って占有処理を終了し、あるならば、メモリ領域管
理テーブルIMTBLのこれらの行の値をユーザのuidに更新
し、この空領域のフレーム番号を画像データ管理テーブ
ルIDTBLの対応フレームの項と戻り値用の配列に登録
し、戻り値用配列の内容をuidで示されたユーザへ送
り、占有終了する。
If the status value is 0 (indicating no image data),
The value of each row of the memory area management table IMTBL is read in order, and an empty area corresponding to the size of the image (the value of the memory area management table IMTBL is indicated by 0) is found. If there is no suitable empty area, an abnormal termination message is sent to the execution process to terminate the occupation processing.If there is, an appropriate value of these rows in the memory area management table IMTBL is updated to the user uid. Is registered in the item of the corresponding frame of the image data management table IDTBL and the array for the return value, the contents of the array for the return value are sent to the user indicated by uid, and the occupancy ends.

画像データ管理テーブルIDTBLの状態値が0以外(画
像データが既に存在するを示す)の場合には、もし、状
態値が示す現時点での配置形式と要求される配置形式が
一致するならば、そのまま画像データ管理テーブルIDTB
Lの対応フレームに格納されていた戻り値用配列を実行
プロセスに送り占有処理を終了する。一致しないなら
ば、配置変換処理を実行し、正常終了すれば画像データ
管理テーブルIDTBLの対応フレームに格納されていた戻
り値用配列を実行プロセスに送り、異常終了すればその
まま、占有処理を終了する。(以上第5図(c))。
If the status value of the image data management table IDTBL is other than 0 (indicating that the image data already exists), if the current layout format indicated by the status value matches the required layout format, it is left as it is. Image data management table IDTB
The return value array stored in the corresponding frame of L is sent to the execution process, and the occupation process ends. If they do not match, the layout conversion processing is executed. If the processing ends normally, the return value array stored in the corresponding frame of the image data management table IDTBL is sent to the execution process. If the processing ends abnormally, the occupation processing ends as it is. . (FIG. 5 (c)).

ここで利用する戻り値用の配列は画像メモリのフレー
ム数だけの大きさで、その内容はたとえば、 {1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0} のようなものであり、ここで、0は指定なし、負の値は
エラーを示す。要求の種類が<解放>であれば、続くメ
ツセージの残りの部分を画像データの画像id、メツセー
ジを送ったユーザのuidとして受け取る。次いで画像デ
ータ管理テーブルIDTBLとメモリ領域管理テーブルIMTBL
の各項を参照し、もし、受け取ったuidが画像idに対応
する画像メモリ領域の占有者のuid或は予め設定された
特権ユーザのuidと一致するならば、画像データ管理テ
ーブルIDTBLの画像idに対応する行の状態値の項を非占
有状態を示す値に更新して正常終了メツセージを送り返
し、解放処理を終了する。これ以外の場合には、異常終
了メツセージを実行プロセスへ送って解放処理を終了す
る。(第5図(d)) 要求の種類が<削除>であれば、続くメツセージの残
りの部分を画像データの画像id、メツセージを送ったユ
ーザのuidとして受け取る。次いで、画像データ管理テ
ーブルIDTBLの各項を参照し、もし、受け取ったuidが画
像idに対応する画像データ作成者のuidあるいはあらか
じめ設定された特権ユーザのuidと一致し、状態値の項
が画像データが非占有状態の場合の値ならば、画像デー
タ管理テーブルIDTBLの画像idの項を0とし、状態値を
0とし、対応フレームの項に格納されていたフレームに
対してメモリ領域管理テーブルIMTBLの値を0とした
後、実行プロセスへ正常終了メツセージを送り、削除処
理を終了する。これ以外の場合には、異常終了メツセー
ジを実行プロセスへ送って削除処理を終了する。(第5
図(e)) 第7図は、配置変換操作を行う場合の管理プロセスの
動作を示した流れ図である。
The array for the return value used here is as large as the number of frames in the image memory, and its contents are, for example, {1,3,0,0,0,0,0,0,0,0,0,0 , 0,0,0,0}, where 0 is unspecified and a negative value indicates an error. If the request type is <release>, the remaining part of the subsequent message is received as the image id of the image data and the uid of the user who sent the message. Next, the image data management table IDTBL and the memory area management table IMTBL
If the received uid matches the uid of the occupant of the image memory area corresponding to the image id or the uid of the preset privileged user, the image id of the image data management table IDTBL is referred to. Is updated to the value indicating the non-occupied state in the row corresponding to the, the normal end message is sent back, and the release processing ends. In other cases, an abnormal termination message is sent to the execution process, and the release processing ends. (FIG. 5 (d)) If the type of request is <delete>, the remaining part of the following message is received as the image id of the image data and the uid of the user who sent the message. Next, referring to each item of the image data management table IDTBL, if the received uid matches the uid of the image data creator corresponding to the image id or the uid of the preset privileged user, the state value item is If the data is a value in the non-occupied state, the term of the image id of the image data management table IDTBL is set to 0, the state value is set to 0, and the memory area management table IMTBL is set for the frame stored in the corresponding frame term. Is set to 0, a normal termination message is sent to the execution process, and the deletion processing ends. In other cases, the abnormal termination message is sent to the execution process, and the deletion process is terminated. (Fifth
FIG. 7 (e) is a flowchart showing the operation of the management process when the layout conversion operation is performed.

まず、管理プロセスは、画像処理プロセツサへコマン
ドを送る事により目的とするフレームの内容を割り当て
用とは別に用意された一時フレームへ転送する。次に、
この一時フレームと目的フレームを管理プロセスの仮想
記憶領域にマツピングし、それぞれの仮想記憶アドレス
T,Oを得る。
First, the management process sends a command to the image processing processor to transfer the contents of the target frame to a temporary frame prepared separately for the allocation. next,
The temporary frame and the target frame are mapped into the virtual memory area of the management process, and the respective virtual memory addresses are mapped.
Get T, O.

続いて、変換の方向が連続配置から固定配置で、画像
データ管理テーブルのデータ幅の項が1(バイト)なら
ば、 アドレスO+J*framex+Iへ アドレスT+J*xsize+Iの内容1バイトを書き込
む。
Subsequently, if the direction of conversion is from the continuous arrangement to the fixed arrangement and the term of the data width in the image data management table is 1 (byte), 1 byte of the contents of the address T + J * xsize + I is written to the address O + J * framex + I.

変換の方向が連続配置から固定配置で、画像データ管
理テーブルのデータ幅の項が2(バイト)ならば、 アドレスO+J*framex+Iへ アドレスT+(J*xsize+I)*2の0内容1バイ
トを書き込み、アドレスO+FRSIZ+J*framex+Iへ アドレスT+(J*xsize+I)*2+1の内容バイ
トを書き込む。
If the direction of the conversion is from the continuous arrangement to the fixed arrangement, and if the term of the data width of the image data management table is 2 (bytes), 0 bytes 1 address of address T + (J * xsize + I) * 2 is written to address O + J * framex + I, Write the content byte of address T + (J * xsize + I) * 2 + 1 to address O + FRSIZ + J * framex + I.

変換の方向が固定配置から連続配置で、画像データ管
理テーブルのデータ幅の項が1(バイト)ならば、 アドレスO+J*xsize+Iへ アドレスT+J*framex+Iの内容1バイトを書き込
む。
If the direction of the conversion is from the fixed arrangement to the continuous arrangement, and the data width term of the image data management table is 1 (byte), one byte of the contents of the address T + J * framex + I is written to the address O + J * xsize + I.

変換の方向が固定配置から連続配置で、画像データ管
理テーブルのデータ幅の項が2(バイト)ならば、 アドレスO+(J*xsize+I)*2へ アドレスT+J*framex+Iの内容1バイトを書き込
み、 アドレスO+(J*xsize+I)*2+1へアドレス
T+FRSIZ+J*framex+Iの内容1バイトを書き込
む。
If the direction of conversion is from the fixed arrangement to the continuous arrangement, and if the term of the data width of the image data management table is 2 (bytes), write 1 byte of the contents of address T + J * framex + I to address O + (J * xsize + I) * 2 and address Write one byte of the content of the address T + FRSIZ + J * framex + I to O + (J * xsize + I) * 2 + 1.

ここで、xsizeは画像データの横方向の大きさ、frame
xはハードウェアにより決定するフレームの横方向の画
素数、frameyはハードウエアにより決定するフレームの
縦方向の画素数、FRSIZはframex*frameyである。Iは
0からxsize−1、Jは0から(画像データの縦方向の
大きさ)ysize−1の間をループすることにより画像全
域を配置換えする。
Where xsize is the horizontal size of the image data, frame
x is the number of pixels in the horizontal direction of the frame determined by hardware, framey is the number of pixels in the vertical direction of the frame determined by hardware, and FRSIZ is framex * framey. I is rearranged by looping from 0 to xsize-1 and J is from 0 to (vertical size of image data) ysize-1.

データ幅がこれら以外の場合には、異常終了メツセー
ジを送り返し、配置変換処理を終了する。
If the data width is other than these, an abnormal end message is sent back, and the layout conversion processing ends.

〔他の実施例〕[Other embodiments]

上記実施例では、画像メモリ内の領域を指し示す情報
としてフレーム番号を用いたが、画像処理プロセツサの
アドレツシング方法が画像メモリ上の実アドレスの場合
には、領域指定の情報として実アドレスを用いることが
でき、フレーム番号から実アドレス計算の手間を省くこ
とができる。また、前記実施例では、1フレームに画像
1枚と言う格納形態を考えたが、画像フレームを分割し
て利用できるような画像処理ハードウエアを利用する場
合には、どのような部分領域が占有されているかを情報
として管理テーブルに格納する事により、画像メモリに
より多くの画像を格納することができる。
In the above embodiment, the frame number is used as the information indicating the area in the image memory. However, when the addressing method of the image processing processor is the real address on the image memory, the real address may be used as the information for specifying the area. It is possible to save the trouble of calculating the real address from the frame number. Further, in the above-described embodiment, a storage form of one image per frame is considered. However, in the case of using image processing hardware capable of dividing and using an image frame, what kind of partial area is occupied. By storing in the management table as information as to whether or not the image data is stored, more images can be stored in the image memory.

また、画像メモリ領域がいっぱいとなった場合に、<
解放>状態にある画像データを管理プロセスの仮想記憶
領域に転送し、主記憶もしくはシステムデイスクに待避
させることで、この画像データに対する画像メモリ領域
(フレーム)を別の画像に割り当てることも可能であ
る。また、前記実施例では、管理プロセスのソフトウエ
ア処理により、EWSのCPUが画像データの配置変換を行っ
たが、この操作をハード化して画像処理ハードウエアの
配置変換操作を管理プロセスが制御するようにすること
も可能である。
If the image memory area is full, <
The image memory area (frame) for this image data can be allocated to another image by transferring the image data in the release> state to the virtual storage area of the management process and saving the image data in the main storage or the system disk. . Further, in the above-described embodiment, the CPU of the EWS performs the layout conversion of the image data by the software processing of the management process, but this operation is hardened so that the management process controls the layout conversion operation of the image processing hardware. It is also possible to

以上説明したように、実際に画像処理を実行するプロ
セスとは別に管理を行うプロセスを設け、画像データの
配置変換を行う事により、画像メモリ上の使用状況に応
じて適切な領域を使用する領域として動的に割り当てる
ことが可能となり、他のプログラムの処理結果を破壊す
ることなくプログラムを利用できる上に、既存の画像処
理ソフトウエアによる処理と画像処理プロセツサによる
処理が簡便に混在利用できるようになった。また本発明
により、画像メモリのフレームの大きさ等の情報が管理
プロセスとマツピングを行うルーチンに集約されること
になり、画像メモリのフレームの大きさを変更した場合
にも、管理プロセスとマツピングを行うルーチンのみの
変更で、本発明を利用したシステム上でのすべての画像
処理プログラムが、新しい画像フレームを有効活用する
ことができる。
As described above, by providing the management process separately from the process of actually executing the image processing, and by performing the layout conversion of the image data, the area that uses the appropriate area according to the usage state on the image memory is used. As a result, it is possible to use the program without destroying the processing results of other programs, and to easily use the processing by the existing image processing software and the processing by the image processing processor. became. Further, according to the present invention, information such as the size of the frame of the image memory is collected into a management process and a routine for performing the mapping. Even when the size of the frame of the image memory is changed, the management process and the mapping are performed. By changing only the routine to be performed, all the image processing programs on the system using the present invention can effectively utilize the new image frame.

[発明の効果] 以上説明したように、本発明は、現在画像データを管
理している配置形式と要求される配置形式が異なってい
た場合に、画像データの配置変換をして処理するので、
画像メモリ上の使用状況に応じて適切な領域を使用する
領域として動的に割り当てることが可能となった。
[Effects of the Invention] As described above, according to the present invention, when the layout format that currently manages image data and the required layout format are different, processing is performed by performing layout conversion of the image data.
It has become possible to dynamically allocate an appropriate area as an area to be used in accordance with the use situation on the image memory.

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

第1図は画像処理システムの構成図、 第2図は画像メモリ上の画像データの配置を示した図、 第3図は本発明の一実施例である画像処理システムにお
けるプロセスの構成の図、 第4図は実行プロセスと管理プロセスの概略動作及びそ
の関係を示した図、 第5図は管理プロセスの動作を示した流れ図、 第6図は管理プロセスの使用する管理テーブルを示した
図、 第7図は配置変換操作の動作を示した流れ図である。 101はホストとなる計算機(エンジニアリング・ワーク
ステーション)、 102は画像処理ハードウエア、 104は画像処理ハードウエア内の画像メモリ、 301は実際に画像データの処理を行う画像処理実行プロ
セス、 302は画像メモリの使用状況を記憶し、領域管理を行う
プロセス、 303は画像メモリの使用状況を模式的に示した図、
FIG. 1 is a configuration diagram of an image processing system, FIG. 2 is a diagram showing an arrangement of image data in an image memory, FIG. 3 is a diagram of a process configuration in an image processing system according to an embodiment of the present invention, FIG. 4 is a diagram showing a schematic operation of an execution process and a management process and a relationship between them. FIG. 5 is a flowchart showing an operation of the management process. FIG. 6 is a diagram showing a management table used by the management process. FIG. 7 is a flowchart showing the operation of the layout conversion operation. 101 is a host computer (engineering workstation), 102 is image processing hardware, 104 is an image memory in the image processing hardware, 301 is an image processing execution process for actually processing image data, and 302 is an image memory The process of storing the usage status of the image memory and managing the area, 303 is a diagram schematically showing the usage status of the image memory,

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06T 1/60 G06F 12/02 530 ──────────────────────────────────────────────────続 き Continued on front page (58) Field surveyed (Int.Cl. 6 , DB name) G06T 1/60 G06F 12/02 530

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】画像データを記憶する記憶工程と、 前記記憶工程により記憶された画像データを処理する画
像処理工程と、 前記記憶工程により記憶された画像データを複数の異な
る配置形式で管理する管理工程と、 前記記憶工程により記憶された画像データに対して前記
画像処理工程より要求される配置形式が、前記管理工程
により管理されている配置形式と異なるか否かを判断す
る判断工程と、 前記判断工程により画像データの配置形式が異なると判
断された場合、画像データの配置を変換する変換工程
と、 を有することを特徴とする画像処理方法。
A storage step of storing the image data; an image processing step of processing the image data stored in the storage step; and a management of managing the image data stored in the storage step in a plurality of different arrangement formats. A determination step of determining whether an arrangement format requested by the image processing step for the image data stored in the storage step is different from an arrangement format managed by the management step; A conversion step of converting the arrangement of the image data when the arrangement step determines that the arrangement format of the image data is different.
【請求項2】画像データを記憶する画像メモリと、 前記画像メモリ内の画像データを処理する画像処理手段
と、 前記画像メモリ内の画像データを複数の異なる配置形式
で管理する管理手段と、 前記画像処理手段から前記画像メモリに対する要求の配
置形式が、前記管理手段により管理されている配置形式
と異なるか否か判断する判断手段と、 前記判断手段により画像データの配置形式が異なると判
断された場合、画像データの配置を変換する配置変換手
段と、 を有することを特徴とする画像処理装置。
2. An image memory for storing image data, image processing means for processing image data in the image memory, management means for managing image data in the image memory in a plurality of different arrangement formats, Determining means for determining whether or not the layout format of the request from the image processing means to the image memory is different from the layout format managed by the managing means; and determining that the layout format of the image data is different by the determining means. An image processing apparatus, comprising: an arrangement conversion unit for converting an arrangement of image data.
JP5965888A 1988-03-14 1988-03-14 Image processing method and apparatus Expired - Lifetime JP2941810B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP5965888A JP2941810B2 (en) 1988-03-14 1988-03-14 Image processing method and apparatus
US08/116,545 US5384900A (en) 1988-03-14 1993-09-07 Method of managing an image memory by a process independent of an image processing process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5965888A JP2941810B2 (en) 1988-03-14 1988-03-14 Image processing method and apparatus

Publications (2)

Publication Number Publication Date
JPH01233575A JPH01233575A (en) 1989-09-19
JP2941810B2 true JP2941810B2 (en) 1999-08-30

Family

ID=13119519

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5965888A Expired - Lifetime JP2941810B2 (en) 1988-03-14 1988-03-14 Image processing method and apparatus

Country Status (1)

Country Link
JP (1) JP2941810B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03127143A (en) * 1989-10-12 1991-05-30 Sanyo Electric Co Ltd Image processor

Also Published As

Publication number Publication date
JPH01233575A (en) 1989-09-19

Similar Documents

Publication Publication Date Title
US6823472B1 (en) Shared resource manager for multiprocessor computer system
US6925546B2 (en) Memory pool configuration system
US6724390B1 (en) Allocating memory
US7770177B2 (en) System for memory reclamation based on thread entry and release request times
US5020003A (en) Graphics controller image creation
JP2774862B2 (en) DMA control device and information processing device
US6598097B1 (en) Method and system for performing DMA transfers using operating system allocated I/O buffers
US6600493B1 (en) Allocating memory based on memory device organization
US5384900A (en) Method of managing an image memory by a process independent of an image processing process
JP2941810B2 (en) Image processing method and apparatus
JPS62231382A (en) Image processing method and apparatus
JPH0798663A (en) Asynchronous i/o control system
EP0430500B1 (en) System and method for atomic access to an input/output device with direct memory access
JP2941809B2 (en) Image processing method and apparatus
JP3733402B2 (en) Processor resource selection method, processor resource selection system therefor, and computer-readable program recording medium
CN111091488B (en) OpenCV-based memory management method, device and terminal
JP2898985B2 (en) Image processing method
JPH0251740A (en) Control system for process allocation
CN116775513A (en) Physical memory dynamic allocation system and method supporting equipment through virtual machine
JP2833814B2 (en) I / O buffer allocation method
JP2781999B2 (en) Startup method of common data channel device in multiprocessor system
JPH04250540A (en) Image processor
JPH04295935A (en) Data processor
JP2883200B2 (en) Access management method for a plurality of memory cards in a printer device
JP2576934B2 (en) Memory-mapped interrupt method

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term
FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080618

Year of fee payment: 9