JPH0556062B2 - - Google Patents

Info

Publication number
JPH0556062B2
JPH0556062B2 JP59262889A JP26288984A JPH0556062B2 JP H0556062 B2 JPH0556062 B2 JP H0556062B2 JP 59262889 A JP59262889 A JP 59262889A JP 26288984 A JP26288984 A JP 26288984A JP H0556062 B2 JPH0556062 B2 JP H0556062B2
Authority
JP
Japan
Prior art keywords
processing
image
pixel
line
input
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
JP59262889A
Other languages
Japanese (ja)
Other versions
JPS61141262A (en
Inventor
Yoshitaka Ogino
Hiroshi Tanioka
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 JP59262889A priority Critical patent/JPS61141262A/en
Publication of JPS61141262A publication Critical patent/JPS61141262A/en
Publication of JPH0556062B2 publication Critical patent/JPH0556062B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】 [技術分野] 本発明は、複写機、フアクシミリ等に用いるこ
との可能な画像処理装置に関し、特に、画素を複
数の領域に分割し、各々の領域を複数の画像処理
手段を用いて並列処理する画像処理装置に関す
る。
Detailed Description of the Invention [Technical Field] The present invention relates to an image processing device that can be used in copying machines, facsimile machines, etc., and in particular, it divides pixels into a plurality of regions, and each region is subjected to a plurality of image processing processes. The present invention relates to an image processing apparatus that performs parallel processing using means.

[従来技術] 従来、この種の装置ではCCD等によつて画像
をラスタスキヤンして読み取り、例えば、2値化
処理や階調処理等の画像処理が施されていた。と
ころが最近、この種の処理に画像の画調をリアル
タイムで認識し、画調に適した処理を選択切り換
えて、像再生することが提案されつつある。
[Prior Art] Conventionally, in this type of apparatus, images are raster-scanned and read using a CCD or the like, and image processing such as binarization processing and gradation processing is performed. Recently, however, it has been proposed that this type of processing involves recognizing the tone of an image in real time, selecting and switching a process suitable for the tone, and reproducing the image.

しかしながら、従来のデイジタル複写機におい
ては原稿の種類に応じて処理選択キーを用いて、
原稿が写真の様に中間調で表現されている場合は
デイザ処理を行い、原稿が文字原稿であれば一定
の閾値によるスライス2値化処理を行う等、原稿
全域に対して同一の処理しか行なわれていなかつ
た。
However, in conventional digital copying machines, processing selection keys are used depending on the type of document.
If the original is expressed in halftones like a photograph, dither processing is performed, and if the original is text, slice binarization processing is performed using a certain threshold. Only the same processing is performed on the entire original. It wasn't.

一方、文字、写真混在原稿に対して領域毎に画
調を識別すれば、同一原稿中においても処理を切
り換える事により原稿に忠実な像再生が可能とな
る。しかしながら、この種の処理方式については
すでに数多くの手法が提案されているにも拘わら
ず、いずれも注目画素を中心として画像の2次元
的情報に基づくものである。上記画調認識を行な
う為には、ラスタースキヤンして得られた画像情
報を少なくとも2ライン以上にわたつて記憶する
手段が必要不可欠であるので回路規模も膨大とな
り、従つて装置の小型化が望まれていた。
On the other hand, if the image tone is identified for each region in a document containing text and photographs, it is possible to reproduce an image faithful to the document by switching the processing even within the same document. However, although many methods have already been proposed for this type of processing method, all of them are based on two-dimensional information of the image centered on the pixel of interest. In order to perform the above-mentioned image tone recognition, it is essential to have a means to store the image information obtained by raster scanning over at least two lines, which requires a huge circuit size, and therefore it is desirable to miniaturize the device. It was rare.

また、処理アルゴリズムも精度良く識別するに
は複雑となり、従つてハードウエアで構成する場
合に回路規模あるいは処理速度を考慮すると、未
だ汎用複写機に適用出来る程実用レベルに至つて
いるとはいえない。
In addition, the processing algorithm is complicated to accurately identify it, and therefore, when considering the circuit size or processing speed when configured with hardware, it cannot be said that it has reached a practical level that can be applied to general-purpose copying machines. .

[目的] 本発明は上述の点に鑑みてなされたもので、そ
の目的は、注目画素の画像データを、周辺の画素
の画像データを用いて処理する際に、高速にかつ
画質の劣化を抑えて精度良く処理することの可能
な画像処理装置を提供することにある。
[Purpose] The present invention has been made in view of the above points, and its purpose is to process image data of a pixel of interest using image data of surrounding pixels at high speed and to suppress deterioration of image quality. An object of the present invention is to provide an image processing device that can process images with high accuracy.

かかる目的を達成するために、本発明の画像処
理装置は、画素毎の画像データを入力する入力手
段(実施例では、第1図のセンサセルに該当す
る)と、 前記入力手段により入力された画像データのう
ち、第1の領域に含まれる画素位置の画像データ
を処理する第1の処理手段(同じく、第1図の
SH0,CPU1)と、 前記入力手段により入力された画像データのう
ち、前記第1の領域に隣接する第2の領域に含ま
れる画素位置の画像データを処理する第2の処理
手段(同じく、第1図のSH3,CPU2)と、 前記第1及び第2の処理手段により処置された
画像データを出力する出力手段(同じく、第1図
のSR1,SR2)とを有した画像処理装置であつ
て、 前記第1及び第2の処理手段は、各々第1の領
域、第2の領域に含まれる注目画素の画像データ
を処理する際に、該注目画素の周辺の画像データ
を用いて並列に画像データの処理を行ない、 更に、前記第1の処理手段は、少なくとも前記
第1の領域と前記第2の領域との境界に位置する
注目画素の画像データを処理する際には、前記第
2の処理手段を介して入力されたデータ(第1図
のSH3とCPU1を接続するライン、若しくは、
第8図に示されるB0〜B7を介して、CPU間
を転送されるデータ)を用いることを特徴とす
る。
In order to achieve such an object, the image processing device of the present invention includes an input means for inputting image data for each pixel (corresponding to the sensor cell in FIG. 1 in the embodiment), and an image processing apparatus for inputting image data input by the input means. A first processing means for processing image data at pixel positions included in the first region (also shown in FIG.
SH0, CPU1), and a second processing means (also a second processing means) for processing image data at pixel positions included in a second region adjacent to the first region among the image data input by the input means. SH3, CPU2 in FIG. 1); and output means (SR1, SR2 in FIG. 1) for outputting image data processed by the first and second processing means. When processing the image data of the pixel of interest included in the first region and the second region, respectively, the first and second processing means process the image in parallel using image data around the pixel of interest. Further, when processing image data of a pixel of interest located at least at the boundary between the first region and the second region, the first processing means Data input via processing means (line connecting SH3 and CPU1 in Figure 1, or
It is characterized by using data transferred between CPUs via B0 to B7 shown in FIG.

[実施例] まず、本実施例の特徴とするところは、 複数の1チツプの画像処理専用マイクロコン
ピユータ(以下CPUという)を用いて並列画
像処理を行う。
[Embodiment] First, the feature of this embodiment is that parallel image processing is performed using a plurality of one-chip image processing-dedicated microcomputers (hereinafter referred to as CPUs).

等倍型ラインセンサセルの出力を複数のブロ
ツクに分割し、該ブロツク毎のセル出力を前記
CPUのA/D変換入力ポートに並列入力する
ように各CPUの分担を割り付ける。
The output of the same-magnification line sensor cell is divided into multiple blocks, and the cell output of each block is calculated as described above.
Allocate each CPU's share so that parallel input is made to the A/D conversion input port of the CPU.

隣接CPU間に生じる処理の不整合を除去す
る為に、境界セル情報を両隣りのCPUにオー
バラツプさせて取り込み画像処理する。
In order to eliminate processing inconsistencies that occur between adjacent CPUs, boundary cell information is imported and image processed in an overlapping manner by both adjacent CPUs.

等倍型ラインセンサと処理CPUを同一基板
上に配置する。
The same-size line sensor and processing CPU are placed on the same board.

等である。etc.

以下、図面に従つて本発明の好適な実施例につ
いて詳説する。
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.

第1図は本発明の画像処理装置の1実施例のブ
ロツク図である。各ブロツクの構成要素はセンサ
ーセル、サンプルホールド回路、前述のCPU及
びシフトレジスタSR等である。各構成要素につ
いて説明する。
FIG. 1 is a block diagram of one embodiment of the image processing apparatus of the present invention. The components of each block are a sensor cell, a sample and hold circuit, the aforementioned CPU and shift register SR, etc. Each component will be explained.

図中E1,E2…E41…は線状に配列された
センサーセル群である。本実施例においてはセン
サーセルはアモーフアスシリコンからなる薄膜型
であり光量に応じてその抵抗値が変化する特性を
もつ、遮光マスクを施した領域を各々セル領域と
直列に接続し両端に電源を接続することにより両
領域の接続点での電位変化を検出すればセル領域
の受光量を知ることが出来る。センサの構成につ
いては、光量に応じて起電力を発生する型を用い
ても同様に実現出来る。
In the figure, E1, E2...E41... are sensor cell groups arranged linearly. In this example, the sensor cell is a thin film type made of amorphous silicon, and its resistance value changes depending on the amount of light.A region covered with a light-shielding mask is connected in series with the cell region, and a power source is connected to both ends. The amount of light received by the cell region can be determined by detecting the potential change at the connection point between both regions. The configuration of the sensor can be similarly realized using a type that generates an electromotive force depending on the amount of light.

この種のセンサーは、出力インピーダンスが高
くなる事あるいは応答性の点から、それらの出力
はSH0,SH3…なるサンプルホールド回路(原
理的には必要ではないが)を介してCPU1,
CPU2,CPU3…のA/D入力ポートに1対1
で接続する事が出来る。従来の等倍型センサにお
いては長距離に渡つてアナログ信号をシリアル転
送する為にセル自体の応答性は高速であるにも拘
わらず高速な読み取りは不可能であつたが、本実
施例の例えば等倍型CCDセンサのフオトダイオ
ード部分のみを用いる事によりシリアル転送に要
する時間が不要となり高速読み取りが可能とな
る。
Due to the high output impedance or responsiveness of this type of sensor, the outputs are sent to the CPU1, SH0, SH3, etc. via sample and hold circuits (although not necessary in principle).
One to one for A/D input ports of CPU2, CPU3...
You can connect with In conventional single-magnification sensors, analog signals are serially transferred over long distances, making it impossible to read at high speed even though the response of the cell itself is fast. By using only the photodiode part of a 1x CCD sensor, the time required for serial transfer is unnecessary, allowing high-speed reading.

原稿を蛍光灯あるいはLED等の線状光源で照
射し、セルフオツク等の1対1結像光学系でセン
サー列に像を結像し、センサと原稿をセル配列方
向と垂直に相対移動させる公知の走査手段により
副走査させる。該走査手段から出力される所定周
期の信号(例えば、本実施例では400usecの周期
で入力する第1図のLA信号)でサンプルホール
ドする事によつて、分割された画像情報を1ライ
ンづつ同時にCPUに読み取ることが出来る。又、
各サンプルホールド回路(SH)、CPU及びシフ
トレジスタ(SR)は同一タイプを使用出来るの
で同一基板上に多数配置が可能となり装置の小型
化に寄与する。更に、センサセルからA/D変換
までの距離が最短となる為に、S/N比の良好な
高信頼性の画像読み取りが可能となる。
A well-known method in which the original is illuminated with a linear light source such as a fluorescent lamp or LED, an image is formed on a sensor array using a one-to-one imaging optical system such as a self-occurrence sensor, and the sensor and the original are moved relative to each other perpendicular to the cell arrangement direction. The scanning means performs sub-scanning. By sample-holding a signal with a predetermined period output from the scanning means (for example, in this embodiment, the LA signal shown in FIG. 1 which is input with a period of 400 usec), the divided image information is simultaneously read one line at a time. Can be read by the CPU. or,
Since the same type can be used for each sample hold circuit (SH), CPU, and shift register (SR), many can be placed on the same board, contributing to the miniaturization of the device. Furthermore, since the distance from the sensor cell to the A/D conversion is the shortest, highly reliable image reading with a good S/N ratio is possible.

尚、1入力サイクル(400USEC)間に各CPU
が行う画調認識/画像処理は後述する様に8画素
のみであり、画像処理の為に1つのCPUにかか
る負担は少ないので時間的にもかなり複雑な処理
(後述)まで可能となり、更にCPUをマイクロコ
ンピユータ化してマイクロコードを実行してもリ
アルタイムの画像処理が可能となる。
In addition, each CPU during one input cycle (400 USEC)
The image tone recognition/image processing that is performed by is performed on only 8 pixels as described later, and the load placed on one CPU for image processing is small, so it is possible to perform quite complex processing in terms of time (described later). Real-time image processing is also possible by converting the image into a microcomputer and executing microcode.

本実施例の画像処理装置においては、上記サイ
クル間に画調の識別を行い2値化処理を行う。2
値化された画像信号は各CPUの出力ポート01
〜08(第1,2図)から出力され、夫々コンカ
チネート結合されたシフトレジスタSR1,SR2
…(第1図)によりパラレルにラツチされ、順次
高速のクロツクCLKによりシリアルの2値化信
号としてプリンタ等に出力される。
In the image processing apparatus of this embodiment, the image tone is identified during the above-mentioned cycle and the binarization process is performed. 2
The converted image signal is sent to output port 01 of each CPU.
Shift registers SR1 and SR2 output from ~08 (Figures 1 and 2) and concatenated, respectively.
...(FIG. 1), the signals are latched in parallel, and sequentially output as a serial binary signal to a printer or the like using the high-speed clock CLK.

ところで、第1図においては1ライン分の情報
をそれぞれ8画素単位で分割しその1単位を各
CPUに分担割り付けを行つているので、画像信
号の連続した2次元処理を行うと、以下に述べる
ような隣接するCPU間による画像処理の不整合
が発生する可能性がある。
By the way, in Figure 1, the information for one line is divided into 8 pixel units, and each unit is divided into 8 pixel units.
Since the tasks are allocated to the CPUs, if continuous two-dimensional processing of image signals is performed, there is a possibility that inconsistencies in image processing between adjacent CPUs will occur as described below.

即ち、CPU1が担当するセルE8のセル情報
に着目し前述した二次元処理のうち例として3×
3画素で構成されるマスクを用いて注目画素をた
たみ込む処理(例えば、3×3のエツジ強調等)
を例にとつてみると、CPU1はセルE8のセル
情報を上記処理する為には、更にE7,E9等の
各セル情報が必要である。特にCPU2が担当す
るセルE9のセル情報が必要となつてくる。同様
に、セルE9を注目画素とするCPU2の該処理
時にはセルE8の情報が必要となつて来る。
That is, focusing on the cell information of the cell E8 that the CPU 1 is in charge of, as an example of the two-dimensional processing described above, 3×
Processing that convolves the pixel of interest using a mask composed of 3 pixels (for example, 3×3 edge enhancement, etc.)
For example, in order to process the cell information of cell E8 as described above, the CPU 1 also needs each cell information of E7, E9, etc. In particular, cell information about the cell E9, which the CPU 2 is in charge of, becomes necessary. Similarly, when the CPU 2 processes the cell E9 as the pixel of interest, information on the cell E8 becomes necessary.

そこで、本実施例においては、画素割付けを次
のようにして各CPUが入力する画素を決定する。
画調認識又は画像処理に適用するマスクの大きさ
が(2n+1)×(2n+1)ならば各CPUは隣接す
る2つのCPUの担当するセル情報のうちn個の
セル情報を更に入力する様にする。又、1ライン
のセル情報を何個のブロツクに分割するかについ
ては1ラインを何個のCPUによつて担当させる
かによつて決まる。そこで、第1図、第2図に示
した本実施例のCPUでは、画調認識する為のマ
スク(マトリクス)の大きさが9×9である事、
又CPUの入力能力が一例として16画素である事
の為に、センサセルの出力を8画素づつ分割しこ
の8画素セル情報を各CPUに担当させ、更にそ
のうちの最初の4画素セル情報と最後の4画素セ
ル情報を隣接する2つのCPUにも夫々入力する
様にする。当該CPUにも隣接する2CPUから4画
素セル情報づつ入力するのは勿論である。
Therefore, in this embodiment, pixels to be input by each CPU are determined by pixel allocation as follows.
If the size of the mask applied to image tone recognition or image processing is (2n+1) x (2n+1), each CPU will further input n pieces of cell information from among the cell information handled by two adjacent CPUs. . Furthermore, the number of blocks into which one line of cell information is divided is determined by how many CPUs are assigned to one line. Therefore, in the CPU of this embodiment shown in Figs. 1 and 2, the size of the mask (matrix) for image tone recognition is 9 x 9.
Also, since the input capacity of the CPU is 16 pixels, for example, the output of the sensor cell is divided into 8 pixels each, and each CPU is responsible for the 8-pixel cell information, and the first 4 pixel cell information and the last The 4-pixel cell information is also input to two adjacent CPUs, respectively. Of course, 4-pixel cell information is also input to the CPU from two adjacent CPUs.

各CPUの画像処理の画素数を例えば32画素と
して、9×9の2次元の画像処理まで可能とする
為には40画素入力可能とするCPUが最も実用的
であり、CPU数を減少させるのに役立つと思わ
れるが、以降の説明では16画素入力のCPUにつ
いて説明する。
For example, if the number of pixels for image processing on each CPU is 32 pixels, in order to be able to process up to 9 x 9 two-dimensional image processing, a CPU that can input 40 pixels is the most practical, and it is recommended to reduce the number of CPUs. However, in the following explanation, we will explain a CPU with 16 pixel input.

各CPUには、第2図に示される如くそのCPU
の処理担当画素と重複して隣接CPUから4画素
づつさらに入力している。例えば、CPU2の左
端画素E9のためにE8,E7,E6,E5から
の画素情報を入力し、同様に右端画素E16用に
E17,E18,E19,E20を入力する。即
ち、CPU2にはE9〜E16を処理する為にE
5〜E20を入力することとなる。
Each CPU has its own CPU as shown in Figure 2.
4 pixels are further input from the adjacent CPU, overlapping with the pixels in charge of processing. For example, pixel information from E8, E7, E6, and E5 is input for the left-most pixel E9 of the CPU 2, and similarly, E17, E18, E19, and E20 are input for the right-most pixel E16. In other words, CPU2 has E to process E9 to E16.
5 to E20 will be input.

上記構成によつて、原理的に注目画素を囲む9
×9画素情報をもとにした二次元画像処理が可能
となり、更に隣接する二つのCPU間の近傍に位
置する画素に対しても連続性が失われることなく
高精度の処理が可能となる。
With the above configuration, in principle, the pixel of interest is surrounded by 9
Two-dimensional image processing based on ×9 pixel information becomes possible, and high-precision processing is also possible for pixels located in the vicinity between two adjacent CPUs without losing continuity.

しかしプリント基板に多数のCPUが実装され
る時はその配線方法が実装密度に大きく影響す
る。そこで、次に上述したセンサーセルとCPU
チツプとの接続結線について説明する。
However, when a large number of CPUs are mounted on a printed circuit board, the wiring method greatly affects the mounting density. Therefore, next is the sensor cell and CPU described above.
The connection with the chip will be explained.

第1図に示す結線例はセル配列密度とCPU入
力ポート端子密度が等しい場合の例であり、上述
したように重複して各セルと結線する場合
(CPU入力ポート端子密度がパターン密度より高
い場合)はチツプキヤリア等を用いて、各隣接す
るCPUチツプの向かい合う側面に入力端子を配
置し、隣接する両チツプの向かい合う端子が“ち
どり”配列する様にパターンを形成することによ
つて三面による高密度実装で結線が構成される。
尚、セル配列密度に比べてCPU入力ポート端子
密度が低い場合には説明するまでもなく、チツプ
の1面のみでの接続が可能である。
The connection example shown in Figure 1 is an example when the cell arrangement density and CPU input port terminal density are equal, and when each cell is connected redundantly as described above (when the CPU input port terminal density is higher than the pattern density) ) uses a chip carrier, etc. to arrange input terminals on opposite sides of each adjacent CPU chip, and forms a pattern in which the opposite terminals of both adjacent chips are arranged in a "staggered" pattern, thereby achieving high density on three sides. Wiring is configured by mounting.
It should be noted that if the CPU input port terminal density is lower than the cell arrangement density, it goes without saying that connection can be made on only one side of the chip.

他の接続方法としては、第6図a〜dに示され
た結線方法がある。但し第6図aは第1図の結線
方法と同じである。第6図a〜dはサンプルホー
ルド回路SHからCPUへの入力配線に注目したも
のである。即ち、第6図a及びdはQIP(Quad
Inline Package)タイプのICパツケージ又はチ
ツプキヤリアを用いた時の配線図である。図中、
ICパツケージと配線との交点のドツトは入力端
子でそこからICチツプ内に入力されている事を
示す。又、点線はプリント配線基板上の配線が
ICパツケージ等によつて隠れている事を示す。
例えば、セラミツク厚膜のマルチチツプ基板にて
多数のCPUを第6図a〜dの如く実装すると配
線が交叉する事も無く高密度実装が可能となる。
Other connection methods include the wiring methods shown in FIGS. 6a-d. However, the connection method in FIG. 6a is the same as that in FIG. 1. Figures 6a to 6d focus on the input wiring from the sample and hold circuit SH to the CPU. That is, Figure 6 a and d are QIP (Quad
This is a wiring diagram when using an IC package (Inline Package) type or chip carrier. In the figure,
The dot at the intersection of the IC package and the wiring is an input terminal, indicating that input is being input into the IC chip from there. Also, the dotted lines indicate the wiring on the printed wiring board.
Indicates that it is hidden by an IC package etc.
For example, if a large number of CPUs are mounted on a ceramic thick film multi-chip substrate as shown in FIGS. 6a to 6d, high-density mounting is possible without wiring crossing.

次に、CPUについて説明する。第2図は画像
処理装置の1チツプのマイクロコンピユータ(以
下CPUという)の内部構成を示すブロツク図で
ある。まず、点線で囲まれた部分がCPUであり、
8ビツトマイクロプロセサに16チヤンネルの逐次
比較型のA/Dコンバータを内蔵したものであ
る。この16本のアナログ入力(An1〜An16)
はチツプ内で2つのマルチプレクサによりマルチ
プレクスされ、A/Dチヤンネルモードレジスタ
の設定に従つて1つの入力が選択され、該選択さ
れたアナログ入力は下記構成からなる2つのA/
Dコンバータによつてデジタル化される。
Next, the CPU will be explained. FIG. 2 is a block diagram showing the internal configuration of a one-chip microcomputer (hereinafter referred to as CPU) of the image processing device. First, the part surrounded by the dotted line is the CPU,
It has a 16-channel successive approximation type A/D converter built into an 8-bit microprocessor. These 16 analog inputs (An1 to An16)
is multiplexed by two multiplexers within the chip, one input is selected according to the setting of the A/D channel mode register, and the selected analog input is multiplexed by two A/D multiplexers with the following configuration.
It is digitized by a D converter.

各A/Dコンバータの構成はサンプルホールド
回路(SH4又はSH5)、電圧コンパレータ3
(又は4)、タツプデコーダ3(又は4)及び
SAR3(又は4)から構成される。SAR
(Successive Approximation Register)3(又
は4)はタツプデコーダ3(又は4)及びタイミ
ングを生成するコントロール3(又は4)と共に
D/Aコンバータを構成する。
The configuration of each A/D converter is a sample hold circuit (SH4 or SH5), voltage comparator 3
(or 4), tap decoder 3 (or 4) and
Consists of SAR3 (or 4). SAR
(Successive Approximation Register) 3 (or 4) constitutes a D/A converter together with a tap decoder 3 (or 4) and a control 3 (or 4) that generates timing.

電圧コンパレータ3(又は4)は前記サンプル
ホールドされたアナログ入力とタツプデコーダ3
(又は4)内の直列抵抗ストリングの各電圧タツ
プとの差を比較する。この直列抵抗ストリング
は、外部のA/D用基準電圧(Vref)を受ける
端子(不図示)とA/D用のグランド端子間(不
図示)とに接続され、2端子間電圧を256の等価
が電圧ステツプにするための256個の等価な抵抗
で構成されている。
Voltage comparator 3 (or 4) connects the sampled and held analog input to tap decoder 3.
(or 4) Compare the difference with each voltage tap of the series resistor string. This series resistor string is connected between a terminal (not shown) that receives an external A/D reference voltage (Vref) and an A/D ground terminal (not shown), and converts the voltage between the two terminals into 256 equivalent consists of 256 equivalent resistors for voltage steps.

直列抵抗ストリングの電圧タツプは8ビツトの
シフトレジスタSAR3(又は4)によつて選択
ドライブされる。SAR3(又は4)は直列抵抗
ストリングの電圧タツプの出力がアナログ入力と
一致するまで(コンパレータの出力が反転するま
で)SAR3(又は4)の最上位ビツト(MSB)
から1ビツトづつ設定する。
The voltage taps of the series resistor strings are selectively driven by an 8-bit shift register SAR3 (or 4). SAR3 (or 4) is the most significant bit (MSB) of SAR3 (or 4) until the output of the voltage tap of the series resistor string matches the analog input (until the output of the comparator is inverted).
Set one bit at a time.

すなわち、A/D変換スタートとともにSAR
3(又は4)のMSBをセツトし、直列抵抗スト
リングの電圧タツプの1/2Vrefを選択してアナロ
グ入力と比較する。もしアナログ入力が1/2Vref
より大きければ、SAR3(又は4)のMSBをセ
ツトしたままにし、又もし1/2Vrefより小さけれ
ばMSBをリセツトする。次にMSBの次の下位ビ
ツトをセツトし直列抵抗ストリングの電圧タツプ
を3/4Vrefあるいは1/4Vrefにして、アナログ入
力と比較を行なう。このようにして順次上位ビツ
トから最下位ビツトに至るまでのそれぞれのビツ
トを変更しながらSAR3(又は4)によつて選
択された電圧値と比較決定する。
In other words, when A/D conversion starts, SAR
Set the 3 (or 4) MSB and select 1/2Vref of the series resistor string voltage tap to compare with the analog input. If the analog input is 1/2Vref
If it is greater, leave the MSB of SAR 3 (or 4) set, and if it is less than 1/2Vref, reset the MSB. Next, set the next lower bit of the MSB, set the voltage tap of the series resistor string to 3/4Vref or 1/4Vref, and compare with the analog input. In this way, each bit from the most significant bit to the least significant bit is sequentially changed and compared with the voltage value selected by SAR 3 (or 4) to determine.

8ビツトの比較が終了すると、SAR3(又は
4)はアナログ入力のデイジタル値を保持してお
り、その結果はCR1〜CR4(CR5〜CR8)レ
ジスタにラツチ入力される。
When the 8-bit comparison is completed, SAR3 (or 4) holds the digital value of the analog input, and the result is latched into the CR1-CR4 (CR5-CR8) registers.

A/Dチヤンネルモードレジスタはその設定に
より、An1〜An4(及びAn9〜An12)又は
An5〜An8(及びAn13〜An16)のアナロ
グ入力を4チヤンネル単位で選択することがで
き、例えばAn1〜An4(An9〜An12)を選
択したとすると、アナログ入力はAn1(An9)
→An2(An10)→An3(An11)→An4
(An12)の順に選択されA/D変換される。各
入力のA/D変換値はCR1(CR5)→CR2
(CR6)→CR3(CR7)→CR4(CR8)の順
に格納される。
The A/D channel mode register is set to An1 to An4 (and An9 to An12) or
The analog inputs of An5 to An8 (and An13 to An16) can be selected in units of 4 channels. For example, if you select An1 to An4 (An9 to An12), the analog input will be An1 (An9).
→An2 (An10) →An3 (An11) →An4
(An12) are selected and A/D converted. The A/D conversion value of each input is CR1 (CR5) → CR2
They are stored in the order of (CR6) → CR3 (CR7) → CR4 (CR8).

4個のCRレジスタに変換値がそろうと、つま
り4チヤネル単位のA/D変換が終了すると内部
割込み要求(以後、A/D割込みという)が発生
する。CR1〜CR4側とCR8側の割込みとでは
優先順位が設けられており、同時に2つのA/D
割込み要求が発生しても優先順に処理される。そ
してその優先度はCR1〜CR4側が高い。
When the converted values are aligned in the four CR registers, that is, when the A/D conversion in units of four channels is completed, an internal interrupt request (hereinafter referred to as A/D interrupt) is generated. Priorities are set for interrupts on the CR1 to CR4 side and CR8 side, and two A/D
Even if an interrupt request occurs, it will be processed in priority order. The priority is higher for CR1 to CR4.

後述する第5図a〜jの制御フローでの割込み
手順は先ずAn1〜An4及びAn9〜An12の各
チヤネルのA/D変換をスタートさせる。各A/
DコンバータはA/D変換を行い、A/D割込み
があるとCR1〜CR4に蓄えられたチヤネルAn
1〜An4の処理を行い、CR5〜CR8側のA/
D割込みを持つ。次のA/D割込みが発生すると
CR5〜CR8に蓄えられたチヤネルAn9〜An1
2の処理を行い、その後An5〜An8、An13
〜An16のA/D変換をスタートさせ上述と同
様の処理を行うというものである。他の方法とし
て、An1〜An8のグルーツプの4画素を画像処
理している間にAn9〜An16のグループの4画
素のA/D変換をオーバラツプさせて全体のスル
ープツトを向上する事も出来る。
The interrupt procedure in the control flow of FIGS. 5a to 5j, which will be described later, first starts A/D conversion of each channel An1 to An4 and An9 to An12. Each A/
The D converter performs A/D conversion, and when there is an A/D interrupt, the channel An stored in CR1 to CR4 is
Perform the processing of 1 to An4, and A/
Has D interrupt. When the next A/D interrupt occurs
Channels An9 to An1 stored in CR5 to CR8
2, then An5 to An8, An13
~An16 A/D conversion is started and the same processing as described above is performed. Another method is to improve the overall throughput by overlapping the A/D conversion of the four pixels in the group An9 to An16 while image processing the four pixels in the group An1 to An8.

次にCPU内の8ビツトマイクロプロセサの構
成要素について説明する。演算を行うALU
(Arithmetic Logic Unit)部、外部からの入出
力インターフエースを行う入力ポートI0〜I7(入
力ポートにはMOD1〜8の信号が入力する)及
び出力ポートO1〜O8、又第5図a〜j如き制御
手順/処理手順を記した制御プログラムを格納す
るプログラムメモリ、命令実行アドレスを保持す
るプログラムカウンタ、プログラムカウンタの指
し示す命令コードを保持する命令レジスタ、その
命令を解析する命令デコーダ、マイクロプロセサ
が命令実行時に使う高速な内部レジスタ(詳細は
後述する)、読み書き可能な主記憶であるデータ
メモリ、割込み又はサブルーチンコール時に前記
各種レジスタ等の内容を一時退避させる為の
PSW Program Status Word)レジスタそして
内部バス等である。
Next, the components of the 8-bit microprocessor within the CPU will be explained. ALU that performs calculations
(Arithmetic Logic Unit) section, input ports I 0 to I 7 (signals of MOD 1 to 8 are input to the input ports) that perform input/output interface from the outside, and output ports O 1 to O 8 , and Fig. 5 A program memory that stores a control program that describes control procedures/processing procedures such as a to j, a program counter that holds the instruction execution address, an instruction register that holds the instruction code pointed to by the program counter, an instruction decoder that analyzes the instruction, and a microprocessor. High-speed internal registers used by the processor when executing instructions (details will be explained later), data memory which is main memory that can be read and written, and data memory that temporarily saves the contents of the various registers etc. during interrupts or subroutine calls.
PSW Program Status Word) registers and internal buses.

本実施例では、1例としてプログラムメモリ容
量としては2Kバイトを、又データメモリ
(RAM)容量としては256バイト各々用意されて
いる。プログラムメモリ内のデータ処理プログラ
ムを入れ換える事により種々画像処理に柔軟に対
応出来る。例えば、MOD1〜8の入力ポートか
ら外部信号を入力することにより前記プログラム
メモリ内のプログラムを入れ替えて処理内容の外
部からの切り換えも可能である。
In this embodiment, as an example, a program memory capacity of 2 Kbytes and a data memory (RAM) capacity of 256 bytes are provided. By replacing the data processing program in the program memory, various image processing can be flexibly handled. For example, by inputting an external signal from the input ports of MODs 1 to 8, it is possible to replace the program in the program memory and change the processing contents from the outside.

CPUの端子類はAn1〜An16、I0〜I7(入力ポ
ート、O1〜O8(出力ポート、外部割込み入力であ
るINT端子、又図示しない端子類としては電源
端子Vcc、Vss、AVcc(A/D用電源、AVss
(A/D用GND)、Vref(A/D用基準電圧入
力)、RESET端子、START信号端子、STOP信
号端子、X1・X2(内蔵クロツク発振用のクリス
タル接続端子など)がある。
The terminals of the CPU are An1 to An16, I 0 to I 7 (input port), O 1 to O 8 (output port, INT terminal which is an external interrupt input), and power terminals Vcc, Vss, AVcc (not shown). A/D power supply, AVss
(GND for A/D), Vref (reference voltage input for A/D), RESET terminal, START signal terminal, STOP signal terminal, X1 and X2 (crystal connection terminals for built-in clock oscillation, etc.).

INT端子には本実施例ではCPU外からの割込
み信号、例えば入力系の副走査方向の水平同期信
号から得られるLA(Line Advance)信号が入力
されている。
In this embodiment, an interrupt signal from outside the CPU, such as an LA (Line Advance) signal obtained from a horizontal synchronization signal in the sub-scanning direction of the input system, is input to the INT terminal in this embodiment.

第3図aはデータメモリ内に蓄えられるA/D
変換後の画像信号等のメモリレイアウトを示して
いる。蓄えられる主要なものとして、画像信号A
(X、Y)(X=1〜16、Y=1〜9)主走査方向
の隣接画素間の濃度差の和を保持するb(Y)(Y=
1〜9)、及び副操作方向の隣接画素間の濃度差
の和を保持するa(X)などがある。X、Yは後述す
るCPUの内部レジスタ内のXカウンタ、Yカウ
ンタである。X方向を主走査方向、Y方向を副走
査方向とすると、A(X、Y)は座標(X、Y)
で示された16×9のメモリマツプ内の画像情報と
なり、一方a(X)=Σ|A(X、Y)−A(X、Y−
1)|、b(Y)=Σ|A(X、Y)−A(X−1、Y)
|となる。
Figure 3a shows the A/D stored in the data memory.
It shows the memory layout of image signals, etc. after conversion. The main thing that is stored is the image signal A
(X, Y) (X=1 to 16, Y=1 to 9) b(Y) (Y=
1 to 9), and a(X) that holds the sum of density differences between adjacent pixels in the sub-operation direction. X and Y are an X counter and a Y counter in internal registers of the CPU, which will be described later. If the X direction is the main scanning direction and the Y direction is the sub scanning direction, A(X, Y) is the coordinate (X, Y)
The image information in the 16×9 memory map is shown by , and a(X)=Σ|A(X,Y)−A(X,Y−
1) |, b(Y)=Σ|A(X,Y)-A(X-1,Y)
becomes |.

第3図aのA(X、Y)は第2図に示されたセ
ンサセル、サンプルボード回路CPU及びそれら
の配線の状態にて第5図a〜jの制御手順を実行
した時に得られるメモリマツプである。第2図と
の対比からもわかるようにA(X、Y)(X=1〜
4、Y=1〜9)はセンサセルE5〜E8の画像
情報、A(X、Y)(X=5〜12、Y=1〜9)は
E9〜E16の画像情報、A(X、Y)(X=13〜
16、Y=1〜9)はE17〜E20の画像情報で
ある、 第5図a〜jに示された画像処理の手順は第3
図cの如く、16×9のメモリマツプ内のA(X、
Y)を9×9のマトリクスに分割し、該マトリク
ス内の画調を認識し、その認識結果に応じて選ん
だ閾値でもつて9×9マトリクスの中心画素(W
+5、5)(W=0〜7)を2値化するものであ
る。この9×9マトリクスを16×9のメモリマツ
プの左端から右端に順次シフトしながら(Wを変
化させながら)画調認識を行いながら2値化する
と、このCPUは座標(5、5)、(6、5)、〜
(12、5)の位置の画像情報、つまりセンサセル
E9〜E16の画像情報を隣接するセンサアレイ
の画像情報E5〜E8,E17〜E20を考慮し
ながら2値化した事になる。
A (X, Y) in Fig. 3a is a memory map obtained when the control procedures shown in Fig. 5 a to j are executed in the state of the sensor cell, sample board circuit CPU, and their wiring shown in Fig. 2. be. As can be seen from the comparison with Figure 2, A (X, Y) (X = 1 ~
4, Y=1-9) is image information of sensor cells E5-E8, A(X, Y) (X=5-12, Y=1-9) is image information of E9-E16, A(X, Y) (X=13~
16, Y=1 to 9) is the image information of E17 to E20. The image processing procedure shown in FIG. 5 a to j is the third
As shown in Figure c, A(X,
The center pixel (W
+5, 5) (W=0 to 7). When this 9x9 matrix is binarized while sequentially shifting from the left end to the right end of the 16x9 memory map (while changing W) and performing image tone recognition, this CPU will convert the coordinates (5, 5), (6 , 5), ~
This means that the image information at the position (12, 5), that is, the image information of the sensor cells E9 to E16, is binarized while considering the image information E5 to E8, E17 to E20 of the adjacent sensor arrays.

このようなCPUが複数で並列に画調認識しな
がら2値化を行い、全CPUが1ラインの2値化
を終了すると、センサセルは副走査方向に1ライ
ン進む。この時に16×9のメモリマツプ内の画像
情報は副走査方向に(図中の矢印の方向)1ライ
ンだけシフトされる。そして、空いたライン9の
座標位置((1、9)〜(16、9))に新たにA/
D変換された画像情報が格納される。そして、前
述の画調認識及び2値化、ラインシフトが繰り返
されるのである。このようにしてCPUはE9〜
E16からの画像情報を主走査方向、副走査方向
にわたつて2次元連続的に画調認識、2値化を行
う事が可能となる。
A plurality of such CPUs perform binarization while recognizing the image tone in parallel, and when all the CPUs complete the binarization of one line, the sensor cell advances one line in the sub-scanning direction. At this time, the image information in the 16×9 memory map is shifted by one line in the sub-scanning direction (in the direction of the arrow in the figure). Then, add a new A/
D-converted image information is stored. Then, the above-described image tone recognition, binarization, and line shift are repeated. In this way, the CPU is E9~
It becomes possible to perform image tone recognition and binarization two-dimensionally and continuously on the image information from E16 in the main scanning direction and the sub-scanning direction.

このような2値化が複数のCPUによつて同時
に行なわれるので、リアルタイムに2次元的に画
調認識を行いながらの2値化処理が実現される。
Since such binarization is performed simultaneously by a plurality of CPUs, binarization processing can be realized while performing two-dimensional image tone recognition in real time.

第3図cの説明を補足すると、16×9のメモリ
マツプ内の9×9マトリクスは左端からW画素
(W=0〜7)ずれているとすると、9×16メモ
リマツプ内では任意の画像情報座標は(X+W、
Y)(X=1〜9、Y=1〜9)の絶対位置に変
換され、2値化される中心画素位置は(W+5、
5)となる。9×9のマトリクスのシフトは変数
Wを0から7まで変化させればよい。
To supplement the explanation of Figure 3c, if we assume that the 9x9 matrix in the 16x9 memory map is shifted by W pixels (W = 0 to 7) from the left edge, then any image information coordinate in the 9x16 memory map is (X+W,
The center pixel position that is converted to the absolute position of Y) (X=1 to 9, Y=1 to 9) and binarized is (W+5,
5). The 9×9 matrix can be shifted by changing the variable W from 0 to 7.

第3図bは内部レジスタのレイアウトである。
内部には8ビツト幅の各種レジスタ、カウンタ及
び1ビツトのフラグがある。RES(Result)レジ
スタは(5、5)、(6、5)、〜(12、5)の8
画素をT(閾値)レジスタに基づいて2値化した
結果を保持する。maxレジスタは9×9マトリ
クス内の最大濃度値を、minレジスタは同じく最
小濃度値を保持する。BLCカウンタは後述の閾
値マトリクス(8×8)から1つの閾値を選定す
るカウンタであつて、0〜63の値をとる。Cレジ
スタは前述した(5、5)、(6、5)、〜(12、
5)の8画素の2値化結果をRESレジスタの所
定の位置に入れるためのレジスタである。
FIG. 3b shows the layout of the internal registers.
Inside there are various 8-bit wide registers, counters, and 1-bit flags. RES (Result) register is (5, 5), (6, 5), ~ (12, 5) 8
The result of binarizing pixels based on the T (threshold value) register is held. The max register holds the maximum density value within the 9x9 matrix, and the min register similarly holds the minimum density value. The BLC counter is a counter that selects one threshold value from a threshold value matrix (8×8) to be described later, and takes a value of 0 to 63. The C registers are (5, 5), (6, 5), ~ (12,
This is a register for inputting the 8-pixel binarization result of 5) into a predetermined position of the RES register.

F/FL(Flag for First Line completed)フ
ラグ及びF/out(Flog for Output)フラグの役
目は画像処理装置がイニシヤル(initial)スター
ト時とそれ以外とを処理の制御上区別するための
フラグである。即ち、F/FLフラグは副走査方
向の隣接画素間の濃度差を求める事はイニシヤル
スタート時は第1ラインに対してはできないから
区別するためであり、一方F/OUTフラグは9
×9マトリクスの画調認識は16×9のメモリマツ
プに全てデータが格納されるまでは出来ないが、
それ以降は1ラインA/D変換する毎に画調認識
が行えるのでその区別のためである。
The role of the F/FL (Flag for First Line completed) flag and the F/out (Flog for Output) flag is to distinguish between the initial start of the image processing device and other times for processing control purposes. . In other words, the F/FL flag is used to differentiate between pixels since it is not possible to obtain the density difference between adjacent pixels in the sub-scanning direction for the first line at the initial start.On the other hand, the F/OUT flag is set to 9
Image tone recognition of the ×9 matrix cannot be performed until all data is stored in the 16 × 9 memory map,
After that, image tone recognition can be performed every time one line is A/D converted, so this is for the purpose of distinguishing between them.

第4図はCPUが2次元での画調認識を行い、
閾値を選択し2値化する処理手順のマクロレベル
での概略フローチヤートである。先ずこの概略フ
ローチヤートに従つて説明する。
Figure 4 shows that the CPU performs two-dimensional image tone recognition.
This is a schematic flowchart at a macro level of a processing procedure for selecting a threshold value and binarizing it. First, explanation will be given according to this general flowchart.

ステツプ10で1ラインのAn1〜An16までを
A/D変換しCRレジスタに格納後、ステツプ11
で主走査方向の隣接画素間の濃度差の絶対値の和
をb(y)に格納していく。ステツプ12は前述したよ
うに16×9のメモリマツプに全て画像情報が格納
されたか否かを判断する。F/outフラグは本実
施例の9×9のマトリクスは主走査方向に1画素
ずつシフトしながら画調認識を行うとともに、1
ラインずつ副走査方向にもシフトしながら画調認
識を行うために一度16×9のメモリマツプに画像
情報が格納されるとそれ以降は各ライン毎に画調
認識を行うためのフラグである。そこで始めはス
テツプ13に進み、副走査方向の隣接画素(前ライ
ンの画素)間の濃度差の和をa(x)に積算していく
とともに、ステツプ14でCRレジスタの内容(つ
まりA/D変換された当該ラインの画像情報)を
16×9のメモリマツプに格納する。1ライ副走査
方向に進み(ステツプ15)。9ラインが分終了す
るまでステツプ10からステツプ16を繰り返す。16
×9のメモリマツプに全て格納されたならF/
outフラグをセツトする(ステツプ17)。
In step 10, one line of An1 to An16 is A/D converted and stored in the CR register, and then in step 11.
Then, the sum of absolute values of density differences between adjacent pixels in the main scanning direction is stored in b(y). In step 12, as described above, it is determined whether all the image information has been stored in the 16×9 memory map. The F/out flag performs image tone recognition while shifting one pixel at a time in the main scanning direction in the 9x9 matrix of this embodiment, and
In order to perform image tone recognition while shifting line by line in the sub-scanning direction, once the image information is stored in the 16×9 memory map, the flag is used to perform image tone recognition for each line thereafter. Therefore, the process first proceeds to step 13, where the sum of density differences between adjacent pixels in the sub-scanning direction (pixels of the previous line) is integrated into a(x), and at step 14, the contents of the CR register (that is, the A/D (image information of the converted line)
Store in a 16x9 memory map. Proceed by one line in the sub-scanning direction (step 15). Repeat steps 10 to 16 until 9 lines are completed. 16
If everything is stored in ×9 memory map, F/
Set the out flag (step 17).

次に9×9のマトリクスを16×9のメモリマツ
プの左端から設定し、(ステツプ18)、主/副両走
査方向の隣接画素間の濃度差の和をレジスタSに
積算し(この時、副走査方向の隣接画素間の濃度
差の和a(x)を利用する)(ステツプ19)、ステツプ
20、21で9×9のマトリクス内の最大/小濃度値
を求めてそれぞれmax、minレジスタに格納す
る。ステツプ22にて式に基づいて画調認識を行
う。尚、9×9内が同一濃度値の場合はS/
(max−min)は0/0になるが0とする。ステ
ツプ23で画調認識結果に応じて閾値を選び、その
閾値で9×9の中心画素を2値化しRESレジス
タに格納する(ステツプ24)。9×9のマトリク
スを主走査方向にずらし(ステツプ25)、上記動
作を8画素分の中心画素に対して行うまで繰り返
す。
Next, a 9x9 matrix is set from the left end of the 16x9 memory map (step 18), and the sum of density differences between adjacent pixels in both the main and sub-scanning directions is accumulated in register S (at this time, (Using the sum a(x) of density differences between adjacent pixels in the scanning direction) (Step 19), Step
In steps 20 and 21, the maximum/minimum density values in the 9×9 matrix are determined and stored in the max and min registers, respectively. In step 22, image tone recognition is performed based on the formula. In addition, if the values within 9×9 are the same density value, S/
(max-min) is 0/0, but it is set to 0. In step 23, a threshold value is selected according to the image tone recognition result, and the 9×9 center pixel is binarized using the threshold value and stored in the RES register (step 24). The 9.times.9 matrix is shifted in the main scanning direction (step 25), and the above operation is repeated until the center pixels of 8 pixels are processed.

8画素の2値化が終了したら、ステツプ27でメ
モリマツプを1ラインずつシフトするための準備
を行う。つまり、a(x)からライン1とライン2の
隣接画素間の濃度差を減算する(ステツプ27)。
そしてメモリマツプを1ラインずつ繰り上げる
(ステツプ28)。RESレジスタの内容(当該CPU
の担当8画素の2値化データ)を出力ポートから
出力(ステツプ29)し、RESレジスタをクリア
(ステツプ30)しステツプ10に戻る。
When the binarization of 8 pixels is completed, preparations are made for shifting the memory map line by line in step 27. That is, the density difference between adjacent pixels on lines 1 and 2 is subtracted from a(x) (step 27).
Then, the memory map is advanced one line at a time (step 28). The contents of the RES register (the CPU
(binarized data of the 8 pixels in charge) is output from the output port (step 29), the RES register is cleared (step 30), and the process returns to step 10.

以降は、1ラインA/D変換する毎にその画像
情報とライン8との濃度差を求めてa(x)を更新し
(ステツプ31)、当該画像情報をライン9の16×9
のメモリマツプに格納し(ステツプ32)、以下前
述した画調認識、2値化を繰り返す。
From then on, each time one line is A/D converted, the density difference between the image information and line 8 is calculated and a(x) is updated (step 31), and the image information is converted into the 16 x 9 line of line 9.
The image is stored in the memory map (step 32), and the image tone recognition and binarization described above are repeated.

次にCPUの動作を第5図a〜jを用いてより
詳細に説明する。
Next, the operation of the CPU will be explained in more detail using FIGS. 5a to 5j.

第5図aは処理プログラムのメインフローであ
る。ステツプ1においてCUPは入力/出力ポー
ト、データメモリ、A/Dチヤネルレジスタ、割
込みの初期化を行ない、ステツプ41で外部からの
START信号待ちとなる。このSTART信号は
CPU全体を統括する他の制御手段等からの信号
であつて画像入力開始となるものである。この
START信号を受付けるとCPUは割込の許可を
ステツプ42で行ない、ステツプ43で処理を停止す
るHALT状態になる。このHALT状態は割込類
の処理後リターン命令によりプロブラムカウンタ
ーがインクリメントされるかRESET(信号又は
電源の再投入)によつてのみ解除されるものであ
る。従つて外部割込み(LA)又はA/D割込等
の割込み処理後メインフローとしてはステツプ44
へ進む。ステツプ44では処理を終了するか否かを
判断しSTOP信号が無ければステツプ43へ戻り再
度HALT状態とし、STOP信号があればステツ
プ45へ進む。このSTOP信号も前述したSTART
信号と同様に他の制御手段から送られるものであ
る。ステツプ45では外部割込み(LA)とA/D
割込みの禁止を行なつて、この後ステツプ40に戻
り、上記の処理を繰り返すものである。
FIG. 5a shows the main flow of the processing program. In step 1, the CUP initializes input/output ports, data memory, A/D channel registers, and interrupts, and in step 41, the CUP initializes input/output ports, data memory, A/D channel registers, and interrupts.
Waiting for START signal. This START signal is
This is a signal from other control means that controls the entire CPU, and is used to start image input. this
Upon receiving the START signal, the CPU permits interrupts in step 42, and enters the HALT state in step 43 to stop processing. This HALT state can only be released by incrementing the program counter by a return command after processing an interrupt, or by RESET (signal or power cycle). Therefore, after processing interrupts such as external interrupts (LA) or A/D interrupts, the main flow is step 44.
Proceed to. In step 44, it is determined whether or not to end the process. If there is no STOP signal, the process returns to step 43 and the HALT state is established again. If there is a STOP signal, the process proceeds to step 45. This STOP signal is also the START signal mentioned above.
Similar to signals, these are sent from other control means. In step 45, external interrupt (LA) and A/D
After disabling interrupts, the process returns to step 40 and repeats the above process.

第5図bはHALT時における割込み待機及び
割込み処理のフローである。従つて、前述の外部
割込み許可又は後述するA/D割込み許可後の割
込み待機は第5図bのステツプ50にて行う。先ず
ステツプ50にて割込みを待つ。割込みがあればそ
の割込みが外部からの割込みによるものか、それ
ともA/D割込み(後述するように4種類ある)
によるものかを調べ、割込みベクトルから割込み
アドレスを決定する(ステツプ52)。
FIG. 5b is a flowchart of interrupt waiting and interrupt processing during HALT. Therefore, after the above-mentioned external interrupt is enabled or the later-described A/D interrupt is enabled, interrupt waiting is performed at step 50 in FIG. 5b. First, at step 50, an interrupt is waited for. If there is an interrupt, is it an external interrupt or an A/D interrupt (there are 4 types as explained later)?
The interrupt address is determined from the interrupt vector (step 52).

次に、ステツプ54でリターンアドレスを決定し
(本実施例ではステツプ44がリターン先である)、
ステツプ56にてリターンしても元の状態に復帰出
来るようにPSWレジスタにマイクロプロセツサ
内の各種レジスタ及びリターンアドレスを退避さ
せて前記割込みアドレス(本実施例では割込みの
種類によりステツプ60、70、100、130、160のい
ずれかである)にジヤンプする。
Next, in step 54, a return address is determined (in this embodiment, step 44 is the return destination),
In order to be able to return to the original state even if the program returns at step 56, various registers in the microprocessor and the return address are saved in the PSW register, and the interrupt address (in this embodiment, steps 60, 70, 70, etc. depending on the type of interrupt) is saved. 100, 130, or 160).

次に、第5図cのフローチヤートを用いて、全
処理の基準となり400μsec毎に発生するLA信号に
よる外部割込み処理ルーチンについて説明する。
まず、ステツプ50(第5図b)にて外部割込みが
発生するとその割込みベクタアドレスに示される
アドレス(本実施例ではステツプ60)へジヤンプ
する。ステツプ60において、フラグF/OUTを
調べる(このフラグは前述したイニシヤルスター
ト以後の最初の9ラインがデータマツプに全て格
納されたか否かを示すフラグである)。
Next, using the flowchart of FIG. 5c, an explanation will be given of the external interrupt processing routine using the LA signal, which is a reference for all processing and is generated every 400 μsec.
First, when an external interrupt occurs at step 50 (FIG. 5b), the program jumps to the address indicated by the interrupt vector address (step 60 in this embodiment). In step 60, the flag F/OUT is checked (this flag indicates whether or not all of the first nine lines after the initial start described above have been stored in the data map).

このフラグがセツトしている事は少なくともデ
ータマツプに全画素の濃度データが格納され、更
に前ラインまでの画像処理(本実施例では8画素
の2値化)も終了している事を示しているのであ
るから、ステツプ62へ進み、画像処理された8ビ
ツトの出力データが記憶されているレジスタ
RESを出力ポートへ出力し、その後レジスタ
RESをクリアしてステツプ64へ進む。一方、フ
ラグF/OUTがセツトしていなければ未だデー
タマツプには全て格納されていないのであるか
ら、レジスタRESを出力せずに直接ステツプ64
へと進む。
The fact that this flag is set indicates that at least the density data of all pixels has been stored in the data map, and that the image processing up to the previous line (binaryization of 8 pixels in this example) has also been completed. Therefore, the process proceeds to step 62, and the register storing the image-processed 8-bit output data is stored.
Output RES to output port, then register
Clear RES and proceed to step 64. On the other hand, if the flag F/OUT is not set, all data has not been stored in the data map yet, so step 64 is directly executed without outputting the register RES.
Proceed to.

ステツプ64ではA/D変換のモードを設定する
ためのA/DチヤンネルレジスタにAn1〜An4
及びAn9〜An12のチヤンネルをセレクトする
ためのデータを与え、ステツプ66において外部割
込み(LA信号)とA/D割込みの禁止を解除し、
ステツプ68においてA/Dコンバータに対して
A/Dチヤンネルレジスタの内容に従いA/D変
換を行なわせるためのA/Dスタート命令を送
り、各部割込みがかかつた戻り先アドレスへリタ
ーンしてA/D割込みを待つ。
In step 64, An1 to An4 are stored in the A/D channel register for setting the A/D conversion mode.
and data for selecting channels An9 to An12, and in step 66, disables external interrupts (LA signal) and A/D interrupts,
In step 68, an A/D start command is sent to the A/D converter to perform A/D conversion according to the contents of the A/D channel register, and the A/D converter returns to the return destination address where the interrupt occurred. Wait for D interrupt.

第5図d〜jは全てA/D割込みの処理ルーチ
ンである。基準信号LAの400μsecの間に4回割込
みがかかるものでそのタイミングは1回目=An
1〜An4、2回目=An9〜An12、3回目=
An5〜An8、4回目=An13〜An16の各4
チヤンネルのA/D変換毎となる。
5d to 5j are all A/D interrupt processing routines. Interrupts occur 4 times during 400 μsec of reference signal LA, and the timing is 1st = An
1~An4, 2nd time=An9~An12, 3rd time=
An5 to An8, 4th time = 4 each of An13 to An16
This occurs for each channel A/D conversion.

ステツプ50でまずA/Dの割込みが発生すると
前述した様にベクターアドレスに示されるアドレ
スへジヤンプする。このベクタアドレスは1回目
=An1〜An4であればステツプ70、2回目=
An9〜An12であればステツプ100、3回目=
An5〜An8であればステツプ130、4回目=An
13〜An16であればステツプ160である。
At step 50, when an A/D interrupt occurs, the program jumps to the address indicated by the vector address as described above. This vector address is step 70 if the first time = An1 to An4, and the second time =
For An9 to An12, step 100, 3rd time =
If An5 to An8, step 130, 4th = An
13 to An16, step 160 is reached.

以下に最初の1ライン即ち、メモリマツプに格
納し始める為のA/D割込みの処理フローを説明
する。最初の1ラインに対する処理では、フラグ
F/FL、F/OUTは勿論リセツトしている。最
初に発生するA/D割込みはAn1〜An4であろ
う。
The processing flow for the first line, ie, the A/D interrupt for starting storage in the memory map, will be explained below. In the processing for the first line, the flags F/FL and F/OUT are of course reset. The first A/D interrupts to occur will be An1-An4.

An1〜An4の割込が発生するとステツプ70へ
ジヤンプし、ステツプ70〜ステツプ74でAn1〜
An4の4チヤネルのA/D変換された結果が記
憶されているレジスタCR1〜CR4間の差の絶対
値を求めデータメモリ内のb(y)に格納していく。
次にステツプ76でフラグF/FLの状態を調べ、
最初のラインに対してはこのフラグはセツトして
いないからステツプ78へ進む。ステツプ78では現
在のラインの画素濃度を蓄えているCR1〜CR4
の内容をそのままA(1、1)〜A(4、1)へ格
納する。そのまま格納するのは最初のラインに対
しては前ラインというものが無いからである。そ
してステツプ50へ戻り次のAn9〜An12の割込
みを待つ。
When an interrupt from An1 to An4 occurs, the process jumps to step 70, and from step 70 to step 74, An1 to An4 are processed.
The absolute value of the difference between the registers CR1 to CR4 in which the results of A/D conversion of the four channels of An4 are stored is determined and stored in b(y) in the data memory.
Next, in step 76, check the status of flag F/FL,
Since this flag is not set for the first line, the process advances to step 78. In step 78, CR1 to CR4 store the pixel density of the current line.
The contents of are stored as they are in A(1,1) to A(4,1). The reason why it is stored as is is that there is no previous line for the first line. Then, the process returns to step 50 and waits for the next An9 to An12 interrupt.

An9〜An12の割込みが発生すると、ステツ
プ100〜104にてCR5〜CR8に蓄えられたAn9
〜An12の濃度の差の絶対値の和を前述したb
(y)に累積していく。そして同じくステツプ106か
らステツプ108へ進みA(9、1)〜A(12、1)
にAn9〜An12の画素の濃度を蓄える。次にス
テツプ122へ進み、A/Dチヤネルレジスタにチ
ヤネル(5、8)〜(13、16)を設定し更にA/
D変換をスタートさせてステツプ50へ戻り次の割
込みを待つ。
When An9 to An12 interrupts occur, An9 is stored in CR5 to CR8 in steps 100 to 104.
〜The sum of the absolute values of the differences in concentration of An12 is b as described above.
It accumulates in (y). Then, proceed from step 106 to step 108, and step A (9, 1) to A (12, 1).
The density of pixels An9 to An12 is stored in . Next, proceed to step 122, set channels (5, 8) to (13, 16) in the A/D channel register, and then
Start D conversion and return to step 50 to wait for the next interrupt.

次の割込みはチヤネル5〜8から発生する。該
割込みが発生すると、ステツプ130〜ステツプ134
にて前述のステツプ100〜ステツプ104と同様にb
(y)に主走査方向の濃度差の絶対値を累積してい
く。そしてステツプ136にてフラグを調べ、未だ
最初のラインの処理が終了していないからステツ
プ138へ進みCR1〜CR4に蓄えられたAn5〜
An8の画素濃度をA(5、1)〜A(8、1)に
格納して再びステツプ50へ戻りチヤネル13〜16か
らの割込みを待つ。
The next interrupt occurs from channels 5-8. When the interrupt occurs, steps 130 to 134 are executed.
Then step b in the same way as steps 100 to 104 described above.
The absolute value of the density difference in the main scanning direction is accumulated in (y). Then, in step 136, the flag is checked, and since the processing of the first line has not yet been completed, the process proceeds to step 138, where An5 to An5 stored in CR1 to CR4 are stored.
The pixel density of An8 is stored in A(5,1) to A(8,1), and the process returns to step 50 to wait for an interrupt from channels 13 to 16.

チヤネル13〜16からのA/D割込みが発生する
と、ステツプ160〜164にて同じく主走査方向の画
素濃度差の絶対値の累積を行い、ステツプ168に
て当該最初のラインの画素濃度をA(13、1)〜
A(16、1)に格納する。そして第5図hのステ
ツプ200へ進む。この時点で最初のラインの主走
査方向の濃度差の絶対値がb(y)に、An1〜An1
6の画素濃度がA(1、1)〜A(16、1)に蓄え
られた事になる。又他のCPUも同時に上記動作
を行つているから、1ライン全体に渡つての画素
データが蓄えられた事になる。
When an A/D interrupt from channels 13 to 16 occurs, the absolute values of pixel density differences in the main scanning direction are similarly accumulated in steps 160 to 164, and the pixel density of the first line is set to A( 13, 1) ~
Store in A(16,1). The process then proceeds to step 200 in FIG. 5h. At this point, the absolute value of the density difference in the main scanning direction of the first line is b(y), An1 to An1
This means that the pixel density of 6 is stored in A(1,1) to A(16,1). Also, since other CPUs are also performing the above operations at the same time, pixel data for one entire line is stored.

次に、ステツプ200で次のラインに備えてyカ
ウンタを1カウントアツプする。ステツプ202で
9ラインの処理が終了したか調べ、まだ終了して
いないので(NO)、ステツプ204へ進みフラグ
F/OUTを調べる。ステテプ202でy=10を調べ
た後ステツプ204でフラグF/OUTを調べるのは
次のような理由による。即ち、9ラインのデータ
の格納が終了すれば(y=10であれば)ステツプ
208でカウンタyを初期値1へ戻し更にステツプ
210でフラグF/OUTをセツトする。そして以降
のフローでは16×9のメモリマツプ内の画調認識
を行いながら中心画素の2値化を行うのである
が、10ライン目以降に対しては1ライン毎に画調
認識及び中心画素の2値化を行う事としている為
に、ステツプ202でy≠10であつても212以降へ進
む為にステツプ204を設けたのである。
Next, in step 200, the y counter is incremented by one in preparation for the next line. In step 202, it is checked whether the processing of 9 lines has been completed, and since it has not been completed (NO), the process advances to step 204 and the flag F/OUT is checked. The reason why the flag F/OUT is checked in step 204 after checking y=10 in step 202 is as follows. In other words, when 9 lines of data have been stored (if y=10), the step
At 208, return the counter y to the initial value 1 and continue the steps.
At 210, flag F/OUT is set. In the subsequent flow, the center pixel is binarized while recognizing the image tone in the 16×9 memory map, but from the 10th line onward, image tone recognition is performed line by line and the center pixel is binarized. Since value conversion is to be performed, step 204 is provided in order to proceed to step 212 and subsequent steps even if y≠10 in step 202.

さて、ステツプ204でフラグを調べた後ステツ
プ206へ進み最初のラインの画素のデータ格納が
終了した事を示すフラグF/FLをセツトして、
次の外部(LA信号)割込みを待つ為にステツプ
50へ戻る。
Now, after checking the flags in step 204, the process goes to step 206 and sets the flag F/FL indicating that data storage of the pixels of the first line has been completed.
Step to wait for next external (LA signal) interrupt
Return to 50.

走査系が副走査方向に移動すると共に発生する
LA信号が再び発生すると、第5図bの割込み処
理フローから第5図cの外部割込みフローへ移
り、前述したステツプ60〜ステツプ68を繰返して
A/D変換をスタートさせる。そして再びチヤネ
ル1〜4、チヤネル9〜12からの割込みを待つ。
Occurs when the scanning system moves in the sub-scanning direction.
When the LA signal is generated again, the interrupt processing flow shown in FIG. 5b is transferred to the external interrupt flow shown in FIG. 5c, and steps 60 to 68 described above are repeated to start A/D conversion. Then, it waits for interrupts from channels 1 to 4 and channels 9 to 12 again.

チヤネル1〜4からの割込みが発生するとステ
ツプ70へジヤンプし、ステツプ70〜74を繰返して
ステツプ76へ進む。今度はフラグF/FLはセツ
トしているので、ステツプ80へ進み、現在のライ
ン(2ライン目)の画素濃度を蓄えているCR1
〜CR4と前ライン(y−1)のデータメモリ内
に蓄えられている画素濃度A(1、y−1)〜A
(4、y−1)との差の絶対値、即ち副走査方向
の濃度差の絶対値の和をa(1)〜a(4)に累積してい
く。次に、ステツプ88でフラグF/OUTを調べ
未だ9ラインの処理が終了していない(NO)か
ら、ステツプ90へ進みカウンタyで示される現在
のラインに対応するA(1、y)〜A(4、y)に
An1〜Anの画素の濃度を蓄えて、ステツプ50へ
戻り、次のAn9〜An12からの割込みを待つ。
When an interrupt from channels 1 to 4 occurs, the process jumps to step 70, repeats steps 70 to 74, and then proceeds to step 76. Since the flag F/FL has been set this time, proceed to step 80 and read CR1, which stores the pixel density of the current line (second line).
~CR4 and the pixel density A (1, y-1) stored in the data memory of the previous line (y-1) ~A
(4, y-1), that is, the sum of the absolute values of density differences in the sub-scanning direction, are accumulated in a(1) to a(4). Next, in step 88, the flag F/OUT is checked and since the processing of 9 lines has not yet been completed (NO), the process proceeds to step 90, where the process A(1, y) to A corresponding to the current line indicated by the counter y. (4,y)
The density of pixels An1 to An is stored, and the process returns to step 50 to wait for the next interrupt from An9 to An12.

An9〜An12からの割込みが発生するとステ
ツプ100〜ステツプ104の主走査方向の濃度差の絶
対値の和を累積処理を行つて、更にステツプ106、
ステツプ110〜ステツプ116にて副走査方向の濃度
差の絶対値の和の累積を行い、更にステツプ118、
ステツプ120にてカウンタyが示すA(9、y)〜
A(12、y)に現在のラインの画素濃度が格納さ
れているCR5〜CR8の内容を格納する。そし
て、ステツプ122にてAn5〜An8及びAn13〜
An16のA/D変換を行なわせるために、A/
Dチヤンネルレジスタを設定し、このA/Dチヤ
ンネルレジスタの内容に従いA/Dを行なわせる
ためのA/D変換スタート命令を実行して、チヤ
ネル(5〜8)からの割込みを待つ為にステツプ
50へ戻る。
When an interrupt from An9 to An12 occurs, the sum of the absolute values of the density differences in the main scanning direction in steps 100 to 104 is cumulatively processed, and then in step 106,
In steps 110 to 116, the sum of absolute values of density differences in the sub-scanning direction is accumulated, and then in steps 118 and 116, the sum of absolute values of density differences in the sub-scanning direction is accumulated.
A(9, y) indicated by counter y at step 120
A(12, y) stores the contents of CR5 to CR8 in which the pixel density of the current line is stored. Then, in step 122, An5 to An8 and An13 to
In order to perform A/D conversion of An16,
Set the D channel register, execute the A/D conversion start command to perform A/D according to the contents of this A/D channel register, and step to wait for an interrupt from channels (5 to 8).
Return to 50.

第5図fはチヤネル(5〜8)からの割込み処
理のフローである。又、第5図gはチヤネル(13
〜16)からの割込み処理フローである。処理の詳
細は基本的にはチヤネル(1〜4)及びチヤネル
(9〜12)と全く変わらないので省略する。
FIG. 5f shows the flow of interrupt processing from channels (5 to 8). Also, Figure 5g shows the channel (13
This is the interrupt processing flow from 16) to 16). The details of the processing are basically the same as those for channels (1 to 4) and channels (9 to 12), and will therefore be omitted.

次に、ステツプ200→ステツプ→202ステツプ→
204ステツプ→206からステツプ50へ戻る。このよ
うな第5図c〜第5図gに示されたフローをステ
ツプ202でy=10になるまで、即ち第3図aのメ
モリマツプに画素濃度情報が全て蓄えられるまで
繰返す。前記繰返し後、ステツプ202にてy=10
になると、ステツプ208にてyを初期値(y=1)
に戻し、又ステツプ210でこれ以降画像処理の演
算及び結果の出力も可能となつた事を示すフラグ
F/OUTをセツトして以降画調判定のフローへ
と進む。
Next, step 200 → step → 202 step →
Return to step 50 from step 204 → 206. The flow shown in FIGS. 5c to 5g is repeated until y=10 in step 202, that is, until all the pixel density information is stored in the memory map of FIG. 3a. After the above repetition, y=10 in step 202
Then, in step 208, set y to the initial value (y=1)
Then, in step 210, a flag F/OUT indicating that image processing calculations and output of the results are now possible is set, and the process then proceeds to the image tone determination flow.

次に画調判定のための演算がステツプ212以降
より行なわれるが、再度このための条件を言うな
らば、まず最初の9ラインの(ライン1〜ライン
9)×(An1〜An16)の144個の画素データが
全て記憶された以降である。即ち、最初の9ライ
ンのデータが格納されたならそれ以降は1ライン
の16画素を格納する度に画調判定を行う。
Next, calculations for image tone determination are performed from step 212 onwards, but the conditions for this are as follows: First, the first 9 lines (line 1 to line 9) x (An1 to An16), 144 This is after all pixel data has been stored. That is, once the first nine lines of data have been stored, image tone determination is performed every time one line of 16 pixels is stored.

本実施例は画像処理プロセツサを使用すること
により逐次で画素判定が可能となる為、従来ハー
ドロジツクで行なつていたように4×4或は8×
8等のブロツクがシフトする度にその都度ブロツ
ク単位で判定及び出力をする必要がなくなつた。
この為、第3図aに示すメモリマツプのライン5
の(5、5)〜(12、5)までの8画素を(実線
で囲んでいる)対象としてその各画素を中心とし
た9×9画素のブロツクを所定演算し、当該画素
に適した閾値により2値化を行なうのである。
In this embodiment, by using an image processing processor, pixel judgment can be performed sequentially.
It is no longer necessary to perform judgment and output for each block each time a block such as 8 is shifted.
For this reason, line 5 of the memory map shown in Figure 3a
8 pixels from (5, 5) to (12, 5) (encircled by a solid line) are subjected to predetermined calculations on a 9x9 pixel block centered on each pixel, and a threshold value suitable for the pixel is calculated. Binarization is performed using this method.

次に、以下のフローで用いるカウンタ等につい
て第3図b,cを参照しつつ再度説明する。画調
認識する範囲は第3図cの9×9のマトリクスで
ある。当該マトリクスが16×9のメモリマツプ内
を移動できるようにカウンタWを変化させる。
又、9×9のマトリクス内の画素は第3図cの如
く(x+w、y)で指定する。(w+5、5)は
2値化の行なわれる中心画素位置である。カウン
タcはRESレジスタ内のビツト位置を指定する
為のカウンタである。又、maxレジスタ及びmin
レジスタは9×9内の最大、最小濃度を保持する
レジスタであつて、それらの初期値は夫々0及び
63である。maxレジスタは0〜63の値を取り得
る。本来は8ビツトA/D変換である為その範囲
は0〜255であるべきだが、処理容量が大きくな
る事、又8ビツトのうち上位6ビツトで処理して
も画像に与える影響はほとんど無い事の理由によ
り演算、判定は全て上位6ビツトの0〜63の範囲
内としている。
Next, counters and the like used in the following flow will be explained again with reference to FIGS. 3b and 3c. The range for image tone recognition is the 9×9 matrix shown in FIG. 3c. The counter W is changed so that the matrix can be moved within the 16×9 memory map.
Further, pixels in the 9×9 matrix are designated by (x+w, y) as shown in FIG. 3c. (w+5, 5) is the center pixel position where binarization is performed. Counter c is a counter for specifying the bit position in the RES register. Also, max register and min
The register is a register that holds the maximum and minimum density within 9x9, and their initial values are 0 and 0, respectively.
It is 63. The max register can take values from 0 to 63. Originally, since it is an 8-bit A/D conversion, the range should be 0 to 255, but the processing capacity becomes large, and processing with the upper 6 bits of the 8 bits has almost no effect on the image. For this reason, all calculations and judgments are performed within the range of 0 to 63 of the upper 6 bits.

次に、画調認識について説明する。ステツプ
212〜219でカウンタc、x、y、w及びレジスタ
min、maxを夫々初期化する。この時点で9×9
マトリクスは16×9メモリマツプの左端にある。
Next, image tone recognition will be explained. step
Counters c, x, y, w and registers from 212 to 219
Initialize min and max respectively. At this point 9×9
The matrix is located at the left end of the 16x9 memory map.

次に、カウンタxが9になるまで(9×9マト
リクスの右端にいくまで)ステツプ220〜ステツ
プ228を繰り返して、レジスタSに9×9内の主
走査方向の隣接画素間の濃度差の絶対値|A(x
+w、y)−A(x+w、y)|の累積値を格納し、
レジスタmaxには同じく9×9内の主走査方向
の最大濃度値を、レジスタminにはその最小濃度
値を夫々格納する。
Next, steps 220 to 228 are repeated until the counter x reaches 9 (until it reaches the right end of the 9x9 matrix), and the absolute value of the density difference between adjacent pixels in the main scanning direction within 9x9 is stored in the register S. Value | A(x
+w, y) - A(x+w, y) | stores the cumulative value,
Similarly, the maximum density value in the main scanning direction within 9×9 is stored in the register max, and the minimum density value is stored in the register min.

次に、カウンタxを1に戻し(ステツプ230)
カウンタyをカウントアツプしてy=10になるま
でステツプ220〜ステツプ234を繰り返す。こうし
て、S、max及びminレジスタには9ライン全部
の累積値、最大値、最小値が格納される。
Next, return the counter x to 1 (step 230)
Counter y is counted up and steps 220 to 234 are repeated until y=10. Thus, the S, max, and min registers store the cumulative values, maximum values, and minimum values of all 9 lines.

次のステツプ236〜ステツプ240までの繰り返し
フローは前述した副走査方向の濃度差の累積値a
(x)をレジスタSに加算するフローである。この結
果レジスタSには9×9内の主/副両走査方向の
隣接画素間の濃度差の総和が格納される。
The repeating flow from step 236 to step 240 is the cumulative value a of the density difference in the sub-scanning direction mentioned above.
This is a flow for adding (x) to register S. The result register S stores the sum of density differences between adjacent pixels in both the main and sub-scanning directions within 9×9.

ステツプ242、244でカウンタx、yを初期値に
戻し、ステツプ246でレジスタSの内容をレジス
タmaxからレジスタminを減じたもので除してそ
の商をレジスタSに格納する。この商は9×9内
の画調を反映している筈で、この数に応じて2値
化の閾値を選べば良い。第5図iのステツプ250
〜ステツプ266まではこの閾値を選ぶフローであ
る。選ばれた閾値はレジスタTに格納される。
In steps 242 and 244, counters x and y are returned to their initial values, and in step 246, the contents of register S are divided by register max minus register min, and the quotient is stored in register S. This quotient should reflect the image tone within 9×9, and the binarization threshold may be selected according to this number. Step 250 of Figure 5 i
~Step 266 is the flow for selecting this threshold value. The selected threshold value is stored in register T.

閾値は先ず第7図a〜hに示される如くマトリ
クスBL(ブロツク)1〜マトリクスBL8までの
いずれか1つをSの値に応じて選ぶ。各BLは8
×8のマトリクスでそのうちの1つの閾値がカウ
ンタBLCの値に応じて選ばれる。カウンタBLC
は1〜64の値を取り得るのでカウンタBLCの値
を順に変化させる事により、9×9画素のブロツ
クの連続して画調認識を行ないながら、その中心
画素を最適閾値で2値化するのである。各マトリ
クスBLの詳細については後述する。
As the threshold value, first, one of the matrices BL (block) 1 to BL8 is selected according to the value of S, as shown in FIGS. 7a to 7h. Each BL is 8
One threshold value of the ×8 matrix is selected according to the value of the counter BLC. counter BLC
can take values from 1 to 64, so by sequentially changing the value of the counter BLC, the center pixel is binarized using the optimal threshold while continuously recognizing the tone of the 9 x 9 pixel block. be. Details of each matrix BL will be described later.

ステツプ268で中心画素(w+5、5)の濃度
値A(w+5、5)とレジスタTを2値化の為に
比較する。もし閾値よりも画素濃度が大きけれ
ば、ステツプ270にてレジスタRESとカウンタc
との論理和(Logical Or)を取る。カウンタc
の役割は注目画素が8個ある為にその2値化結果
を8ビツトのレジスタRESの所定のビツト位置
に格納する為である。
At step 268, the density value A(w+5,5) of the center pixel (w+5,5) and the register T are compared for binarization. If the pixel density is greater than the threshold, in step 270 register RES and counter c
Take a Logical Or with. counter c
Since there are eight pixels of interest, the role of is to store the binarized result in a predetermined bit position of the 8-bit register RES.

レジスタRESに2値化結果が格納されるとス
テツプ272にて、カウンタwを1カウントアツプ
する。カウンタwをカウントアツプする事によつ
て9×9マトリクスを16×9メモリマツプ内で移
動出来る。
When the binarization result is stored in the register RES, in step 272, the counter w is incremented by one. By incrementing the counter w, the 9x9 matrix can be moved within the 16x9 memory map.

ステツプ274〜ステツプ278のループはカウンタ
BLCを順にカウントアツプする為のフローであ
る。
The loop from step 274 to step 278 is a counter.
This is a flow for counting up BLC in order.

ステツプ280で、カウンタcの内容を左へ1ビ
ツトシフトする。従つてCの値は1、2、4、
8、16、32、64、128の何れかになる。こうして、
ステツプ270で2値化結果が順次ビツト位置をず
らしてレジスタRESに格納出来るのである。ス
テツプ282でカウンタwが8に等しくなつたかを
調べて、中心の8画素全部を2値化するまでステ
ツプ220以降を繰り返し2値化結果をレジスタ
RESに格納する。
At step 280, the contents of counter c are shifted to the left by one bit. Therefore, the values of C are 1, 2, 4,
It will be either 8, 16, 32, 64, or 128. thus,
In step 270, the binarization result can be stored in the register RES with the bit positions sequentially shifted. In step 282, check whether the counter w has become equal to 8 or not, and repeat steps 220 and subsequent steps until all eight pixels at the center have been binarized, and register the binarization results.
Store in RES.

次に、ステツプ290、292でカウンタx、wの初
期化を行う。更に、ステツプ300〜ステツプ314で
16×9のメモリマツプの格納データを1ラインず
つ順次上へシフトする為に、ステツプ294でa(x)
から第1ラインと第2ラインとの副走査方向の隣
接画素間の濃度差|A(x、1)−A(x、2)|を
減じ、それを主走査方向の全画素について行う。
このようにすると、各a(x)にはライン2からライ
ン9までの副走査方向の画素濃度差が格納された
事になる。
Next, in steps 290 and 292, counters x and w are initialized. Furthermore, in steps 300 to 314
In order to sequentially shift the data stored in the 16×9 memory map upward one line at a time, a(x) is executed in step 294.
The density difference |A(x, 1)−A(x, 2)| between adjacent pixels in the sub-scanning direction between the first line and the second line is subtracted from the subtracting value, and this is performed for all pixels in the main-scanning direction.
In this way, each a(x) stores the pixel density difference in the sub-scanning direction from line 2 to line 9.

そこで、ステツプ300〜ステツプ314にて順次メ
モリマツプ内をシフトする。従つて、メモリマツ
プ内の第9ラインは空になつて次のラインの走査
によるデータの格納が可能となる。そして次の外
部割込を待つ為にステツプ316で戻り先アドレス
へリターンする。
Therefore, in steps 300 to 314, the memory map is sequentially shifted. Therefore, the ninth line in the memory map becomes empty, allowing data to be stored by scanning the next line. Then, in step 316, the program returns to the return destination address to wait for the next external interrupt.

以上、ステツプ212〜ステツプ314までのフロー
で最初の9ラインの2値化が終了するまでを説明
した。この時点では、レジスタRESには16×9
のメモリマツプの荘目画素の2値化結果が格納さ
れ、16×9のメモリマツプの第1ライン〜第8ラ
インまでには前8ラインの画素濃度データが格納
されている。
The flow from step 212 to step 314 has been described above until the binarization of the first nine lines is completed. At this point, register RES contains 16x9
The binarization results of the middle pixels of the memory map are stored, and the pixel density data of the previous eight lines are stored in the first to eighth lines of the 16×9 memory map.

従つて、走査手段が副走査方向へ1ライン移動
して、次の外部割込みが発生すると第5図cのス
テツプ60に行き、フラグF/OUTはセツトして
いるからステツプ62でレジスタRESから出力し、
次のラインの為の前述のフローを繰り返すのであ
る。
Therefore, when the scanning means moves one line in the sub-scanning direction and the next external interrupt occurs, the process goes to step 60 in FIG. death,
Repeat the above flow for the next line.

此以降は、フラグF/OUTはセツトされたま
まになるので、第5図dのステツプ88、第5図e
のステツプ118、第5図fのステツプ148及び第5
図gのステツプ178では夫々ステツプ92、ステツ
プ124、ステツプ152及びステツプ182へ進みCRレ
ジスタに蓄えられた画素濃度を順次メモリマツプ
の第9ラインに格納していく。こうして、以降は
1ラインを読み取る毎に9×9のマトリクス内の
画調認識及び2値化を行つていく。
From this point on, the flag F/OUT remains set, so step 88 in Figure 5 d and Figure 5 e
step 118 of FIG. 5f, step 148 of FIG.
At step 178 in Figure G, the steps proceed to steps 92, 124, 152 and 182, respectively, and the pixel densities stored in the CR register are sequentially stored in the ninth line of the memory map. In this way, thereafter, image tone recognition and binarization within the 9×9 matrix are performed every time one line is read.

レジスタRESからの出力は第1図のシフトレ
ジスタSRに一時保持され、順次コンカチネート
されたシフトレジスタSRからシリアルに出力さ
れる。こうして、並列処理された画像信号はリア
ルタイムに画調認識され2値化されるのである。
The output from the register RES is temporarily held in the shift register SR shown in FIG. 1, and is serially output from the concatenated shift registers SR. In this way, the parallel-processed image signals are recognized in real time and binarized.

以上説明した画調認識の方法は中心画素を1画
素ずつずらしながら行うという方法であるが、勿
論閾値マトリクスの大きさのブロツクに16×9の
メモリマツプを分割し、ブロツク毎に閾値マトリ
クスで2値化しても同じ効果は得られる。この場
合でも隣接CPU担当の画像信号を取り込むので
CPU間の不整合は生じないし、更に高速の画像
処理が可能となる。
The image tone recognition method explained above is performed by shifting the center pixel one pixel at a time, but of course the 16x9 memory map is divided into blocks of the size of the threshold matrix, and each block is divided into binary values using the threshold matrix. The same effect can be obtained even if Even in this case, the image signal of the adjacent CPU is imported, so
There is no mismatch between CPUs, and even faster image processing is possible.

次に第7図a〜hに示したマトリクスBL1〜
BL8の説明を行なう。
Next, the matrix BL1~ shown in Figure 7 a~h
I will explain BL8.

BL1(第7図a):階調再現を重視したドツト集
中型マトリクス。閾値の範囲は2〜62の32階調
で出力形態は2ドツト/8×8となる。
BL1 (Figure 7a): Dot concentrated matrix with emphasis on gradation reproduction. The threshold range is 32 gradations from 2 to 62, and the output format is 2 dots/8×8.

BL2(第7図b):階調再現を重視しかつ解像度
も考慮したドツト集中型マトリクスで、閾値は
2〜62の32階調で出力形態は4ドツト/8×8
となる。
BL2 (Fig. 7b): A dot-concentrated matrix that emphasizes gradation reproduction and takes resolution into account, with a threshold of 32 gradations from 2 to 62, and an output format of 4 dots/8 x 8.
becomes.

BL3(第7図c):解像度を考慮し、かつコント
ラストを強調したデイザ処理マトリクス。閾値
は16〜48の17階調で出力形態は4ドツト/8×
8となる。
BL3 (Figure 7c): A dither processing matrix that takes resolution into consideration and emphasizes contrast. The threshold is 17 gradations from 16 to 48, and the output format is 4 dots/8×
It becomes 8.

BL4(第7図d):一定閾値(32)によるマトリ
クス。2値化処理で2階調となる。
BL4 (Fig. 7d): Matrix with constant threshold value (32). The binarization process results in two gradations.

BL5(第7図e):BL3と同じで解像度を考慮
し、かつコントラストを強調したデイザ処理マ
トリクス。閾値は16〜48の17階調で出力形態は
4ドツト/8×8となる。
BL5 (Fig. 7e): Same as BL3, a dither processing matrix that takes resolution into consideration and emphasizes contrast. The threshold value is 17 gradations from 16 to 48, and the output format is 4 dots/8×8.

BL6(第7図f):網点原稿の対象とする小マト
リクスからなるデイザ処理マトリクス。閾値は
20、28、36、44の5階調で出力形態は16ドツ
ト/8×8となる。
BL6 (FIG. 7f): A dither processing matrix consisting of a small matrix targeted for halftone dot originals. The threshold is
The output format is 16 dots/8×8 with 5 gradations of 20, 28, 36, and 44.

BL7(第7図g):モアレ抑圧を目的にBL6の
位相を90°変えたマトリクス。
BL7 (Figure 7g): A matrix in which the phase of BL6 is changed by 90° for the purpose of suppressing moiré.

BL8(第7図h):モアレ抑圧を目的にBL6の
位相を180°変えたマトリクスである。
BL8 (Fig. 7h): This is a matrix in which the phase of BL6 is changed by 180° for the purpose of moire suppression.

上記8種類のマトリクスを画調に応じて使い分
ける事によつて、中間調、文字、網点の再現性に
リアリテイを持たせることが可能となる。
By selectively using the above eight types of matrices according to the image tone, it is possible to provide realistic reproducibility of halftones, characters, and halftone dots.

第8図、第9図はCPUの他の実施例の図であ
る。第1図、第2図に示したCPUはA/D変換
部に隣接CPUからの画像信号を取り込んだが、
この実施例では隣接CPUがA/D変換した画素
濃度を外部バスB0〜B15を介して取り込むの
である。このようにしても、第10図に示された
如きメモリマツプが得られる。
FIGS. 8 and 9 are diagrams of other embodiments of the CPU. The CPUs shown in Figures 1 and 2 input image signals from adjacent CPUs into the A/D conversion section, but
In this embodiment, the pixel density A/D converted by the adjacent CPU is taken in via external buses B0 to B15. Even in this manner, a memory map as shown in FIG. 10 can be obtained.

[効果] 以上説明したように、本発明の画像処理装置に
よれば、注目画素の画像データを、周辺の画素の
画像データを用いて処理する際に、高速にかつ画
質の劣化を抑えて精度良く処理することが可能に
なる。
[Effects] As described above, according to the image processing device of the present invention, when processing image data of a pixel of interest using image data of surrounding pixels, accuracy can be improved at high speed while suppressing deterioration of image quality. This allows for better processing.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明に係わる1実施例のブロツク図
及び各構成の配線を説明した図、第2図は画像処
理手段内のCPUの内部構成を示すブロツク図、
第3図aはCPU内のデータメモリのメモリレイ
アウト及び画像信号の入力及び処理系統を示した
図、第3図bはCPU内の内部レジスタのレイア
ウトを表わした図、第3図cはデータメモリ内で
の画調認識の方法を表わした図、第4図は実施例
の1方法に係わる画像処理の概略を示したフロー
チヤート、第5図aは実施例の画像処理を示した
メインのフローチヤート、第5図b〜jは画像処
理の詳細を示したフローチヤート、第6図a〜d
は基板上の配線方法を示した図、第7図a〜hは
2値化の為の閾値マトリクスの図、第8図〜第9
図はCPU間の他の結合方法を表わした図、第1
0図は他の結合方法により画像情報を入力した場
合の入力系統を表わした図である。 図中、E……センサセル、SH……サンプルホ
ールド回路、CPU……画像処理手段、SR……シ
フトレジスタ、An……画像情報信号、SAR……
逐次近似レジスタ、CR……A/D変換値格納レ
ジスタ、Alu……論理演算部、F/FL……第1
ライン処理フラグ、F/OUT……出力可フラグ
である。
FIG. 1 is a block diagram of one embodiment of the present invention and a diagram explaining the wiring of each component, FIG. 2 is a block diagram showing the internal configuration of the CPU in the image processing means,
Figure 3a shows the memory layout of the data memory in the CPU and the image signal input and processing system, Figure 3b shows the layout of the internal registers in the CPU, and Figure 3c shows the data memory. 4 is a flowchart showing an outline of image processing related to one method of the embodiment, and FIG. 5a is a main flow chart showing the image processing of the embodiment. Chart, Figures 5b-j are flowcharts showing details of image processing, Figures 6a-d
is a diagram showing the wiring method on the board, Figures 7 a to h are diagrams of the threshold matrix for binarization, and Figures 8 to 9
The figure shows another method of coupling between CPUs.
FIG. 0 is a diagram showing an input system when image information is input using another combination method. In the figure, E...sensor cell, SH...sample hold circuit, CPU...image processing means, SR...shift register, An...image information signal, SAR...
Successive approximation register, CR...A/D conversion value storage register, Alu...Logic operation section, F/FL...1st
Line processing flag, F/OUT... Output enabled flag.

Claims (1)

【特許請求の範囲】 1 画素毎の画像データを入力する入力手段と 前記入力手段により入力された画像データのう
ち、第1の領域に含まれる画素位置の画像データ
を処理する第1の処理手段と、 前記入力手段により入力された画像データのう
ち、前記第1の領域に隣接する第2の領域に含ま
れる画素位置の画像データを処理する第2の処理
手段と、 前記第1及び第2の処理手段により処理された
画像データを出力する出力手段とを有した画像処
理装置であつて、 前記第1及び第2の処理手段は、各々第1の領
域、第2の領域に含まれる注目画素の画像データ
を処理する際に、該注目画素の周辺の画像データ
を用いて並列に画像データの処理を行ない、 更に、前記第1の処理手段は、少なくとも前記
第1の領域と前記第2の領域との境界に位置する
注目画素の画像データを処理する際には、前記第
2の処理手段を介して入力されたデータを用いる
ことを特徴とする画像処理装置。
[Scope of Claims] 1. An input means for inputting image data for each pixel; and a first processing means for processing image data at a pixel position included in a first region among the image data input by the input means. and a second processing means for processing image data at pixel positions included in a second region adjacent to the first region among the image data input by the input means; and the first and second processing means. and an output means for outputting image data processed by the processing means, wherein the first and second processing means are arranged to output image data processed by the first and second processing means, respectively. When processing the image data of a pixel, the image data is processed in parallel using image data around the pixel of interest, and further, the first processing means processes at least the first region and the second region. An image processing apparatus characterized in that when processing image data of a pixel of interest located at a boundary with a region, data inputted via the second processing means is used.
JP59262889A 1984-12-14 1984-12-14 Image processing device Granted JPS61141262A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59262889A JPS61141262A (en) 1984-12-14 1984-12-14 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59262889A JPS61141262A (en) 1984-12-14 1984-12-14 Image processing device

Publications (2)

Publication Number Publication Date
JPS61141262A JPS61141262A (en) 1986-06-28
JPH0556062B2 true JPH0556062B2 (en) 1993-08-18

Family

ID=17382024

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59262889A Granted JPS61141262A (en) 1984-12-14 1984-12-14 Image processing device

Country Status (1)

Country Link
JP (1) JPS61141262A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6568439B2 (en) * 2014-11-05 2019-08-28 キヤノン株式会社 Image processing apparatus and control method thereof

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5921171A (en) * 1982-07-28 1984-02-03 Toshiba Corp Original reader

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5921171A (en) * 1982-07-28 1984-02-03 Toshiba Corp Original reader

Also Published As

Publication number Publication date
JPS61141262A (en) 1986-06-28

Similar Documents

Publication Publication Date Title
JPH0558310B2 (en)
EP0238976B1 (en) Method of tint generation and apparatus therefor
US5509090A (en) Three-dimensional measuring apparatus having improved speed and resolution
US4291334A (en) System for detecting the position of an object
CN110225232A (en) Image processing apparatus
US3952290A (en) Read-only optical memory system
JPH0556062B2 (en)
JPH0556063B2 (en)
JPH0376377A (en) Picture processor
JPH0896116A (en) Processor and method for image signal processing
JPS60177779A (en) Solid-state image pickup device
JPS6267960A (en) Drum scanner device
JPS619764A (en) Picture processor
JPS6359629B2 (en)
JPS59108173A (en) Input device of optical character picture
JPH0265463A (en) Shading distortion correction method in picture read processing
JPH01243668A (en) Picture processing device
JPS61131683A (en) Picture processor
JPH01146465A (en) Picture reader
JPH0580870A (en) Image converter
JPH047973A (en) Image reader
JP2000183323A (en) Contact image capture device
JPS60259052A (en) Color picture data input device
JPH0522578A (en) Facsimile device
JPH0496470A (en) Picture processor

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term