JPH0594533A - Device for extracting run - Google Patents

Device for extracting run

Info

Publication number
JPH0594533A
JPH0594533A JP3290789A JP29078991A JPH0594533A JP H0594533 A JPH0594533 A JP H0594533A JP 3290789 A JP3290789 A JP 3290789A JP 29078991 A JP29078991 A JP 29078991A JP H0594533 A JPH0594533 A JP H0594533A
Authority
JP
Japan
Prior art keywords
run
image data
conversion table
input image
black
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
Application number
JP3290789A
Other languages
Japanese (ja)
Inventor
Shinsuke Teramura
信介 寺村
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP3290789A priority Critical patent/JPH0594533A/en
Publication of JPH0594533A publication Critical patent/JPH0594533A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

(57)【要約】 【目的】 画像データ中の黒ランを高速に抽出すること
ができ、集積化も容易なラン抽出装置を実現する。 【構成】 複数画素単位の入力画像データをそれに含ま
れる白ランの個数に着目して変換する第1変換テーブル
103と、その変換データを黒ランの抽出のためのデー
タに変換する第2変換テーブル104と、その変換デー
タを用いて黒ランの始点座標及び終点座標を求める回路
手段105〜109を有し、第2変換テーブルを、1単
位の画像データに含まれる白ランの個数によって分類さ
れたタイプ別に複数のテーブルに分割し、それぞれに対
応タイプによって決まる必要な情報のみを記憶する。
(57) [Abstract] [Purpose] To realize a run extraction device that can extract black runs in image data at high speed and is easy to integrate. A first conversion table 103 for converting input image data in units of a plurality of pixels by focusing on the number of white runs included therein, and a second conversion table for converting the converted data into data for extracting black runs. 104 and circuit means 105 to 109 for obtaining the start point coordinates and the end point coordinates of the black run using the converted data, and the second conversion table is classified by the number of white runs included in one unit of image data. Each type is divided into a plurality of tables, and only necessary information determined by the corresponding type is stored in each table.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、文字認識などの画像処
理に係り、特に2値画像データよりランを高速に抽出す
るためのラン抽出装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to image processing such as character recognition, and more particularly to a run extraction device for extracting runs from binary image data at high speed.

【0002】[0002]

【従来の技術】従来、2値の画像データよりラン(黒画
素または白画素の連続部分)を抽出する場合は、画像を
1ラインずつラスタースキャンして黒ラン(黒画素の連
続部分)の始点と終点を検出するという方法が一般的で
あった。より具体的には、画像データはメモリや二次記
憶、あるいはスキャナなどの外部デバイスから取り込む
が、いずれにしてもデータの転送単位は1画素ではなく
複数画素が普通である。例えば、1画素を1ビットで表
現し、1バイトすなわち8画素を単位としてデータを取
り込む。そして、このような複数画素単位で取り込んだ
画像データについて、ラスタースキャン方向に1ビット
ずつ画素の白黒を判定し、白画素から黒画素への変化点
と黒画素から白画素への変化点を検出するという処理を
繰り返して黒ランを抽出している。
2. Description of the Related Art Conventionally, when a run (a continuous portion of black pixels or white pixels) is extracted from binary image data, a raster scan of the image is performed line by line to start a black run (a continuous portion of black pixels). The method of detecting the end point was common. More specifically, the image data is fetched from a memory, secondary storage, or an external device such as a scanner, but in any case, the unit of data transfer is not one pixel but a plurality of pixels. For example, one pixel is represented by 1 bit, and data is fetched in units of 1 byte, that is, 8 pixels. Then, for such image data captured in units of a plurality of pixels, black and white of the pixel is determined bit by bit in the raster scan direction, and a change point from a white pixel to a black pixel and a change point from a black pixel to a white pixel are detected. The black run is extracted by repeating the processing.

【0003】[0003]

【発明が解決しようとする課題】しかし、1画素単位の
白黒判定を行なうために処理時間が長く、また前後画素
の白黒変化の判定を行なうために処理フローが複雑にな
ることから、ラン抽出の高速化が困難であるとともに装
置構成もしくはソフトウエアが複雑化するという問題が
あった。
However, since the processing time is long because the black-and-white judgment is performed in units of one pixel, and the processing flow is complicated because the black-and-white change of the preceding and succeeding pixels is judged, the run extraction is not performed. There is a problem that speeding up is difficult and the device configuration or software becomes complicated.

【0004】本発明の目的は、上記問題点を解決するた
め、ラン抽出処理をテーブル引きを主体とした単純な処
理とすることにより、複数画素単位で画像データを取り
込みラン抽出を高速に実行することが可能であり、か
つ、ラン抽出のためのテーブルを含む処理回路の集積化
が容易なラン抽出装置を提供するにある。
In order to solve the above problems, an object of the present invention is to perform run extraction processing at high speed by incorporating image data in units of a plurality of pixels by using run extraction processing as a simple process mainly based on table lookup. It is possible to provide a run extraction device that is capable of easily integrating a processing circuit including a table for run extraction.

【0005】[0005]

【課題を解決するための手段】請求項1の発明によれ
ば、ラン抽出装置は、複数画素を単位とした入力画像デ
ータを、それに含まれる白ランの個数に着目して変換す
る第1変換テーブルと、該第1変換テーブルによる変換
データを黒ランの抽出のためのデータに変換する第2変
換テーブルと、該第2変換テーブルによる変換データを
用いて黒ランの始点座標及び終点座標を求める回路手段
とを有し、該第2変換テーブルは、1単位の画像データ
に含まれる白ランの個数によって分類されたタイプ別に
複数のテーブルに分割され、該分割テーブルは対応タイ
プによって決まる必要な情報のみを記憶する構成とされ
る。
According to the first aspect of the present invention, a run extraction device converts input image data in units of a plurality of pixels by focusing on the number of white runs included therein. A table, a second conversion table for converting the conversion data by the first conversion table into data for extracting a black run, and a start point coordinate and an end point coordinate of the black run using the conversion data by the second conversion table Circuit means, and the second conversion table is divided into a plurality of tables according to types classified according to the number of white runs included in one unit of image data, and the division table has necessary information determined by the corresponding type. It is configured to remember only.

【0006】請求項2の発明によれば、請求項1の発明
において、第1変換テーブルによる変換データは、入力
画像データをそれに含まれる白ランの個数により分類し
たタイプの情報と該入力画像データのパターンに対応し
たアドレス情報とを含むものとされ、第2変換テーブル
による変換データは、入力画像データの開始位置にある
黒ラン及び終了位置にある黒ランのそれぞれの長さの情
報、該入力画像データ中の前後を白ランで挟まれた黒ラ
ンの始点及び終点の位置の情報を含むものとされる。
According to the invention of claim 2, in the invention of claim 1, the conversion data by the first conversion table includes information of a type in which the input image data is classified according to the number of white runs included therein and the input image data. And the address information corresponding to the pattern, the conversion data by the second conversion table is information on the lengths of the black run at the start position and the black run at the end position of the input image data. It is assumed to include information on the positions of the start point and the end point of the black run in which the front and back of the image data are sandwiched by white runs.

【0007】請求項3の発明によれば、請求項2の発明
において、第2変換テーブルは第1変換テーブルの変換
データ中のタイプ情報に従って前記複数の分割テーブル
を選択的に作動させるデコーダを含み、該複数の分割テ
ーブルを重複したアドレスを割り当てた構成とされる。
According to the invention of claim 3, in the invention of claim 2, the second conversion table includes a decoder for selectively operating the plurality of division tables according to the type information in the conversion data of the first conversion table. , A plurality of division tables are assigned with overlapping addresses.

【0008】請求項4の発明によれば、請求項2の発明
において、第1変換テーブルの変換データ中の黒ランの
始点位置及び終点位置の情報は入力画像データの開始位
置座標を基準としたオフセットであり、回路手段は、黒
ランの長さ情報を保持するためのランレングスカウン
タ、入力画像データの開始位置座標を保持するための座
標保持カウンタ、及び演算回路を含み、該各カウンタの
値及び第2変換テーブルの変換データを用いた演算を該
演算回路により行なうことによって黒ランの始点及び終
点の座標を求める構成とされる。
According to the invention of claim 4, in the invention of claim 2, the information of the start point position and the end point position of the black run in the conversion data of the first conversion table is based on the start position coordinates of the input image data. Offset, the circuit means includes a run length counter for holding the length information of the black run, a coordinate holding counter for holding the start position coordinates of the input image data, and an arithmetic circuit, and the value of each counter. And the operation using the conversion data of the second conversion table is performed by the operation circuit to obtain the coordinates of the start point and the end point of the black run.

【0009】請求項5の発明によれば、請求項4の発明
において、回路手段は、入力画像データのタイプに無関
係に該入力画像データの開始位置にある黒ランの長さの
情報を前記ランレングスカウンタの値に加算する第1の
処理を行ない、該入力画像データが白ランを含まないタ
イプのときは該第1処理の後に該入力画像データに対す
る処理を終了し、該入力画像データが1個以上の白ラン
を含むタイプのときは該ランレングスカウンタの値が0
以外であれば、一つの黒ランの始点及び終点の座標を求
めて出力する第2の処理を行ない、該入力画像データが
白ランを1個のみ含むタイプのときは該第2処理の後に
該入力画像データの終了位置にある黒ランの長さの情報
を該ランレングスカウンタに設定する第3の処理段階を
行ない該入力画像データに対する処理を終了し、該入力
画像データが2個以上の白ランを含むタイプのときは、
該入力画像中の前後を白ランで挟まれた黒ランの始点及
び終点の座標を求める第4の処理を該入力画像データの
タイプによって決まる回数返した後、該第3処理を行な
って該入力画像データに対する処理を終了する構成とさ
れる。
According to the invention of claim 5, in the invention of claim 4, the circuit means provides the information of the length of the black run at the start position of the input image data to the run regardless of the type of the input image data. A first process of adding to the value of the length counter is performed. When the input image data is of a type that does not include a white run, the process for the input image data is terminated after the first process, and the input image data becomes 1 When the type includes more than one white run, the value of the run length counter is 0.
Otherwise, the second process of obtaining and outputting the coordinates of the start point and the end point of one black run is performed. When the input image data is of a type including only one white run, the second process is performed after the second process. A third processing step of setting information on the length of the black run at the end position of the input image data in the run length counter is performed, the processing for the input image data is completed, and the input image data has two or more white lines. For types that include runs,
The fourth process of obtaining the coordinates of the start point and the end point of the black run sandwiched by white runs in the front and back of the input image is returned a number of times determined by the type of the input image data, and then the third process is performed to perform the input. The configuration is such that the processing on the image data is terminated.

【0010】請求項6の発明によれば、ラン抽出装置
は、画像データを記憶するイメージメモリと、該イメー
ジメモリより各ラインの画像データを読み出し最初の黒
画素の位置を検出する黒画素検索部と、該黒画素検索部
により検索された位置を記憶するワークメモリと、請求
項1ないし5のいずれか1項の発明による構成のラン抽
出部とを有し、該ラン抽出部において、処理しようとす
る現在ラインのラン抽出処理を、該ワークメモリに記憶
されている該現在ラインに対する位置を含む画像データ
より開始する構成とされる。
According to the sixth aspect of the present invention, the run extraction device includes an image memory for storing image data, and a black pixel search unit for reading the image data of each line from the image memory and detecting the position of the first black pixel. A work memory for storing the position searched by the black pixel searching unit; and a run extracting unit having the configuration according to any one of claims 1 to 5, and the run extracting unit will perform processing. The run extraction process for the current line is started from the image data including the position for the current line stored in the work memory.

【0011】[0011]

【作用】前述のように請求項1ないし5に記載された発
明は、画像データを複数画素を単位として取り込み、こ
れを第1変換テーブルによって入力画像データ中の白ラ
ンの個数に着目して変換し、さらに第2変換テーブルに
より黒ラン抽出のためのデータに変換し、この変換デー
タを用いて黒ランの始終点座標を求める構成であるた
め、黒ラン抽出の高速化が容易となり、請求項5の記載
より最も明らかなように処理のアルゴリズムを単純化す
ることができ、また請求項4の記載によって最も明らか
になるに装置構成も単純なものとすることができる。
As described above, according to the invention described in claims 1 to 5, the image data is fetched in a unit of a plurality of pixels and is converted by the first conversion table while paying attention to the number of white runs in the input image data. Further, since the second conversion table is used to convert the data into data for black run extraction and the start / end coordinates of the black run are obtained using this conversion data, the speed of black run extraction is facilitated, As can be seen most clearly from the description of item 5, the processing algorithm can be simplified, and as is most apparent from the description of claim 4, the device configuration can be simple.

【0012】実施例に関連して詳細に説明するように、
入力画像データをそれに含まれる白ランの個数によって
タイプ分けすると、入力画像データに対して第2変換テ
ーブルの変換データとして提供する必要のある情報が増
減する。したがって、請求項1に示されるように分類さ
れたタイプ別に第2変換テーブルを複数のテーブルに分
割し、各分割テーブルに対応したタイプによって決まる
必要な情報だけを記憶させるならば、第2変換テーブル
を実現するために必要なROMのサイズを小さくするこ
とができ、これは第2変換テーブルを回路手段と一緒に
集積化することを容易にする。また、請求項2の記載か
らも明かなように第1変換テーブルの変換データのビッ
ト数は、第2変換テーブルの変換データのビット数より
遥かに少なくできる。特に請求項3に記載された構成と
することにより、第1変換テーブルの各分割テーブルに
別個のアドレスを割り当てる場合に比べ、第2変換テー
ブルの変換データ中のアドレス情報のビット数を最少に
することができる。これは、第1変換テーブルと回路手
段を一つのLSIとして集積化し、第2変換テーブルを
外付け回路とした場合に、第2変換テーブルとLSIと
の接続のために必要な入力ピンの本数を少なくできると
いうことである。このピン本数の増加はLSIの大型化
・コスト上昇の大きな原因である。このように、画像デ
ータの変換テーブルを一つのテーブルにする構成に比
べ、本発明によればラン抽出装置の集積化が容易にな
る。
As described in detail in connection with the embodiments,
When the input image data is classified according to the number of white runs included in the input image data, the information that needs to be provided as the conversion data of the second conversion table for the input image data increases or decreases. Therefore, if the second conversion table is divided into a plurality of tables according to the classified types as shown in claim 1 and only necessary information determined by the type corresponding to each divided table is stored, the second conversion table is obtained. It is possible to reduce the size of the ROM required to implement the above, which makes it easy to integrate the second conversion table with the circuit means. Further, as is clear from the description of claim 2, the number of bits of the conversion data of the first conversion table can be made far smaller than the number of bits of the conversion data of the second conversion table. In particular, with the configuration described in claim 3, the number of bits of the address information in the conversion data of the second conversion table is minimized as compared with the case where separate addresses are assigned to the respective division tables of the first conversion table. be able to. This is the number of input pins required for connecting the second conversion table and the LSI when the first conversion table and the circuit means are integrated as one LSI and the second conversion table is an external circuit. It means that you can reduce it. This increase in the number of pins is a major cause of large-sized LSIs and increased costs. As described above, according to the present invention, the run extracting apparatus can be easily integrated, as compared with the configuration in which the image data conversion table is a single table.

【0013】文書画像等においては、白画素の比率が極
めて大きく、画像データを1バイト単位で処理する場
合、全ビットが白画素のバイトの割合が90%を超える
ことも稀ではなく、このような画像ではラインの先頭か
ら最初の黒画素が出現するまでのバイト数が非常に多い
場合も少なくない。請求項6の発明によれば、各ライン
の先頭の黒画素の位置の検索とラン抽出処理とを並列に
行ない、各ラインの先頭の黒画素が含まれるバイト以降
の画像データについてラン抽出処理を開始することによ
って、先頭より白画素が連続するようなラインに対する
処理時間を短縮し、ラン抽出処理の一層の高速化が可能
である。
In a document image or the like, the ratio of white pixels is extremely large, and when the image data is processed in 1-byte units, it is not rare that the ratio of bytes of white pixels in all bits exceeds 90%. In many images, the number of bytes from the beginning of the line to the appearance of the first black pixel is very large in many cases. According to the invention of claim 6, the search for the position of the black pixel at the head of each line and the run extraction process are performed in parallel, and the run extraction process is performed for the image data after the byte including the black pixel at the head of each line. By starting the processing, the processing time for a line in which white pixels are continuous from the beginning can be shortened, and the run extraction processing can be further speeded up.

【0014】[0014]

【実施例】以下、本発明の一実施例を説明するが、ここ
では画像データを1ビット/画素とし、1バイト(8ビ
ット)を処理単位としてラン抽出を行なうものとする。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment of the present invention will be described below. Here, it is assumed that image data is 1 bit / pixel and run extraction is performed with 1 byte (8 bits) as a processing unit.

【0015】このラン抽出装置の全体的構成は図1に示
す通りであり、その構成要素のうちで例えば破線枠10
0の内部のものが一つのLSIパッケージとして集積化
される。メモリ111を、その必要メモリ量にもよるが
一緒に集積化することも可能であり、逆にメモリアドレ
ス管理部110を外部回路とすることも可能である。た
だし、本発明の利点を活かすために、画像データインタ
ーフェイス部102と第1変換テーブル103は外部回
路とされるべきである。
The overall construction of this run extracting apparatus is as shown in FIG. 1, and among the constituent elements, for example, a broken line frame 10 is used.
Those inside 0 are integrated as one LSI package. The memory 111 can be integrated together depending on the required memory amount, and conversely, the memory address management unit 110 can be an external circuit. However, in order to utilize the advantages of the present invention, the image data interface unit 102 and the first conversion table 103 should be external circuits.

【0016】処理の概略は次の通りである。画像データ
のソース101(メモリ、二次記憶、スキャナなど)か
ら、画像データ・インターフェイス部102によって画
像データが1バイトずつ読み込まれて第1変換テーブル
103に入力され、この第1変換テーブル103から3
ビットのタイプ情報と7ビットのアドレス情報が出力さ
れる。このタイプ情報及びアドレス情報を入力として第
2変換テーブル104から、pre-len(4ビット)、pos
t-len(3ビット) 、run1 ,run2,run3 (それぞれの始
点座標3ビット、終点座標3ビットの計6ビット)の各
情報が出力される。シーケンスコントローラ105は、
第2変換テーブル104の出力情報及び第1変換テーブ
ル103からのタイプ情報などに基づき加算器108,
109、ランレングスカウンタ107、座標保持カウン
タ106の制御と処理全体のシーケンスを制御し、抽出
されたランの始終点情報をメモリ111へ出力させる。
ランレングスカウンタ107は黒ランの長さを保持する
ためのもので、座標保持カウンタ106は現在処理して
いる画像データの先頭位置の座標を保持するためのもの
である。メモリアドレス管理部110は、シーケンスコ
ントローラ105からの書き込み指令に従って、メモリ
111へのラン始終点情報の書き込みの制御とアドレス
管理を行なう。以下、処理内容及び第2変換テーブル1
04の構成について詳細に説明する。
The outline of the processing is as follows. From the image data source 101 (memory, secondary storage, scanner, etc.), the image data interface unit 102 reads the image data byte by byte and inputs it to the first conversion table 103.
Bit type information and 7-bit address information are output. With this type information and address information as input, from the second conversion table 104, pre-len (4 bits), pos
Each information of t-len (3 bits), run1, run2, run3 (3 bits for each starting point coordinate and 3 bits for ending point coordinate, total 6 bits) is output. The sequence controller 105
Based on the output information of the second conversion table 104 and the type information from the first conversion table 103, the adder 108,
The control of 109, the run length counter 107, and the coordinate holding counter 106 and the sequence of the entire process are controlled to output the start / end point information of the extracted run to the memory 111.
The run length counter 107 is for holding the length of the black run, and the coordinate holding counter 106 is for holding the coordinates of the head position of the image data currently being processed. The memory address management unit 110 controls the writing of run start / end point information in the memory 111 and manages the address in accordance with a write command from the sequence controller 105. Hereinafter, the processing content and the second conversion table 1
The configuration of 04 will be described in detail.

【0017】本実施例においては、処理単位の1バイト
すなわち8画素の画像データをランのパターンとして考
える。このパターンは256( =28)通りのものがあ
るが、これを出現した白ランの個数によって(表1)に
示す5種類のタイプに分類する。すなわち、第1変換テ
ーブル103は、入力した画像データのビットパターン
をアドレス情報として、この分類に従ったタイプ情報を
出力するわけである。
In the present embodiment, image data of 1 byte of processing unit, that is, 8 pixels is considered as a run pattern. There are 256 (= 2 8 ) patterns, and they are classified into five types shown in (Table 1) according to the number of white runs that appear. That is, the first conversion table 103 outputs the type information according to this classification using the bit pattern of the input image data as the address information.

【表1】 [Table 1]

【0018】ここで、白ランがあるというは、そこで黒
ランが途切れているということである。注目している画
像データ中の黒ランの前及び後に白ランがあれば、その
黒ランは黒ランとして確定し登録してよい。このような
黒ランを確定ランと呼ぶことにする。1バイトのデータ
中の確定ランの出現個数は最大3個であるので、画像デ
ータの先頭側より出現順にrun1,run2,run3 と表わすも
のとする。
The term "white run" means that the black run is interrupted there. If there is a white run before and after the black run in the image data of interest, the black run may be confirmed and registered as a black run. Such a black run will be called a definite run. Since the maximum number of confirmed runs that appear in 1-byte data is three, they are represented as run1, run2, and run3 in the order of appearance from the top of the image data.

【0019】1バイト画像データのランパターン種類数
は256であるが、タイプ別に整理すると、ランパター
ン数と確定ラン数は(表2)の通りである。
The number of types of run patterns of 1-byte image data is 256. When arranged by type, the number of run patterns and the number of fixed runs are as shown in (Table 2).

【表2】 [Table 2]

【0020】また、1バイト単位で画像データを処理す
るため、前後のバイトの画像データとのランの連続関係
を考慮する必要がある。すなわち図4に示すように、注
目している現在の画像データ(実線で囲まれたデータ)
が黒ラン(斜線部)で始まっている場合、この黒ランは
直前に処理した画像データ(破線で囲まれたデータ)の
黒ランの続きである可能性がある。同様に現在の画像デ
ータが黒ランで終わっている場合、次に処理される画像
データの黒ランと連続している可能性がある。このよう
な前後の画像データ中の黒ランと連続した黒ランについ
ては、その連続範囲を確認した段階で、前後の連続した
黒ランを一つの黒ランとして確定し登録する必要があ
る。そこで、図4に示すように画像データの先頭位置に
ある黒ランの長さ及び画像データの終了位置にある黒ラ
ンの長さをそれぞ表わすためのpre-lenとpost-lenとい
う情報を定義する。ただし画像データが白ランで始まる
ときは pre-len =0、画像データが白ランで終わると
きはpost-len =0とする。
Further, since the image data is processed in 1-byte units, it is necessary to consider the continuous run relationship with the image data of the preceding and succeeding bytes. That is, as shown in FIG. 4, the current image data of interest (data surrounded by a solid line)
Starts with a black run (hatched portion), this black run may be a continuation of the black run of the image data processed immediately before (data surrounded by a broken line). Similarly, if the current image data ends with a black run, it may be continuous with the black run of the image data to be processed next. Regarding such black runs that are continuous with the black runs in the front and back image data, it is necessary to determine and register the continuous black runs before and after as one black run when the continuous range is confirmed. Therefore, as shown in FIG. 4, the pre-len and post-len information for defining the length of the black run at the start position of the image data and the length of the black run at the end position of the image data are defined. To do. However, pre-len = 0 when the image data starts with a white run, and post-len = 0 when the image data ends with a white run.

【0021】第2変換テーブル2は図2に示す構成であ
る。201はタイプ0及びタイプ1のための変換テーブ
ルを記憶したROM、202はタイプ2のための変換テ
ーブルを記憶したROM、203はタイプ3のための変
換テーブルを記憶したROM、204はタイプ4のため
の変換テーブルを記憶したROMである。これら各RO
Mに、第1変換テーブル103からのアドレス情報が入
力する。205は第1変換テーブル103から入力する
タイプ情報をデコードして、ROM201,202,2
03,204に対するイネーブル信号を発生するデコー
ダである。
The second conversion table 2 has the structure shown in FIG. 201 is a ROM that stores conversion tables for type 0 and type 1, 202 is a ROM that stores a conversion table for type 2, 203 is a ROM that stores a conversion table for type 3, and 204 is a type 4 It is a ROM that stores a conversion table for. Each of these RO
The address information from the first conversion table 103 is input to M. 205 decodes the type information input from the first conversion table 103 to read the ROM 201, 202, 2
This is a decoder for generating enable signals for 03 and 204.

【0022】1バイトの画像データのランパターン種類
数は256であるから、第2変換テーブルの総エントリ
ー数は256となり、そのアクセスのためには基本的に
8ビットのアドレス情報が必要とされる。しかし、タイ
プによってROM201,202,203,204を選
択するので同一のアドレスを各ROMに重複させて割り
当て、第1変換テーブル103はタイプ別に画像データ
のランパターンに対応した7ビットのアドレス情報を出
力するようにテーブル内容が作成されている。ただし、
タイプ0とタイプ1は扱いが同じであるため、区別しな
いで0から36の値のアドレス情報を出力する。このよ
うな第1変換テーブルはROMを用いて容易に実現され
る。
Since the number of types of run patterns of 1-byte image data is 256, the total number of entries in the second conversion table is 256, and 8-bit address information is basically required for the access. .. However, since the ROMs 201, 202, 203, and 204 are selected according to the type, the same address is assigned to each ROM in an overlapping manner, and the first conversion table 103 outputs 7-bit address information corresponding to the run pattern of image data for each type. The table contents are created so that However,
Since type 0 and type 1 are handled in the same way, address information of values 0 to 36 is output without making a distinction. Such a first conversion table is easily realized by using the ROM.

【0023】前記(表2)に見られるように、タイプ0
のランパターン数は1、タイプ1のランパターン数は3
6であるが、いずれも確定ランの個数が0でラン抽出処
理上では一緒に扱うことができるため、その変換テーブ
ルはROM201上の一つのテーブルにまとめられ、0
から36のアドレスを割り当てられる。この変換テーブ
ル(201)の各エントリーは、4ビットのpre-lenと
3ビットの post-lenの計7ビットの情報のフィールド
からなる。
As can be seen in Table 2 above, type 0
The number of run patterns is 1 and the number of type 1 run patterns is 3
However, since the number of confirmed runs is 0 and they can be handled together in the run extraction process, the conversion table is grouped into one table on the ROM 201 and is 0.
To 36 addresses are assigned. Each entry of the conversion table (201) is composed of a 4-bit pre-len and a 3-bit post-len, a total of 7-bit information field.

【0024】タイプ2のランパターン数は126である
ので、その変換テーブルのエントリー数は126であ
る。この変換テーブルはROM202に置かれ、0から
125のアドレスを割り当てられる。確定ラン個数は1
であるから、各エントリーはpre-lenとpost-lenのフィ
ールドと run1 の始終点情報6ビットのフィールドから
なる。なお、run 1 の始終点情報はその始点座標と終点
座標であるが、これらは図5に示すように画像データの
先頭からのオフセットとして、それぞれ3ビットで表わ
される。これはrun2, run3 についても同様である。
Since the number of type 2 run patterns is 126, the number of entries in the conversion table is 126. This conversion table is placed in the ROM 202 and is assigned addresses 0 to 125. Fixed run number is 1
Therefore, each entry consists of pre-len and post-len fields and a 6-bit field for start / end information of run1. The start / end point information of run 1 is the start point coordinates and the end point coordinates, which are each represented by 3 bits as an offset from the beginning of the image data as shown in FIG. This also applies to run2 and run3.

【0025】タイプ3のランパターン数は84であるの
で、その変換テーブルはエントリー数が84のテーブル
としてROM203に置かれ、0から83のアドレスを
割り当てられる。確定ラン個数は2であるので、各エン
トリーはrun2 の始終点情報6ビットのフィールドが追
加される。同様に、タイプ4のための変換テーブルはエ
ントリー数が9でROM204に置かれ、0から8のア
ドレスを割り当てられる。各エントリーは、さらにrun3
の始終点情報6ビットのフィールドが追加され最も長
くなっている。
Since the number of type 3 run patterns is 84, the conversion table is placed in the ROM 203 as a table having 84 entries and addresses 0 to 83 are assigned. Since the number of confirmed runs is 2, a 6-bit field for start / end point information of run2 is added to each entry. Similarly, the conversion table for type 4 has nine entries, is placed in ROM 204, and is assigned addresses 0-8. Each entry is run3
A 6-bit field is added to the start / end point information to make it the longest.

【0026】このように確定ランの個数が異なるタイプ
別に第2変換テーブルを分割し、それぞれの各エントリ
ーから不要な確定ランのためのフィールドを削除するこ
とにより、必要なROMのサイズを減らすことができ
る。タイプを区別せず第2変換テーブル104の256
エントリーのフィールド構成を同一にした場合に必要な
ROMサイズに比べ、必要なROMサイズは2682ビ
ット(=(1+36)*6*2 + 126*6*2 + 84*6*1 )だけ少ない
3718ビットとなる。第1変換テーブル103に必要
なROMサイズ2560ビット(=10*256 )を加えた
ROMサイズも6278ビットとなり、第1変換テーブ
ル103と第2変換テーブル104を一つのテーブルと
して実現した場合に必要なROMサイズ7168ビット
(=(3+4+3+((3*2)*3))*256 )よりもROMサイズを減
らすことができる。
As described above, the second conversion table is divided according to the types having different fixed runs, and the field for the unnecessary fixed run is deleted from each entry, thereby reducing the required ROM size. it can. 256 of the second conversion table 104 without distinguishing the type
The ROM size required is 2682 bits (= (1 + 36) * 6 * 2 + 126 * 6 * 2 + 84 * 6 * 1) less than the ROM size required for the same entry field structure. It becomes 3718 bits. The ROM size obtained by adding the required ROM size of 2560 bits (= 10 * 256) to the first conversion table 103 is also 6278 bits, which is required when the first conversion table 103 and the second conversion table 104 are realized as one table. The ROM size can be smaller than the ROM size of 7168 bits (= (3 + 4 + 3 + ((3 * 2) * 3)) * 256).

【0027】このように変換テーブルを第1変換テーブ
ル103と第2変換テーブル104に分け、かつ第2変
換テーブル104に必要なROMサイズの削減を図った
ため、第1変換テーブル103を外付け回路とし、第2
変換テーブル104を他の処理回路とともに同一のLS
Iとして集積化することが容易になる。さらに集積化す
る場合には入出力ピン数の増加を抑えることが極めて重
要であるが、第1変換テーブル103から第2変換テー
ブル104への入力情報ビット数は10ビットと少な
い。第2変換テーブルの分割したテーブルに重複したア
ドレスを割り当てることも、このビット数の1ビット削
減に寄与している。したがって、第1変換テーブル10
3を外付けしても、LSIのピン数の問題を避けられ
る。
Since the conversion table is divided into the first conversion table 103 and the second conversion table 104 and the ROM size required for the second conversion table 104 is reduced in this way, the first conversion table 103 is used as an external circuit. , Second
The conversion table 104 has the same LS as other processing circuits.
It becomes easy to integrate it as I. In the case of further integration, it is extremely important to suppress the increase in the number of input / output pins, but the number of input information bits from the first conversion table 103 to the second conversion table 104 is as small as 10 bits. Assigning duplicate addresses to the divided tables of the second conversion table also contributes to the reduction of this bit number by 1 bit. Therefore, the first conversion table 10
Even if 3 is attached externally, the problem of the number of pins of the LSI can be avoided.

【0028】因みに、第1変換テーブル103と第2変
換テーブル104を同一テーブルとすると、他の処理回
路と同一のLSIとして集積化することがROMサイズ
の面から難しい場合がある。しかし、そうだからといっ
て同テーブルを外付けにすると、同テーブルから他の処
理回路のLSIへ28ビットもの情報を入力しなければ
ならず、LSIの入力ピン数が極めて多くなってしま
い、LSIの大型化やコスト上昇を伴い好ましくない。
これと対比すれば明かなように、本発明によるラン抽出
処理装置は集積化が遥かに容易である。
Incidentally, if the first conversion table 103 and the second conversion table 104 are the same table, it may be difficult in terms of ROM size to integrate them as the same LSI as other processing circuits. However, if the table is externally attached even if this is the case, 28 bits of information must be input from the table to the LSI of another processing circuit, and the number of input pins of the LSI becomes extremely large, which makes the LSI larger. It is not preferable because of cost increase.
As is clear from the comparison, the run extraction processing apparatus according to the present invention is much easier to integrate.

【0029】次にラン抽出処理を順を追って説明する
が、その処理の概略フローは図3に示す通りである。ラ
スタースキャン方向の1ラインについての処理を開始す
る前に、ランレングスカウンタ107と座標保持カウン
タ106をリセットし(処理301)、この後に画像デ
ータ・インターフェイス部102より1バイトの画像デ
ータを取り込む(処理302)。
Next, the run extraction processing will be described step by step. A schematic flow of the processing is as shown in FIG. Before the processing for one line in the raster scan direction is started, the run length counter 107 and the coordinate holding counter 106 are reset (process 301), and then 1-byte image data is fetched from the image data interface unit 102 (process 302).

【0030】この画像データ(現在データと呼ぶ)によ
るテーブル引きが行なわれる(処理303)。すなわ
ち、現在データが入力された第1変換テーブル103よ
り、現在データのタイプ情報と第2変換テーブル105
を引くためのアドレス情報が出力される。第2変換テー
ブル104において、タイプ情報により示されたタイプ
に対応したテーブルのROM201,202,203ま
たは204の一つに対するイネーブル信号がアクティブ
となり、そのROMのみが有効となって、アドレス情報
で指定されたエントリーの情報を出力する。
A table is drawn based on this image data (referred to as current data) (process 303). That is, from the first conversion table 103 to which the current data is input, the type information of the current data and the second conversion table 105
The address information for pulling is output. In the second conversion table 104, the enable signal for one of the ROMs 201, 202, 203, or 204 of the table corresponding to the type indicated by the type information becomes active, and only that ROM becomes effective, and is designated by the address information. The information of the registered entry is output.

【0031】シーケンスコントローラ105は、第2変
換テーブル104より出力されたpre-len の値とランレ
ングスカウンタ107の値との加算を加算器108によ
り行なわせ、結果値をランレングスカウンタ107に保
持させる(処理304)。現在データのタイプが0であ
れば、ランの登録は行なわず直ちに処理309に進み座
標保持カウンタを8だけインクリメントしてから、処理
302に戻り次の画像データの処理を開始する。
The sequence controller 105 causes the adder 108 to add the value of pre-len output from the second conversion table 104 and the value of the run length counter 107, and holds the result value in the run length counter 107. (Process 304). If the type of the current data is 0, the run is not registered, the process immediately proceeds to step 309, the coordinate holding counter is incremented by 8, and then the process returns to step 302 to start the process of the next image data.

【0032】なお、現在データが白ランで始まる場合、
pre-len の値は0であるから加算後もランレングスカウ
ンタ107の値は変わらないが、直前データが黒ランで
終わっているときには、その黒ランの長さ(直前データ
に対するpost-len の値)がランレングスカウンタ10
7の値となっており、これは0以外である。他方、直前
データが白ランで終わっているときは、加算後のランレ
ングスカウンタ値は0である。
If the current data starts with a white run,
Since the value of pre-len is 0, the value of the run length counter 107 does not change even after addition, but when the immediately preceding data ends with a black run, the length of that black run (the value of post-len for the immediately preceding data ) Is the run-length counter 10
The value is 7, which is other than 0. On the other hand, when the immediately preceding data ends with a white run, the run length counter value after addition is 0.

【0033】また、処理304において、現在データの
タイプが0以外であれば、pre-len値のランレングスカ
ウンタ107への加算の後に処理305に進む。
In the process 304, if the type of the current data is other than 0, the pre-len value is added to the run length counter 107, and the process proceeds to the process 305.

【0034】処理305において、シーケンスコントロ
ーラ105は、ランレングスカウンタ107の値が0で
あれば、何もせず、現在データのタイプが1のときは処
理310に進む。
In process 305, the sequence controller 105 does nothing if the value of the run length counter 107 is 0, and proceeds to process 310 when the type of the current data is 1.

【0035】他方、ランレングスカウンタ107の値が
0でない場合、ランレングスカウンタ値をpre-len 値か
ら差し引く減算(補数加算)を加算器108に行なわ
せ、その結果値と座標保持レジスタ106の値との加算
を加算器109に行なわせることによって、一つの黒ラ
ン(これは前データから続いている場合もある)の始点
座標を求め、これをメモリ111に登録(格納)させ、
また座標保持カウンタ106の値とpre-len 値を加算器
109によって加算させることによって同黒ランの終点
座標を求め、これをメモリ111に登録させる。この
際、メモリアドレス管理部110に一つのランの登録を
指示することにより、始終点座標情報の登録アドレスを
適切に制御させる。そして、現在データのタイプが1で
あれば処理310に進み、タイプが2,3または4であ
れば処理306に進む。
On the other hand, when the value of the run length counter 107 is not 0, the adder 108 is made to perform subtraction (complement addition) for subtracting the run length counter value from the pre-len value, and the result value and the value of the coordinate holding register 106. By causing the adder 109 to perform addition with, the start point coordinates of one black run (this may be continued from the previous data) are obtained, and this is registered (stored) in the memory 111,
In addition, the value of the coordinate holding counter 106 and the pre-len value are added by the adder 109 to obtain the end point coordinates of the black run, and this is registered in the memory 111. At this time, by instructing the memory address management unit 110 to register one run, the registered address of the start / end point coordinate information is appropriately controlled. Then, if the type of the current data is 1, the process proceeds to step 310, and if the type is 2, 3 or 4, the process proceeds to step 306.

【0036】処理306において、シーケンスコントロ
ーラ105は、第2変換テーブル104より入力したru
n1 の始点座標値及び終点座標値(いずれも現在データ
の開始位置すなわち座標保持カウンタ106の値に対す
るオフセット)と、座標保持カウンタ106の値との加
算を加算器109で行なわせ、現在データ中の1番目の
確定ランの始点及び終点の座標を求め、これをメモリ1
11に登録する。そして、現在データがタイプ2であれ
ば他に確定ランはないので処理310に進むが、タイプ
が3または4であれば処理306に進む。
In process 306, the sequence controller 105 receives the ru input from the second conversion table 104.
The start point coordinate value and the end point coordinate value of n1 (both are the start position of the current data, that is, an offset with respect to the value of the coordinate holding counter 106) and the value of the coordinate holding counter 106 are added by the adder 109, and The coordinates of the start point and end point of the first fixed run are calculated and stored in memory 1
Register at 11. Then, if the current data is type 2, there is no other definite run, so the process proceeds to step 310, but if the type is 3 or 4, the process proceeds to step 306.

【0037】現在データのタイプが3の場合、処理30
7においてrun2 の始終点座標値と座標保持カウンタ1
06の値の加算を行なって現在データ中の2番目の確定
ランの始終点座標を計算し、これをメモリ111に登録
し、処理310に進む。現在データのタイプが4の場
合、処理307で2番目の確定ランを登録した後に処理
308に進み、run3 の始終点座標値と座標保持カウン
タ106の値との加算により3番目の確定ランの始終点
座標を計算し、これをメモリ111に登録し、この後に
処理310に進む。
If the type of the current data is 3, processing 30
In 7, the start and end coordinate values of run2 and the coordinate holding counter 1
The value of 06 is added to calculate the start and end coordinates of the second confirmed run in the current data, which is registered in the memory 111, and the process proceeds to step 310. When the type of the current data is 4, after registering the second fixed run in process 307, the process proceeds to process 308, and the start and end coordinate values of the third fixed run are added by the start and end coordinate values of run3 and the value of the coordinate holding counter 106. The point coordinates are calculated and registered in the memory 111, after which the process proceeds to step 310.

【0038】処理310において、現在データのpost-l
en の値を加算器108経由でランレングスカウンタ3
10にロードする。そして、処理309に戻り座標保持
カウンタ106のインクリメントを行なってから次の画
像データの処理に以降することになる。
In process 310, post-l of the current data
The value of en is passed through adder 108 to run length counter 3
Load to 10. Then, the process returns to the process 309, the coordinate holding counter 106 is incremented, and the subsequent image data is processed.

【0039】図6に示す画像データを例にしてラン抽出
を説明する。データD1が現在データとなった時は、タ
イプ1であるので処理305に進むが、pre-lenは0で
あるので処理310,309を経由して処理302に戻
る。次のデータD2が現在データとなった時も同様であ
るが、 post-len の値がランレングスカウンタ107に
残る。次のデータD3が現在データとなった時は、処理
305において直前データD2から続いた黒ランR1が
抽出され登録され、また終わりまで続く黒ランの長さす
なわちpost-len の値がランレングスカウンタ107に
残る。次のデータD4が現在データとなった時は、タイ
プ0であるので処理304でpre-len の値がランレング
スカウンタ107の値に加算されるだけである。次のデ
ータD5が現在データとなった時は、処理305でデー
タD3から続いた黒ランR2が登録され、続いて処理3
06で確定ランR3が登録されることになる。
Run extraction will be described using the image data shown in FIG. 6 as an example. When the data D1 becomes the current data, since it is type 1, the process proceeds to step 305, but since pre-len is 0, the process returns to step 302 via steps 310 and 309. The same applies when the next data D2 becomes the current data, but the value of post-len remains in the run length counter 107. When the next data D3 becomes the current data, the black run R1 continued from the immediately preceding data D2 is extracted and registered in the process 305, and the length of the black run continuing to the end, that is, the value of post-len is the run length counter. Remain at 107. When the next data D4 becomes the current data, since it is of type 0, the value of pre-len is simply added to the value of the run length counter 107 in process 304. When the next data D5 becomes the current data, the black run R2 continued from the data D3 is registered in the process 305, and then the process 3
At 06, the confirmed run R3 will be registered.

【0040】ここまでの説明から明かなように、画像デ
ータを白ランの出現個数によってタイプ分けすること
は、変換テーブルのROMサイズ削減などの利益をもた
らすが、さらに処理の効率化及びアルゴリズムの単純化
の面でも利益がある。すなわち、白ランが出現したとい
うことは、そこで黒ランが途切れているということであ
り、ラン登録処理が必要になるということであって、白
ラン出現回数により分類したタイプによって必要なラン
登録処理の回数をほぼ決定できる。これには例外、すな
わち注目している画像データが白ランで始まり、かつ直
前の画像データが白ランで終わっている場合、あるいは
注目している画像データが黒ランで終わっている場合が
ある。このような例外があるとしても、画像データのタ
イプに応じて不要なラン登録処理のスキップ制御を行な
うことにより、様々なランパターンを統一的に扱った効
率的なラン抽出処理を容易に実現できる。
As is apparent from the above description, categorizing the image data according to the number of appearances of white runs brings benefits such as ROM size reduction of the conversion table, but further increases processing efficiency and simplifies the algorithm. There are benefits in terms of conversion. That is, the appearance of the white run means that the black run is interrupted there, and the run registration process is required. The run registration process required by the type classified by the number of appearances of the white run. You can almost determine the number of times. There is an exception to this, that is, the image data of interest starts with a white run and the previous image data ends with a white run, or the image data of interest ends with a black run. Even if there are such exceptions, by performing unnecessary skip control of run registration processing according to the type of image data, it is possible to easily realize efficient run extraction processing that uniformly handles various run patterns. ..

【0041】なお、本実施例におけるように、第2変換
テーブルのタイプ別テーブルに同一アドレスを割り当て
ると第2変換テーブルをLSI化した場合の入出力ピン
を減少できる利点があり好ましいが、それぞれのテーブ
ルに別々のアドレスを割り当てることも許される。
Incidentally, as in the present embodiment, it is preferable to assign the same address to the type-specific table of the second conversion table, because there is an advantage that the number of input / output pins when the second conversion table is made into an LSI can be reduced. It is also permissible to assign different addresses to the table.

【0042】図7は本発明の他の実施例を示すブロック
図である。イメージメモリ401はスキャナ等から取り
込んだ画像データを蓄積するメモリであり、黒画素検索
部402はイメージメモリ401から画像データを読み
出し、各ライン毎に先頭の黒画素を検索し、その黒画素
の先頭位置(x,y)を出力する。ワークメモリ403
は、この黒画素先頭位置と黒画素検索が終了した最後の
ラインのy座標を記憶するメモリであり、ラン抽出部4
04からもアクセスされる。ラン抽出部404は、図1
に示された装置からソース101とメモリ111を除い
た如き構成の回路である(したがって、以下の説明にお
いては、図1中の符号を適宜用いる)。ただし、後述の
ようにシーケンスコントローラ105の制御に僅かに違
いがある。405は抽出されたランデータをバッファリ
ングするためのランデータバッファである。このランデ
ータバッファ405は2ライン分あり、一方が現在処理
中のラインのランデータのバッファリングに用いられる
期間に、他方から前ラインのランデータが出力されると
いうように、交互に切り替えて使用される。なお、この
ランデータバッファ405は図1中のメモリ111に対
応する。
FIG. 7 is a block diagram showing another embodiment of the present invention. The image memory 401 is a memory for accumulating image data taken in from a scanner or the like, and the black pixel search unit 402 reads the image data from the image memory 401, searches for the top black pixel for each line, and reads the top of the black pixels. The position (x, y) is output. Work memory 403
Is a memory for storing the black pixel start position and the y coordinate of the last line for which the black pixel search is completed.
Also accessed from 04. The run extraction unit 404 is shown in FIG.
The circuit shown in FIG. 1 has the configuration in which the source 101 and the memory 111 are removed (therefore, in the following description, the reference numerals in FIG. 1 are used as appropriate). However, there is a slight difference in control of the sequence controller 105 as described later. Reference numeral 405 is a run data buffer for buffering the extracted run data. This run data buffer 405 has two lines, and one of them is used by alternately switching such that the run data of the previous line is output from the other while the run data buffer 405 is used for buffering the run data of the line currently being processed. To be done. The run data buffer 405 corresponds to the memory 111 in FIG.

【0043】次に動作を説明する。黒画素検索部402
は、イメージメモリ401から画像データを読み出し、
各ライン毎に先頭の黒画素の位置を検索し、先頭の黒画
素の先頭位置(x,y)をワークメモリ403に書き込
む。なお、イメージメモリ401のイメージデータは、
X×Y画素の原画像を左から右へ主走査し、上から下へ
副走査した2値データである。また、黒画素先頭位置
(x,y)は、画像の左上を原点とし、右方向へx座標
が増加し、下方向へy座標が増加するような座標を指
す。1ライン(X/8バイト)調べて黒画素が見つから
ない場合は、そのラインについては黒画素先頭位置の書
き込みを行なわない。また、1ラインの処理が済んだ時
に、処理し終えたラインのy座標をワークメモリ403
の固定領域に書き込む。
Next, the operation will be described. Black pixel search unit 402
Reads the image data from the image memory 401,
The position of the head black pixel is searched for each line, and the head position (x, y) of the head black pixel is written in the work memory 403. The image data in the image memory 401 is
This is binary data in which an original image of X × Y pixels is main-scanned from left to right and sub-scanned from top to bottom. Further, the black pixel start position (x, y) indicates coordinates in which the upper left corner of the image is the origin and the x coordinate increases in the right direction and the y coordinate increases in the lower direction. If no black pixel is found by checking one line (X / 8 bytes), the black pixel head position is not written for that line. Also, when the processing of one line is completed, the y coordinate of the processed line is set to the work memory 403.
Write to the fixed area of.

【0044】ラン抽出部404は黒画素検索部402と
同時に動作する。ラン抽出部404のシーケンスコント
ローラ105は、ワークメモリ403の前記固定領域に
書き込まれたy座標を読み、これから処理を開始しよう
としているラインに対する黒画素検索が終了しているか
調べる。黒画素検索が終了している場合、シーケンスコ
ートローラ105は、その現在ラインに対するラン抽出
を開始させる。ただし、ワークメモリ403より現在ラ
インの黒画素先頭位置のx座標を読み込み、この位置を
超えない最大の8の倍数のアドレスから、現在ラインの
画像データの読み込みを開始させる。また、処理開始時
に座標保持カウンタ106に、この最初に読み込むデー
タの先頭位置(x)を初期設定する。すなわち、図3の
処理301において、座標保持カウンタ106をリセッ
トする代わりに、現在ラインの先頭の黒画素が含まれる
1バイトの先頭位置を初期設定する。この後の処理内容
は図3に示される通りである。なお、現在ラインの黒画
素先頭位置がクリアされている場合、つまり黒画素が検
索されなかった場合は、現在ラインは処理せず、次のラ
インに移行する。
The run extracting section 404 operates simultaneously with the black pixel searching section 402. The sequence controller 105 of the run extraction unit 404 reads the y-coordinate written in the fixed area of the work memory 403, and checks whether or not the black pixel search for the line which is about to start processing is completed. When the black pixel search is completed, the sequence coat roller 105 starts the run extraction for the current line. However, the x coordinate of the black pixel start position of the current line is read from the work memory 403, and the reading of the image data of the current line is started from the maximum multiple of 8 addresses that does not exceed this position. Further, at the start of the processing, the head position (x) of the first read data is initialized in the coordinate holding counter 106. That is, in the process 301 of FIG. 3, instead of resetting the coordinate holding counter 106, the head position of 1 byte including the head black pixel of the current line is initialized. The processing contents after this are as shown in FIG. If the black pixel start position of the current line is cleared, that is, if no black pixel is found, the current line is not processed and the next line is entered.

【0045】画像データの大部分は8ビットすべてが白
画素であり、その比率は90%を超えることも少なくな
い。また、ラン抽出部404では、画像データの読み込
み、テーブル引きによるデータ変換、ランレングスカウ
ンタ107とpre-lenの加算、座標保持カウンタ106
のインクリメントの作業を繰り返すが、このような作業
が実際に必要となるのは各ラインの先頭の画素から後の
データであり、各ラインの先頭から処理を開始した場合
は、先頭黒画素より前の区間ではただ座標保持カウンタ
106をインクリメントするだけである。したがって、
本実施例のように、ライン上の先頭黒画素検索処理とラ
ン抽出処理を並列に行ない、ラン抽出処理を先頭の黒画
素が含まれるバイトより開始すれば、各ラインの先頭か
ら処理する場合に比べラン抽出時間が大幅に短縮するこ
とは明らかである。
In most of the image data, all 8 bits are white pixels, and the ratio thereof often exceeds 90%. The run extraction unit 404 also reads image data, performs data conversion by table lookup, adds the run length counter 107 and pre-len, and holds the coordinate holding counter 106.
The work of incrementing is repeated, but such work is actually required for the data after the head pixel of each line, and when the processing is started from the head of each line, it is before the head black pixel. In the section, the coordinate holding counter 106 is simply incremented. Therefore,
As in the present embodiment, if the head black pixel search process on the line and the run extraction process are performed in parallel and the run extraction process is started from the byte including the head black pixel, the process is performed from the head of each line. By comparison, it is clear that the run extraction time is significantly shortened.

【0046】[0046]

【発明の効果】以上、詳細に説明した如く、請求項1な
いし5に記載の本発明によれば、画像データを複数画素
を単位として取り込み、これをテーブル引きを中心とし
た単純な処理によって、また単純な装置構成によって黒
ラン抽出を高速に行なうことができる。また、変換テー
ブルを第1変換テーブルと第2変換テーブルに分け、入
力画像データ中の白ランの個数により分類されたタイプ
別に第2変換テーブルを複数のテーブルに分割し、各分
割テーブルに対応したタイプによって決まる必要な情報
だけを記憶させることによって、さらには第2変換テー
ブルの複数の分割テーブルに重複したアドレスを割り当
てることによって、第2変換テーブルを他の回路手段と
一体的に集積化し、第1変換テーブルを外付け回路とす
ることが容易となる。また請求項6記載の発明によれ
ば、各ラインの先頭から最初の黒画素がある部分まで
は、バイト単位のラン抽出処理を行なわないため、ラン
抽出を一層高速化できる。よって画像データ中の黒ラン
の高速抽出が可能で、その構成も単純で、かつ集積化が
容易なラン抽出装置を実現できるという効果を達成でき
るものである。
As described above in detail, according to the present invention as set forth in claims 1 to 5, image data is fetched in a unit of a plurality of pixels, and this is processed by a simple process centered on table lookup. In addition, black run extraction can be performed at high speed with a simple device configuration. Further, the conversion table is divided into a first conversion table and a second conversion table, and the second conversion table is divided into a plurality of tables according to the types classified according to the number of white runs in the input image data, and each divided table is supported. By storing only the necessary information determined by the type, and by assigning overlapping addresses to the plurality of division tables of the second conversion table, the second conversion table is integrated with other circuit means, It becomes easy to use the 1 conversion table as an external circuit. According to the invention described in claim 6, since the run extraction processing in byte units is not performed from the head of each line to the portion where the first black pixel is present, run extraction can be further speeded up. Therefore, it is possible to achieve the effect that the black run in the image data can be extracted at high speed, the structure thereof is simple, and the run extracting device which is easily integrated can be realized.

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

【図1】本発明によるラン抽出装置の全体的構成を示す
ブロック図である。
FIG. 1 is a block diagram showing an overall configuration of a run extraction device according to the present invention.

【図2】第2変換テーブルの構成を示すブロック図であ
る。
FIG. 2 is a block diagram showing a configuration of a second conversion table.

【図3】ラン抽出処理の概略を示すフロー図である。FIG. 3 is a flowchart showing an outline of run extraction processing.

【図4】入力画像データの開始位置または終了位置にあ
る黒ランの長さ情報の説明図である。
FIG. 4 is an explanatory diagram of length information of a black run at a start position or an end position of input image data.

【図5】入力画像中の確定ランの始終点位置情報の説明
図である。
FIG. 5 is an explanatory diagram of start / end point position information of a confirmed run in an input image.

【図6】黒ラン抽出処理の説明のための画像データ列の
一例の説明図である。
FIG. 6 is an explanatory diagram of an example of an image data string for explaining black run extraction processing.

【図7】本発明の他の実施例の構成を示すブロック図で
ある。
FIG. 7 is a block diagram showing the configuration of another embodiment of the present invention.

【符号の説明】[Explanation of symbols]

101 画像データのソース 102 画像データインターフェイス部 103 第1変換テーブル 104 第2変換テーブル 105 シーケンスコントローラ 106 座標保持カウンタ 107 ランレングスカウンタ 108 加算器 109 加算器 110 メモリアドレス管理部 111 メモリ 401 イメージメモリ 402 黒画素検索部 403 ワークメモリ 404 ラン抽出部 405 ランデータバッファ 101 Source of Image Data 102 Image Data Interface Unit 103 First Conversion Table 104 Second Conversion Table 105 Sequence Controller 106 Coordinate Holding Counter 107 Run Length Counter 108 Adder 109 Adder 110 Memory Address Management Unit 111 Memory 401 Image Memory 402 Black Pixel Search unit 403 Work memory 404 Run extraction unit 405 Run data buffer

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 複数画素を単位として画像データを入力
し、黒ランを抽出しその始点座標及び終点座標を出力す
るラン抽出装置において、入力画像データをそれに含ま
れる白ランの個数に着目して変換する第1変換テーブル
と、該第1変換テーブルによる変換データを黒ランの抽
出のためのデータに変換する第2変換テーブルと、該第
2変換テーブルによる変換データを用いて黒ランの始点
座標及び終点座標を求める回路手段とを有し、該第2変
換テーブルは、1単位の画像データに含まれる白ランの
個数によって分類されたタイプ別に複数のテーブルに分
割され、該分割テーブルは対応タイプによって決まる必
要な情報のみを記憶する構成とされることを特徴とする
ラン抽出装置。
1. A run extracting apparatus for inputting image data in units of a plurality of pixels, extracting a black run, and outputting the start point coordinates and the end point coordinates thereof, paying attention to the number of white runs included in the input image data. A first conversion table for conversion, a second conversion table for converting the conversion data by the first conversion table into data for extracting a black run, and a start point coordinate of the black run by using the conversion data by the second conversion table And a circuit means for obtaining end point coordinates, and the second conversion table is divided into a plurality of tables according to types classified by the number of white runs included in one unit of image data. A run extraction device characterized by being configured to store only necessary information determined by
【請求項2】 前記第1変換テーブルによる変換データ
は、入力画像データをそれに含まれる白ランの個数によ
り分類したタイプの情報と該入力画像データのパターン
に対応したアドレス情報とを含み、該第2変換テーブル
による変換データは、該入力画像データの開始位置にあ
る黒ラン及び終了位置にある黒ランのそれぞれの長さの
情報、該入力画像データ中の前後を白ランで挟まれた黒
ランの始点及び終点の位置の情報を含むことを特徴とす
る請求項1記載のラン抽出装置。
2. The conversion data according to the first conversion table includes information of a type in which input image data is classified according to the number of white runs included therein, and address information corresponding to a pattern of the input image data. The conversion data by the 2 conversion table includes information on the lengths of the black run at the start position and the black run at the end position of the input image data, and the black run in which the front and rear of the input image data are sandwiched by white runs. The run extraction device according to claim 1, further comprising information on the positions of the start point and the end point of the run.
【請求項3】 前記第2変換テーブルは、前記第1変換
テーブルの変換データ中のタイプ情報に従って前記複数
の分割テーブルを選択的に作動させるデコーダを含み、
該複数の分割テーブルは重複したアドレスを割り当てら
れることを特徴とする請求項2記載のラン抽出装置。
3. The second conversion table includes a decoder which selectively operates the plurality of division tables according to type information in the conversion data of the first conversion table,
The run extracting apparatus according to claim 2, wherein the plurality of division tables are assigned with overlapping addresses.
【請求項4】 前記第1変換テーブルの変換データ中の
黒ランの始点位置及び終点位置の情報は入力画像データ
の開始位置座標を基準としたオフセットであり、前記回
路手段は、黒ランの長さ情報を保持するためのランレン
グスカウンタ、入力画像データの開始位置座標を保持す
るための座標保持カウンタ、及び演算回路を含み、該各
カウンタの値及び該第2変換テーブルの変換データを用
いた演算を該演算回路により行なうことによって黒ラン
の始点及び終点の座標を求めることを特徴とする請求項
2記載のラン抽出装置。
4. The information of the starting point position and the ending point position of the black run in the conversion data of the first conversion table is an offset based on the start position coordinates of the input image data, and the circuit means sets the length of the black run. Including a run-length counter for holding information on the size of the input image, a coordinate holding counter for holding the starting position coordinates of the input image data, and an arithmetic circuit. The values of the respective counters and the conversion data of the second conversion table are used. 3. The run extracting apparatus according to claim 2, wherein the coordinates of the start point and the end point of the black run are obtained by performing the calculation by the calculation circuit.
【請求項5】 前記回路手段は、入力画像データのタイ
プに無関係に該入力画像データの開始位置にある黒ラン
の長さの情報を前記ランレングスカウンタの値に加算す
る第1の処理を行ない、該入力画像データが白ランを含
まないタイプのときは該第1処理の後に該入力画像デー
タに対する処理を終了し、該入力画像データが1個以上
の白ランを含むタイプのときは該ランレングスカウンタ
の値が0以外であれば、一つの黒ランの始点及び終点の
座標を求めて出力する第2の処理を行ない、該入力画像
データが白ランを1個のみ含むタイプのときは該第2処
理の後に該入力画像データの終了位置にある黒ランの長
さの情報を該ランレングスカウンタに設定する第3の処
理段階を行ない該入力画像データに対する処理を終了
し、該入力画像データが2個以上の白ランを含むタイプ
のときは、該入力画像中の前後を白ランで挟まれた黒ラ
ンの始点及び終点の座標を求める第4の処理を該入力画
像データのタイプによって決まる回数返した後、該第3
処理を行なって該入力画像データに対する処理を終了す
ることを特徴とする請求項4記載のラン抽出装置。
5. The circuit means performs a first process of adding information on the length of a black run at the start position of the input image data to the value of the run length counter regardless of the type of the input image data. When the input image data is of a type that does not include white runs, the process for the input image data is terminated after the first process, and when the input image data is of a type that includes one or more white runs, If the value of the length counter is other than 0, the second processing of obtaining and outputting the coordinates of the start point and the end point of one black run is performed. When the input image data is of a type including only one white run, After the second processing, the third processing step of setting the information of the length of the black run at the end position of the input image data in the run length counter is performed, and the processing for the input image data is finished, Is a type including two or more white runs, a fourth process for obtaining the coordinates of the start point and the end point of the black run in which the front and back of the input image are sandwiched by white runs is determined by the type of the input image data. After returning the number of times, the third
The run extracting apparatus according to claim 4, wherein the process is performed and the process for the input image data is ended.
【請求項6】 画像データを記憶するイメージメモリ
と、該イメージメモリより各ラインの画像データを読み
出し最初の黒画素の位置を検出する黒画素検索部と、該
黒画素検索部により検索された位置を記憶するワークメ
モリと、請求項1ないし5のいずれか1項に記載された
構成のラン抽出部とを有し、該ラン抽出部は、処理しよ
うとする現在ラインのラン抽出処理を、該ワークメモリ
に記憶されている該現在ラインに対する位置を含む画像
データより開始することを特徴とするラン抽出装置。
6. An image memory for storing image data, a black pixel search unit for detecting the first black pixel position by reading the image data of each line from the image memory, and a position searched by the black pixel search unit. And a run extraction unit having the configuration according to any one of claims 1 to 5, wherein the run extraction unit performs the run extraction process of the current line to be processed by the run extraction unit. A run extraction apparatus starting from image data including a position with respect to the current line stored in a work memory.
JP3290789A 1991-04-09 1991-10-09 Device for extracting run Pending JPH0594533A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3290789A JPH0594533A (en) 1991-04-09 1991-10-09 Device for extracting run

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP3-103777 1991-04-09
JP10377791 1991-04-09
JP3290789A JPH0594533A (en) 1991-04-09 1991-10-09 Device for extracting run

Publications (1)

Publication Number Publication Date
JPH0594533A true JPH0594533A (en) 1993-04-16

Family

ID=26444371

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3290789A Pending JPH0594533A (en) 1991-04-09 1991-10-09 Device for extracting run

Country Status (1)

Country Link
JP (1) JPH0594533A (en)

Similar Documents

Publication Publication Date Title
JPS5937773A (en) Run-length code decoding device
JPH02244281A (en) Image data registration search method
JPH0594533A (en) Device for extracting run
JP2730399B2 (en) Image data reduction device
JP3073208B2 (en) Data selection device
JP2643091B2 (en) Method and system for managing character recognition of a plurality of document form images having a common data type
JPS58189689A (en) Image display system
JP3325326B2 (en) Electronic filing equipment
JPS6261427A (en) Encoding method
JPS6362083A (en) Projection data generation method
JPH056428A (en) Image processing labeling circuit
JP2005301665A (en) Data processor and data processing method
JPH08139939A (en) Compander
JPH0492993A (en) Character recognizing device
JPH06348794A (en) Registration/retrieval system for vector data
JPH05307598A (en) Image processing device
JPH04213170A (en) Ramp pattern extraction device
JPS61125293A (en) Mosaic coding device
JPH02224077A (en) Collecting device for histogram data of original picture
JP2003116010A (en) Image storage method and image storage device
JPH03217994A (en) Document processor
JPH0239195A (en) Multilevel image display method
JPH0962845A (en) Labeling method for picture data
JPH05151280A (en) Filing device
JPH03148779A (en) Picture processing system