JP6681077B2 - Labeling processor - Google Patents
Labeling processor Download PDFInfo
- Publication number
- JP6681077B2 JP6681077B2 JP2017118442A JP2017118442A JP6681077B2 JP 6681077 B2 JP6681077 B2 JP 6681077B2 JP 2017118442 A JP2017118442 A JP 2017118442A JP 2017118442 A JP2017118442 A JP 2017118442A JP 6681077 B2 JP6681077 B2 JP 6681077B2
- Authority
- JP
- Japan
- Prior art keywords
- labeling
- storage unit
- information storage
- label
- labels
- 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.)
- Active
Links
Images
Landscapes
- Image Analysis (AREA)
Description
本発明は、画像データ中の連続する各画素に同一のラベルを付与するラベリング処理装置に関し、特に、処理の高速化と処理回路の低コスト化を可能としたラベリング処理装置に関する。 The present invention relates to a labeling processing device that gives the same label to each successive pixel in image data, and more particularly to a labeling processing device that enables high-speed processing and low cost of a processing circuit.
二値画像中の連結した画素の領域を他の連結した画素の領域と区別するために、各連結領域に異なるラベルを付すラベリング処理が行われる。ラベリング処理を行うことにより、各連結領域について面積や重心等の特徴量を求めることができる。このような画像処理技術は、各種の製造工場における製品の欠陥検査に利用されている。
ラベリング処理の一例としては、注目画素の左上、上、右上、左の画素に付されたラベルを調べる走査マスク(参照範囲、図7等)を設定し、ラスタスキャンにより画像データの左上の画素から順にラベリング処理するものがある。このラベリングアルゴリズムの場合、参照範囲内に複数の異なるラベルが付された画素が存在した場合に、注目画素に付すラベルどのようにするか優先順位を定めておく必要がある。設定された優先順位によっては同一の連結領域内に存在する画素であるにも関わらず異なるラベルが付与される場合があるので、ラベリング処理時にラベル同士の接続関係を示す接続情報を生成する。そして、ラスタスキャン終了後に接続情報を用いてラベルを連結する必要がある(特許文献1)。
監視カメラや製造ライン上での検品にカメラから取り込んだ画像を利用する場合、ラベリング処理を実行する画像処理装置にはリアルタイムでの高速なデータ処理が求められる。特許文献2においては、連結領域の境界周囲長を判定し、所定周囲長以上の領域または所定周囲長以下の連結領域を除去することで、一度のラスタスキャンでラベリング処理を完了できるようにし、リアルタイムでのデータ処理を実現している。
In order to distinguish the area of connected pixels in the binary image from the area of other connected pixels, a labeling process is performed to attach different labels to each connected area. By performing the labeling process, it is possible to obtain the feature amount such as the area and the center of gravity of each connected region. Such image processing technology is used for defect inspection of products in various manufacturing plants.
As an example of the labeling process, a scan mask (reference range, FIG. 7, etc.) for checking the labels attached to the upper left, upper, upper right, and left pixels of the pixel of interest is set, and raster scanning starts from the upper left pixel of the image data. There is a labeling process in order. In the case of this labeling algorithm, when there are a plurality of pixels to which different labels are attached within the reference range, it is necessary to determine the priority order of how to label the pixel of interest. Depending on the set priority order, different labels may be given to pixels that are in the same connected area, so connection information indicating the connection relationship between the labels is generated during the labeling process. Then, it is necessary to connect the labels using the connection information after the raster scan is completed (Patent Document 1).
When utilizing an image captured from a camera for inspection on a surveillance camera or a manufacturing line, an image processing apparatus that executes a labeling process is required to perform high-speed data processing in real time. In
特許文献1に記載の発明によれば、ラベル付けされた連結領域の接続関係を常に更新することで、接続情報を保持するメモリ容量を低く抑えることができ、また特許文献2に記載の発明によれば、一度のラスタスキャンでラベリング処理を完了させることができる。
しかしながら、特許文献1では画素に付与した一次ラベルの番号が最大一次ラベル番号を超える場合には処理終了となる。様々な画像に対応するためには画素に付与できるラベル数を十分に確保する必要があり、そのため、処理結果を保存するRAMのメモリ容量を大きく確保しなければならないという問題点があった。また、特許文献2記載の方法では連結領域の周囲長が所定値以上または所定値以下の領域を除去することでラベリング処理を高速化しているので、処理できる画像の種類に制限があるという問題点があった。
本発明は、上記のような従来のラベリング処理における問題点を解決するものであり、様々な画像のラベリング処理を行うに際し、ラベリング処理を高速に実行することができ、且つ、ラベリングの処理結果を保存するメモリの容量を小さくできるラベリング処理装置を提供することを目的とする。
According to the invention described in
However, in
The present invention is to solve the problems in the conventional labeling processing as described above, when performing the labeling processing of various images, the labeling processing can be executed at high speed, and the labeling processing results can be obtained. An object of the present invention is to provide a labeling processing device capable of reducing the capacity of a memory to be stored.
上記の課題を解決するために、請求項1に記載の発明は、画像データの注目画素に隣接する参照画素に付与されたラベルを参照して、注目画素にラベルを付与するラベリング処理部と、ラベリング処理部によって付与されたラベルに係るラベリング情報を記憶する第一ラベリング情報格納部と、第一ラベリング情報格納部から転送されたラベリング情報を記憶する第二ラベリング情報格納部と、ラベリング処理部によって付与されたラベルに係るラベル数がフラッシュラベル数に到達した場合に、第一ラベリング情報格納部に記憶されているラベリング情報を第二ラベリング情報格納部へ転送させると共に第一ラベリング情報格納部をフラッシュするフラッシュ制御部と、を備えることを特徴とする。
請求項2に記載の発明は、前記ラベリング処理部は、前記第一ラベリング情報格納部がフラッシュされた場合に、フラッシュ前に付与されたラベルと、フラッシュ後に付与されたラベルとの接続関係を示す前処理接続情報を前記第一ラベリング情報格納部に記憶させることを特徴とする。
In order to solve the above-mentioned problem, the invention according to
In the invention according to
請求項3に記載の発明は、前記フラッシュ制御部は、前記ラベリング処理部によって付与されたラベルに係るラベル数が前記画像データのライン途中で前記フラッシュラベル数となった場合に、前記ラベリング処理部による該ラインの処理が終了したときに前記第一ラベリング情報格納部をフラッシュすることを特徴とする。
請求項4に記載の発明は、前記第一ラベリング情報格納部のアクセス速度が、前記第二ラベリング情報格納部のアクセス速度よりも速いことを特徴とする。
請求項5に記載の発明は、前記第一ラベリング情報格納部の記憶容量が、前記第二ラベリング情報格納部の記憶容量よりも少ないことを特徴とする。
According to a third aspect of the present invention, in the flash control unit, when the label number related to the label given by the labeling processing unit becomes the flash label number in the middle of the line of the image data, the labeling processing unit. The first labeling information storage unit is flushed when the processing of the line is completed.
The invention according to
The invention according to
請求項6に記載の発明は、前記フラッシュラベル数は、該フラッシュラベル数に対応したラベリング情報に係る記憶容量と、前記ラベリング処理部によって付与されたラベルの個数がライン途中で前記フラッシュラベル数となった後、該ラインの残部について新規に付与されるラベル数の予測値に対応したラベリング情報に係る記憶容量と、を加算した容量が、前記第一ラベリング情報格納部の記憶容量を越えないように設定されることを特徴とする。
請求項7に記載の発明は、前記ラベリング処理部は、ラベリング処理結果として、ラベル同士の接続関係を表す接続情報と、ラベルを付与された画素の数及び存在範囲をラベル毎に示す付加情報とを生成して前記第一ラベリング情報格納部に記憶させ、前記画像データ中の各画素と該各画素に付与されたラベルとの対応関係を示す画素・ラベル情報を生成して前記第二ラベリング情報格納部に記憶させることを特徴とする。
In the invention according to
In the invention according to
本発明によれば、様々な画像のラベリング処理を行うに際し、ラベリング処理を高速に実行することができ、且つ、ラベリングの処理結果を保存するメモリの容量を小さくできる。 According to the present invention, when performing labeling processing of various images, the labeling processing can be executed at high speed, and the capacity of the memory for storing the labeling processing result can be reduced.
以下、本発明を図に示した実施形態を用いて詳細に説明する。但し、この実施形態に記載される構成要素、種類、組み合わせ、形状、その相対配置などは特定的な記載がない限り、この発明の範囲をそれのみに限定する主旨ではなく単なる説明例に過ぎない。 Hereinafter, the present invention will be described in detail with reference to the embodiments shown in the drawings. However, the constituent elements, types, combinations, shapes, relative arrangements, and the like described in this embodiment are merely explanatory examples, not the gist of limiting the scope of the present invention thereto, unless specifically stated. .
〔ハードウェア構成〕
図1は、本発明の一実施形態に係る画像処理装置のハードウェア構成図である。
画像処理装置(ラベリング処理装置)1は、CPU(Central Processing Unit)11、ラベリング演算処理部13、メモリ15、及びI/F部16を備える。
CPU11はレジスタ12を有しており、画像処理装置1の全体を制御する。
ラベリング演算処理部13は、CPU11の命令に従ってラベリングに係わる各種の処理を実行する集積回路(IC:Integrated Circuit)である。ラベリング演算処理部13は、入力された画像データの連結画素領域に仮のラベル(インデックス)を付与する。ラベリング演算処理部13は、記憶手段として例えば揮発性記憶手段であるSRAM(Static Random Access Memory)14を備えており、ラベリング処理により得られるラベリング情報をSRAM14に一時的に格納する。
メモリ15は、ラベリング演算処理部13に設けた記憶手段(SRAM14)よりも大きな記憶容量を有するがアクセス速度が比較的低速の記憶手段である。メモリ15は、例えばDRAM(Dynamic Random Access Memory)等の揮発性記憶手段から構成される。
I/F部16は、外部装置と接続するインターフェースである。I/F部16には、処理対象となる画像データを供給する監視カメラや、ラベリング演算処理部13によって処理された画像データを処理する他の装置等が接続される。
[Hardware configuration]
FIG. 1 is a hardware configuration diagram of an image processing apparatus according to an embodiment of the present invention.
The image processing apparatus (labeling processing apparatus) 1 includes a CPU (Central Processing Unit) 11, a labeling
The
The labeling
The
The I /
〔ラベリング演算処理部の概略構成〕
図2は、本発明の一実施形態に係るラベリング演算処理部の概略構成を示す機能ブロック図である。
ラベリング演算処理部13は、二値化処理部17と、ノイズ除去部18と、ラベリング処理部20とを備える。
二値化処理部17は、外部装置である監視カメラ等から入力されたビデオ信号(多値の画像データ)を二値化する処理を実行する。ノイズ除去部18は、二値化された画像データに対する平滑化処理等を行って画像データからノイズを除去する。ラベリング処理部20は、ノイズ除去後の画像データ中の各画素の連結成分に同一のラベル(インデックス)を仮付与し、ラベリング処理の結果を出力する。
[Schematic Configuration of Labeling Arithmetic Processing Unit]
FIG. 2 is a functional block diagram showing a schematic configuration of the labeling calculation processing unit according to the embodiment of the present invention.
The labeling
The
〔機能構成〕
図3は、本発明の一実施形態に係る画像処理装置のラベリング機能に係る構成を示した機能ブロック図である。
画像処理装置1は、制御部19、ラベリング演算処理部13、第二ラベリング情報格納部50、及びラベル連結処理部60を備える。
[Functional configuration]
FIG. 3 is a functional block diagram showing the configuration related to the labeling function of the image processing apparatus according to the embodiment of the present invention.
The
制御部19は、図1に示すCPU11により実現され、ラベリング演算処理部13に対してラベリング処理の開始を命令する制御信号や、ラベル数の設定値等を出力する。
ラベリング演算処理部13は、ラベリング処理部20、第一ラベリング情報格納部30、及びフラッシュ制御部40を備える。ラベリング処理部20は、図2に示すノイズ除去部18から入力されたノイズ除去後の二値画像データ中の各画素に対して仮のラベルを付与するラベリング処理を実行する。
ラベリング処理部20は、画像データの注目画素に隣接する参照画素に付与されたラベルを参照して、注目画素にラベルを付与する処理を実行する。ラベリング処理部20は、現ライン処理部21と1ライン前処理結果保持部22とを有する。
現ライン処理部21は、注目画素と、注目画素の周囲に位置する他の画素との接続関係を検出する。より詳しくは、現ライン処理部21は、画像データ中の注目画素に対して4連結(4近傍)又は8連結(8近傍)に位置する画素と同一のインデックス(ラベル)を付与するラベリング処理を実行する。現ライン処理部21は、ラベリング処理の結果として、ラベル同士の接続関係を表す接続情報と、ラベルを付与された画素の数及び存在範囲をラベル毎に示す付加情報とを含むラベリング情報を生成して第一ラベリング情報格納部30に記憶させる。また、現ライン処理部21は、ラベリング処理の結果として、画像データ中の各画素と各画素に付与されたラベルとの対応関係を示す画素・ラベル情報を生成して第二ラベリング情報格納部50に記憶させる。
1ライン前処理結果保持部22は、現ライン処理部21によるラベリング処理の結果生成される画素・ラベル情報を1ライン分保持する手段である。画素・ラベル情報は、どの画素に対してどのラベルが付与されているかを示す情報である。1ライン前処理結果保持部22はラインバッファにより構成されており、ラインバッファの各画素に対応する領域には夫々複数ビットが割り当てられている。各画素には、割り当てられたビット数を上限として順次ラベルを付与することが可能である。
The
The labeling
The
The current
The one-line pre-processing
第一ラベリング情報格納部30は、図1にSRAM14として示されているように、高速アクセスが可能な記憶手段により構成される。第一ラベリング情報格納部30は、ラベリング処理部20によって付与されたラベルに係るラベリング情報を記憶する。ラベリング処理部20が生成するラベリング情報は、接続情報と付加情報とを含む。なお、接続情報と付加情報の詳細については後述する。第一ラベリング情報格納部30は、ラベリング処理部20によって付与されたラベルが所定数となる度にフラッシュ(初期化)される。そのため、第一ラベリング情報格納部30は、接続情報(図4)を格納する手段として、現在処理接続情報格納部31と前処理接続情報格納部32とを有する。現在処理接続情報格納部31は、現在のラベリング処理において付与されるラベル同士の接続関係を示す接続情報を格納する。前処理接続情報格納部32は、現在のラベリング処理において付与されるラベルと、前回のラベリング処理(第一ラベリング情報格納部30をフラッシュする直前のラベリング処理)において付与されたラベルとの接続関係を示す接続情報を格納する。また、第一ラベリング情報格納部30は付加情報(図5)を格納する手段として、第一付加情報格納部33を有する。
The first labeling
フラッシュ制御部40は、現ライン処理部21が付与したラベル数が所定のラベル数(フラッシュラベル数)に到達した場合に、第一ラベリング情報格納部30に記憶されているラベリング情報を第二ラベリング情報格納部50へ転送させると共に、第一ラベリング情報格納部30をフラッシュする処理を実行する。フラッシュ制御部40は、ラベル数判定部41とコントローラ42を備える。
ラベル数判定部41は、現ライン処理部21が付与したラベル数を入力し、ラベル数が所定のフラッシュラベル数に達した場合にコントローラ42に対して第一ラベリング情報格納部30をフラッシュするフラッシュ要求を出力する。フラッシュ要求の基準となるフラッシュラベル数は、制御部19がラベル数判定部41に対して設定する。制御部19はフラッシュラベル数を、第一ラベリング情報格納部30の記憶容量に基づいて設定してもよいし、図1に示すI/F部16を介して外部から入力された数値に基づいて設定してもよい。
ここで、接続情報及び付加情報の記憶には、ラベリング処理部が付与したラベル数に応じた容量が必要である。制御部19は、第一ラベリング情報格納部30に格納可能なラベリング情報の最大ラベル数よりも少ないラベル数をフラッシュラベル数としてラベル数判定部41に設定する。
When the number of labels provided by the current
The label number determination unit 41 inputs the number of labels assigned by the current
Here, the storage of the connection information and the additional information requires a capacity corresponding to the number of labels given by the labeling processing unit. The
コントローラ42は、ラベル数判定部41からフラッシュ要求を入力した場合に、第一ラベリング情報格納部30の各部に記憶されているラベリング情報を読み出して、第二ラベリング情報格納部50の対応する各部に転送する。また、コントローラ42は、第一ラベリング情報格納部30に順次ゼロを書き込むことにより、第一ラベリング情報格納部30のデータをクリア(フラッシュ)する。
When the flush request is input from the label number determination unit 41, the
第二ラベリング情報格納部50は、図1に示すメモリ15により実現される。第二ラベリング情報格納部50は、第一ラベリング情報格納部40から転送されたラベリング情報を記憶する。即ち、第二ラベリング情報格納部50は、第一ラベリング情報格納部30をフラッシュする前、及び一のフレーム画像についてのラベリング処理終了後に、第一ラベリング情報格納部30から読み出された接続情報及び付加情報を格納、蓄積する手段である。
具体的には、第二ラベリング情報格納部50は、第一ラベリング情報格納部30の現在処理接続情報格納部31及び前処理接続情報格納部32から読み出された各接続情報を格納する全接続情報格納部51と、第一付加情報格納部33から読み出された付加情報を格納する第二付加情報格納部52とを備える。また、第二ラベリング情報格納部50は、ラベリング処理部20から出力された画素・ラベル情報を保持する画素・ラベル情報保持部53を備える。第二ラベリング情報格納部50は、第一ラベリング情報格納部30に比べてアクセス速度は低速であるが、第一ラベリング情報格納部30よりも安価、且つ大容量の記憶手段により構成される。例えば、第一ラベリング情報格納部30をSRAMから構成し、第二ラベリング情報格納部50をDRAMから構成することができる。
第一ラベリング情報格納部30に加えて第二ラベリング情報格納部50を設けることにより、1フレームの画像データから生成されるラベリング情報の格納に必要な記憶容量を確保しつつ、現ライン処理部21が生成するラベリング情報をリアルタイムで高速に記憶する第一ラベリング情報格納部30の容量を小さくすることができ、画像処理装置1を低コスト化することができる。
The second labeling
Specifically, the second labeling
By providing the second labeling
ラベル連結処理部60は、第二ラベリング情報格納部50に格納された全ての接続情報、付加情報、及び画素・ラベル情報からラベル連結処理を行う手段である。ラベル連結処理部60は、異なるラベルが付与された画素同士が連結している場合に、一の連結領域を構成する各画素に同一のラベルを振り直す処理を実行する。なお、ラベル連結処理部60が利用するラベル連結アルゴリズムには特に制限はない。ラベル連結処理部60は、バスを介してCPU11と接続する回路でもよいし、I/F部16を介して接続する外部装置でもよい。
The label
〔接続情報〕
図4は、接続情報の一例を示す図である。
接続情報は、ラベル同士の接続関係を示す情報である。異なるラベル同士が接続している場合、当該ラベルの付された複数の画素は一つの連結領域を形成する。縦軸と横軸の数字1〜16は、ラベルを表している。図示する例では、縦軸が注目画素のラベルを表しており、横軸が参照画素のラベルを表している。図示した例は、接続情報の初期状態を示しており、接続情報が発生しない、すなわち、注目画素のラベルと参照画素のラベルが同一である部分にのみ着色している。
[Connection information]
FIG. 4 is a diagram showing an example of connection information.
The connection information is information indicating the connection relationship between the labels. When different labels are connected to each other, a plurality of pixels with the labels form one connection region. The
〔付加情報〕
図5は、付加情報の一例を示す図である。付加情報は、あるラベルの付された画素の集合が画像データ中のどの範囲にどの程度の大きさで存在するかを示す情報であり、テーブルの形式にて表現される。付加情報は、第一ラベリング情報格納部30がフラッシュされる毎に新規に作成される。各タイトルの意味は、以下の通りである。
ID:フラッシュ毎に作成される夫々の付加情報を識別する識別情報。例えば、ラベリング処理の開始時にID「0」が付与された場合、IDは第一ラベリング情報格納部30がフラッシュされる毎にカウントアップされる。
domain:IDに対応する付加情報が示す画像データの範囲を示す情報。第一ラベリング情報格納部30のフラッシュが画像データのライン単位で実行される場合は、画像データの処理ラインを特定する情報となる。
index:ラベリング処理によって付与されたラベル。
area:indexに示されるラベルが付与された画素数。
Xmin:indexに示されるラベルが付与された画素領域のX座標最小値。
Ymin:indexに示されるラベルが付与された画素領域のY座標最小値。
Xmax:indexに示されるラベルが付与された画素領域のX座標最大値。
Ymax:indexに示されるラベルが付与された画素領域のY座標最大値。
〔Additional information〕
FIG. 5 is a diagram showing an example of additional information. The additional information is information indicating in what range and in what size a set of pixels with a certain label exists in the image data, and is represented in a table format. The additional information is newly created every time the first labeling
ID: identification information for identifying each additional information created for each flash. For example, when the ID “0” is added at the start of the labeling process, the ID is incremented every time the first labeling
domain: information indicating the range of image data indicated by the additional information corresponding to the ID. When the flashing of the first labeling
index: A label given by the labeling process.
area: The number of pixels to which the label shown in the index is attached.
Xmin: X coordinate minimum value of the pixel area to which the label shown in index is attached.
Ymin: Y coordinate minimum value of the pixel area to which the label shown in index is attached.
Xmax: The maximum X coordinate value of the pixel area to which the label shown in index is attached.
Ymax: The maximum Y coordinate value of the pixel area to which the label shown in index is attached.
〔画像例〕
図6は、ラベリング処理の対象となる二値画像データの一例を示す図である。本図においては、各画素のX方向、Y方向における位置を把握しやすくするため、各画素間に罫線を記載している。ラベリング処理部20は、このような1フレームの画像の左上から図中右方向に処理対象である注目画素を移動しながら注目画素に対してラベルを付与する。
[Image example]
FIG. 6 is a diagram showing an example of the binary image data that is the target of the labeling process. In this figure, ruled lines are shown between the pixels in order to facilitate understanding of the positions of the pixels in the X and Y directions. The
〔走査マスク〕
図7は、ラベリング処理に用いる走査マスクの一例を示す図である。
この走査マスク70は、所謂8連結(8近傍)用の走査マスクであり、ラベリング処理部20(図3)が注目画素71の左上、上、右上、左に位置する4つの参照画素72a〜72dに付されたラベルを参照して、注目画素71に対してラベルを付与することを示している。以下では、参照画素72a〜72dをまとめて「参照範囲」と表現することがある。なお、各参照画素72a〜72dに付された数字1〜4は、走査マスク70内にラベルが割り当てられた複数の画素が存在する場合に、注目画素71に割り当てるラベルの優先順位を示している。
[Scan mask]
FIG. 7 is a diagram showing an example of a scanning mask used in the labeling process.
The
〔基本的なラベリング処理の手順〕
以下、ラベリング処理について図3を参照して説明する。
図6に示すような1フレーム分の二値画像データは、1画素ずつラベリング処理部20の現ライン処理部21に供給される。現ライン処理部21は、走査マスク70(図7)中の参照画素72a〜72dに付されたラベルを参照して注目画素71に対して順次ラベルを付与する処理を実行する。
[Basic labeling procedure]
The labeling process will be described below with reference to FIG.
Binary image data for one frame as shown in FIG. 6 is supplied to the current
図8は、ラベリング処理の一例を示す図であり、(a)は処理画像を示す図であり、(b)は付加情報を示す図であり、(c)は接続情報を示す図である。本図において、グレーの画素は処理済みの画素を示している。白抜き及び黒ベタの画素は未処理の画素を示しており、そのうち白抜きの画素はラベルを付すべき画素を示している。また、図中の右向き矢印は処理の方向を示している。また、本図は第6ラインの途中までラベリング処理が行われた状態を示している。
走査マスク70内には既にラベル「2」「3」の付された画素が存在するが、走査マスク70が参照する画素の優先順位(図5)により注目画素71にはラベル「3」が付与される。
1ライン前処理結果保持部22には、破線で示すように、注目画素の2つ前の画素から1ライン分の画素・ラベル情報が保持されており、現ライン処理部21はラベリング処理時に、1ライン前処理結果保持部22から処理中のラインの1ライン前に位置する参照画素の画素・ラベル情報を読み出して参照する。
現ライン処理部21は、注目画素71の直前に処理された画素の画素・ラベル情報を保持するレジスタを有しており、注目画素71のラベリング処理時にこれを参照する。現ライン処理部21は、注目画素71に対してラベリング処理を行った後に、注目画素71の直前に位置する画素の画素・ラベル情報を1ライン前処理結果保持部22と第二ラベリング情報格納部50の画素・ラベル情報保持部53に記憶させる。
なお、現ライン処理部21は1ラインの処理終了時にレジスタ中の画素・ラベル情報を1ライン前処理結果保持部22と画素・ラベル情報保持部53に記憶させ、レジスタをクリアする。
FIG. 8 is a diagram showing an example of the labeling process, (a) is a diagram showing a processed image, (b) is a diagram showing additional information, and (c) is a diagram showing connection information. In the figure, the gray pixels indicate processed pixels. White and black solid pixels indicate unprocessed pixels, and white pixels among them indicate pixels to be labeled. Further, the arrow pointing to the right in the figure indicates the direction of processing. Further, this figure shows a state in which the labeling process is performed up to the middle of the sixth line.
Pixels with the labels “2” and “3” already exist in the
As indicated by the broken line, the 1-line pre-processing
The current
The current
<付加情報>
現ライン処理部21は、1ラインの処理開始時に付加情報(図8(b))の「domain」を更新する処理を実行する。また、現ライン処理部21は、注目画素に対してラベルを付与した場合に、付加情報を更新する処理を実行する。具体的には、現ライン処理部21は、第一ラベリング情報格納部30の第一付加情報格納部33に記憶されている付加情報を読み出して、「domain」或いは注目画素に付与したラベルに係る情報を変更した付加情報を生成し、第一付加情報格納部33に書き込む処理を実行する。
図8(b)に示されている付加情報は、第7ライン14画素目のラベリング処理が終了した後において、以下のような状態であることを示している。
(1)index1が付された画素は12個存在し、それらのX軸最小値は1、Y軸最小値は2、X軸最大値は4、Y軸最大値は5である。
(2)index2が付された画素は3個存在し、それらのX軸最小値は14、Y軸最小値は5、X軸最大値は16、Y軸最大値は5である。
(3)index3が付された画素は2個存在し、それらのX軸最小値は12、Y軸最小値は6、X軸最大値は13、Y軸最大値は6である。
<Additional information>
The current
The additional information shown in FIG. 8B indicates the following state after the labeling process of the 14th pixel of the 7th line is completed.
(1) There are 12 pixels to which index1 is added, and the X axis minimum value is 1, the Y axis minimum value is 2, the X axis maximum value is 4, and the Y axis maximum value is 5.
(2) There are three pixels to which index2 is added, and the X axis minimum value is 14, the Y axis minimum value is 5, the X axis maximum value is 16, and the Y axis maximum value is 5.
(3) There are two pixels to which index3 is added, and the X axis minimum value is 12, the Y axis minimum value is 6, the X axis maximum value is 13, and the Y axis maximum value is 6.
<接続情報>
現ライン処理部21は、新規なラベルを付与した場合、又は異なるラベル間の新規な接続関係を検出した場合に、接続情報(図8(c))を更新する処理を実行する。具体的には、現ライン処理部21は、現在処理接続情報格納部31に記憶されている接続情報を読み出して、注目画素に付与したラベルと接続するラベルに係る情報を変更した接続情報を生成し、現在処理接続情報格納部31に書き込む処理を実行する。
図8(c)の接続情報は、縦軸が注目画素を示し、横軸が注目画素と接続する参照画素の情報を示している。図8(a)に示すように第6ライン第13画素が注目画素であるとき、注目画素にはラベル「3」が付与されるが、参照範囲内にはラベル「2」の付された画素も存在するので、接続情報にはラベル「3」とラベル「2」の画素が接続している旨の情報が追加される。具体的には、ラベリング処理部20は、図8(c)に示す接続情報について、第3行第2列(★印)部分の情報を追加する。
<Connection information>
The current
In the connection information of FIG. 8C, the vertical axis shows the target pixel and the horizontal axis shows the information of the reference pixel connected to the target pixel. As shown in FIG. 8A, when the 13th pixel on the 6th line is the target pixel, the target pixel is given the label “3”, but the pixel with the label “2” is added within the reference range. Since there is also, the information indicating that the pixels having the label “3” and the pixel having the label “2” are connected is added to the connection information. Specifically, the
〔フラッシュ処理〕
以下、第一ラベリング情報格納部30のフラッシュについて、フラッシュラベル数が4である場合の例により説明する。
図9は、ラベリング処理を説明する図であり、(a)は処理画像を示す図であり、(b)は付加情報を示す図であり、(c)は現在処理接続情報を示す図であり、(d)は前処理接続情報を示す図である。図9は、第7ラインのラベリング処理を終了した状態を示している。
[Flash processing]
Hereinafter, the flash of the first labeling
9A and 9B are diagrams for explaining the labeling process, FIG. 9A is a diagram showing a processed image, FIG. 9B is a diagram showing additional information, and FIG. 9C is a diagram showing current processing connection information. , (D) are diagrams showing preprocessing connection information. FIG. 9 shows a state in which the labeling process for the seventh line has been completed.
第一ラベリング情報格納部30は、現ライン処理部21が付与したラベルがフラッシュラベル数に到達した場合にフラッシュされる。
本例においてコントローラ42は、現ライン処理部21によって付与されたラベルに係るラベル数が画像データのライン途中でフラッシュラベル数となり、且つ現ライン処理部21による処理中のラインのラベリング処理が終了した場合に、第一ラベリング情報格納部30をフラッシュするように制御する。
The first labeling
In this example, the
フラッシュ処理における具体的な制御手順は以下の通りである。
現ライン処理部21は、注目画素に対して新規にラベルを付与した場合に、現在処理において付与したラベル数の情報をラベル数判定部41に出力する。例えば、現ライン処理部21は、第7ライン第10画素に対して新規にラベル「4」を付与した場合、使用ラベル数「4」をラベル数判定部41に通知する。ラベル数判定部41は、使用ラベル数がフラッシュラベル数に到達したか否かを判定しており、使用ラベル数がフラッシュラベル数に到達した場合にコントローラ42に対してフラッシュ要求を出力する。
現ライン処理部21は、コントローラ42に対して、1ラインの処理が終了する毎にその旨を示すライン処理終了通知を出力する。
コントローラ42は、ラベル数判定部41からのフラッシュ要求を受け付け、且つ現ライン処理部21からライン処理終了通知を受け付けた場合に、ラベリング情報を第一ラベリング情報格納部30から第二ラベリング情報格納部50に転送する。即ち、コントローラ42は、現在処理接続情報格納部31に格納されている現在処理接続情報と、前処理接続情報格納部32に格納されている前処理接続情報とを読み出して、第二ラベリング情報格納部50の全接続情報格納部51に記憶させる処理を実行する。また、コントローラ42は、第一付加情報格納部33に格納されている付加情報を読み出して、第二ラベリング情報格納部50の第二付加情報格納部52に記憶させる処理を実行する。
その後、コントローラ42は、第一ラベリング情報格納部30をフラッシュする処理を実行する。
更にコントローラ42は、現ライン処理部21に対してラベルの初期化を命令する。
The specific control procedure in the flash process is as follows.
The current
The current
When the
After that, the
Further, the
〔フラッシュ後のラベリング処理〕
図10は、フラッシュ後のラベリング処理を説明する図であり、(a)は処理画像を示す図であり、(b)は付加情報を示す図であり、(c)は現在処理接続情報を示す図であり、(d)は前処理接続情報を示す図である。図10は、第8ラインの途中までラベリング処理が行われた状態を示している。
現ライン処理部21は第一ラベリング情報格納部30がフラッシュされた後、コントローラ42からのラベル初期化命令に従って、画素に付与するラベルを初期化する。即ち、現ライン処理部21は、フラッシュ後に、最初に検知されたラベルの付与対象となる注目画素に対してラベル「1」を付与する。現ライン処理部21は、前処理における付加情報のIDをカウントアップした付加情報を生成して、第一付加情報格納部に記憶させる。このとき、現ライン処理部21は、処理ラインを示す「domain」にフラッシュ後の処理ラインに係る情報を与える。
現ライン処理部21は、新規なラベルを付与した場合、又はフラッシュ後に処理したライン中で異なるラベル間の新規な接続関係を検出した場合に、現在処理接続情報(図10(c))を更新して、現在処理接続情報格納部31に記憶させる。
現ライン処理部21は、フラッシュ前に処理されたライン中のラベルと、フラッシュ後に処理したライン中のラベルとの間に接続関係を検出した場合に、前処理接続情報(図10(d))を更新して、前処理接続情報格納部32に記憶させる。
[Labeling after flash]
FIG. 10 is a diagram for explaining the labeling process after flushing, (a) is a diagram showing a processed image, (b) is a diagram showing additional information, and (c) is current processing connection information. It is a figure and (d) is a figure which shows pre-processing connection information. FIG. 10 shows a state where the labeling process has been performed up to the middle of the eighth line.
After the first labeling
The current
When the current
図11は、現ライン処理部によるラベリング処理が完了した後の処理画像の一例を示す図である。本図は、最終的に第二ラベリング情報格納部50の画素・ラベル情報保持部53に記憶される情報を示している。
現ライン処理部21は、コントローラ42に対して1フレームの画像データの処理(図では第23ライン第23画素の処理)が終了したときにフレーム処理終了通知を出力する。
コントローラ42は、現ライン処理部21からのフレーム処理終了通知を受けて、第一ラベリング情報格納部30に記憶されている全ての情報を第二ラベリング情報格納部50へ転送する処理と、第一ラベリング情報格納部30をフラッシュする処理を実行する。
FIG. 11 is a diagram showing an example of a processed image after the labeling process by the current line processing unit is completed. This figure shows the information finally stored in the pixel / label
The current
The
図12(a)〜(c)は、第二ラベリング情報格納部の全接続情報格納部と付加情報格納部に格納されるデータの一例を示す図である。本図は、1フレームの画像についてラベリング処理が完了した場合に第二ラベリング情報格納部に格納される情報を示しており、(a)はID0のラベリング情報を、(b)はID1のラベリング情報を、(c)はID2のラベリング情報を示している。夫々のラベリング情報は、付加情報と現在処理接続情報と前処理接続情報を含んでいる。 12A to 12C are diagrams showing an example of data stored in the all connection information storage unit and the additional information storage unit of the second labeling information storage unit. This figure shows the information stored in the second labeling information storage unit when the labeling process is completed for one frame image. (A) shows the labeling information of ID0, (b) shows the labeling information of ID1. (C) shows the labeling information of ID2. Each piece of labeling information includes additional information, current processing connection information, and preprocessing connection information.
図13は、第二ラベリング情報格納部のアドレスマップの概要を示す図である。本図には、全接続情報格納部51と第二付加情報格納部52に係るアドレスマップのみを示している。第二ラベリング情報格納部50には、ID毎に順次ラベリング情報(図12(a)〜(c))を格納する格納領域54a〜54cが形成される。夫々のラベリング情報の格納領域は、付加情報を格納する付加情報格納領域55、現在処理接続情報を格納する現在処理接続情報格納領域56、及び前処理接続情報を格納する前処理接続情報格納領域57を備えている。
FIG. 13 is a diagram showing an outline of the address map of the second labeling information storage unit. In this figure, only the address maps relating to the all connection
〔ラベル連結処理〕
ラベル連結処理部60(図3)は、第二ラベリング情報格納部50の画素・ラベル情報保持部53に記憶された画素・ラベル情報(図11)と、全接続情報格納部51に記憶された接続情報(図12)とを用いてラベルを連結する処理を実行する。
ラベル連結処理部60は、第二ラベリング情報格納部50の画素・ラベル情報保持部53中の画素・ラベル情報(図11)を第0ラインから順次確認していき、ラベルを連結する。
まず、ラベル連結処理部60は、第二ラベリング情報格納部50の全接続情報格納部51に記憶されているID「0」(図12(a))の現在処理接続情報を用いてラベル連結処理を実行する。ラベル連結処理部60は、現在処理接続情報に基づいて、ラベル(index)「2」がラベル「3」及び「4」と接続していると判定し、ラベル「3」、「4」が割り振られた画素のラベルを全て「2」に変更する。なお、ラベル連結処理部60は、ラベル「4」がラベル「2」に変更された旨の情報を一時的に記憶しておく。
[Label connection processing]
The label concatenation processing unit 60 (FIG. 3) stores the pixel / label information (FIG. 11) stored in the pixel / label
The label
First, the label
次に、ラベル連結処理部60は、ID「1」(図12(b))の現在処理接続情報及び前処理接続情報を用いてラベル連結処理を実行する。
前処理接続情報にはラベル「1」が前処理におけるラベル「4」と接続している情報が含まれており、ラベル連結処理部60はID「0」のラベル連結処理においてラベル「4」がラベル「2」に変更された旨の情報を記憶しているので、ラベル連結処理部60はID「1」におけるラベル「1」をラベル「2」に変更する。
ラベル連結処理部60は、他のラベルと接続していない独立したラベル「2」、「3」、「4」を、最小の未使用ラベルから順にそれぞれラベル「3」、「4」、「5」に振り直す。また、ラベル連結処理部60は、ID「1」のラベル「1」〜「4」が、それぞれラベル「2」〜「5」に変更された旨の情報を一時的に記憶する。
Next, the label
The preprocessing connection information includes the information that the label “1” is connected to the label “4” in the preprocessing, and the label
The label
最後に、ラベル連結処理部60は、ID「2」(図12(c))の現在処理接続情報及び前処理接続情報を用いて上記と同様にラベル連結処理を実行する。
図14は、ラベル連結処理後の処理画像の一例を示す図である。最終的には、図14に示すようなラベル連結画像が得られる。
Finally, the label
FIG. 14 is a diagram showing an example of a processed image after the label connecting process. Finally, the label connected image as shown in FIG. 14 is obtained.
〔変形例等〕
本実施形態において、ラベル数判定部41には、第一ラベリング情報格納部30に格納可能なラベリング情報の最大ラベル数よりも少ない数をフラッシュラベル数として設定する。具体的には以下のように設定される。即ち、フラッシュラベル数は、このフラッシュラベル数に対応したラベリング情報の格納に必要な記憶容量と、現ライン処理部21によって付与されたラベルの個数がライン途中でフラッシュラベル数となった後、このラインの残部について新規に付与されるラベル数の予測値に対応したラベリング情報の格納に必要な記憶容量と、を加算した容量が、第一ラベリング情報格納部30の記憶容量を越えないように設定される。仮に、1ラインの処理中に現ライン処理部21の付与したラベル数がフラッシュラベル数を超えたとしても、第一ラベリング情報格納部30には、1ラインの処理が終了するまで最大ラベル数の範囲内でラベリング情報を順次格納することができる。
[Modifications, etc.]
In the present embodiment, the label number determination unit 41 sets the number smaller than the maximum label number of the labeling information that can be stored in the first labeling
本実施形態においては、第一ラベリング情報格納部30のフラッシュを1ラインの処理終了後に実行するが、ライン途中でフラッシュする構成としてもよい。この場合、ラベル数判定部41には、第一ラベリング情報格納部30に格納可能なラベリング情報の最大ラベル数をフラッシュラベル数として設定することができる。付加情報(図5)の「domain」は、フラッシュ処理によって区切られる領域の始点画素と終点画素の情報となる。コントローラ42は、ラベリング処理部20の付与したラベル数がフラッシュラベル数となり、且つそのラベルの付された画素が連続しなくなったときに、第一ラベリング情報格納部30をフラッシュするように制御する。
In the present embodiment, the flushing of the first labeling
上記実施形態においては、小容量であるがアクセス速度が高速な記憶手段としてSRAMを、大容量であるがアクセス速度が低速な記憶手段(メモリ)としてDRAMを例に挙げて説明したが、本発明において第一ラベリング情報格納部30と第二ラベリング情報格納部50に利用する記憶手段をこれに限定するものではない。
例えば、第一ラベリング情報格納部30にはSRAM以外の高速応答性の高い記憶手段として、フリップフロップ回路を用いることができる。第二ラベリング情報格納部50としてDRAM以外に、フラッシュメモリやHDD(Hard Disk Drive)を用いることもできる。また、第二ラベリング情報格納部50はI/F部16を介して接続された外部メモリ(外部記憶装置)としてもよい。
上記実施形態において、SRAMやDRAMを説明するに際し、アクセス速度と容量との関係を規定しているが、一般的にアクセス速度が高速な記憶装置は高価であるため、装置を安価に提供するためには小容量のものを用いるのが好ましく、一方、アクセス速度が低速な記憶装置は大容量であるにも関わらず安価であることが多いという前提に基づいて記載しているに過ぎず、本発明を何ら限定するものではない。
In the above embodiments, the SRAM has been described as an example of a storage unit having a small capacity but a high access speed, and the DRAM has been described as an example of a storage unit (memory) having a large capacity but a low access speed. In the above, the storage means used for the first labeling
For example, a flip-flop circuit can be used in the first labeling
In the above embodiment, the relation between the access speed and the capacity is defined when describing the SRAM or the DRAM. However, since a storage device having a high access speed is generally expensive, the device is provided at low cost. It is preferable to use a small-capacity storage device, while the storage device with a low access speed is often described as an inexpensive storage device despite its large storage capacity. It does not limit the invention in any way.
本実施形態においては、第一ラベリング情報格納部30のフラッシュ時に、現ライン処理部21が付与するラベルも初期化したが、現ライン処理部21はフラッシュ後もフラッシュ前に付与したラベルに連続するラベルを付与してもよい。つまり、現ライン処理部21は、フラッシュが実行されたか否かに関わらず、ラベルをカウントアップして付与してもよい。
In the present embodiment, when the first labeling
〔ラベリング処理装置の使用用途〕
本実施形態に係る画像処理装置(ラベリング処理装置)は、製造ラインにおける欠陥検査装置、物体の追跡処理を行うための監視カメラ装置、医療分野における検査装置(例えば眼科の検査装置)等に組み込むことができる。画像データに対してラベリング処理を行うことで入力画像中に存在する連結領域を特定し、特定された連結領域の面積や重心を求めることができ、種々の検査等に利用できる。
なお、連結領域の存在エリアや連結領域の大きさ(連結領域を構成する画素の個数)がわかれば十分であるような場合には、主として付加情報を利用することができ、ラベル連結処理は必要とされない場合もあり得る。
[Usage of labeling equipment]
The image processing apparatus (labeling processing apparatus) according to the present embodiment is incorporated into a defect inspection apparatus in a manufacturing line, a surveillance camera apparatus for performing object tracking processing, an inspection apparatus in the medical field (for example, an ophthalmic inspection apparatus), and the like. You can By performing a labeling process on the image data, it is possible to specify the connected area existing in the input image, obtain the area and the center of gravity of the specified connected area, and use the method for various inspections.
If it is sufficient to know the existing area of the connected area and the size of the connected area (the number of pixels forming the connected area), the additional information can be mainly used and the label connecting process is necessary. It may not be done.
〔本発明の実施態様例と作用、効果のまとめ〕
<第一の実施態様>
本態様に係るラベリング処理装置(画像処理装置1)は、画像データの注目画素に隣接する参照画素に付与されたラベルを参照して、注目画素にラベルを付与するラベリング処理部20と、ラベリング処理部によって付与されたラベルに係るラベリング情報を記憶する第一ラベリング情報格納部30と、第一ラベリング情報格納部から転送されたラベリング情報を記憶する第二ラベリング情報格納部50と、ラベリング処理部によって付与されたラベルに係るラベル数がフラッシュラベル数に到達した場合に、第一ラベリング情報格納部に記憶されているラベリング情報を第二ラベリング情報格納部へ転送させると共に第一ラベリング情報格納部をフラッシュするフラッシュ制御部40と、を備えることを特徴とする。
[Summary of Example Embodiments of the Present Invention and Actions and Effects]
<First embodiment>
The labeling processing device (image processing device 1) according to the present aspect refers to a label attached to a reference pixel adjacent to a pixel of interest of image data, a
ラベリング処理部が生成するラベリング情報を直接、リアルタイムで記憶していくメモリには高速動作が要求される。しかし、高速動作が可能なメモリに1フレームの画像データから生成される全てのラベリング情報を格納しようとすれば、当該メモリに要求される記憶容量が大きくなり、装置コストが過大となるという問題がある。
そこで、本態様に係るラベリング処理装置には、ラベリングの処理結果を保存する複数のメモリ(第一ラベリング情報格納部と第二ラベリング情報格納部)を配置した。第一ラベリング情報格納部はラベリング処理部が生成するラベリング情報を直接、リアルタイムで記憶していく手段であり、高速動作が要求されるメモリである。第二ラベリング情報格納部は、一旦は第一ラベリング情報格納部に記憶されたラベリング情報を所定のタイミングで第一ラベリング情報格納部から退避させる手段であり、処理速度は低速で構わないが、記憶容量が要求されるメモリである。このように、ラベリング情報格納部を複数用意することによって、夫々のラベリング情報格納部には、役割に応じて必要な性能を与えることができるようになる。
従って、本態様によれば、様々な画像のラベリング処理を行うに際し、ラベリング処理を高速に実行することができ、且つ、ラベリングの処理結果をリアルタイムで保存するメモリの容量を小さくできる。即ち、本態様によれば、画像処理装置の高速性とリアルタイム性を維持しながら、安価な装置構成としても、生成された1フレーム分のラベリング情報を記憶するために必要な容量を十分に確保することができる。
A high-speed operation is required for a memory that directly stores the labeling information generated by the labeling processing unit in real time. However, if all the labeling information generated from one frame of image data is to be stored in a memory that can operate at high speed, the storage capacity required for the memory becomes large and the device cost becomes excessive. is there.
Therefore, in the labeling processing apparatus according to this aspect, a plurality of memories (first labeling information storage section and second labeling information storage section) for storing the labeling processing result are arranged. The first labeling information storage unit is a means for directly storing the labeling information generated by the labeling processing unit in real time, and is a memory that requires high-speed operation. The second labeling information storage unit is a unit that temporarily saves the labeling information stored in the first labeling information storage unit from the first labeling information storage unit at a predetermined timing. It is a memory whose capacity is required. In this way, by preparing a plurality of labeling information storage units, it becomes possible to give each labeling information storage unit a required performance according to its role.
Therefore, according to this aspect, the labeling process can be executed at high speed when the labeling process of various images is performed, and the capacity of the memory for storing the labeling process result in real time can be reduced. That is, according to this aspect, while maintaining the high speed and the real-time property of the image processing apparatus, even with an inexpensive apparatus configuration, a sufficient capacity for storing the generated one frame of labeling information is secured. can do.
<第二の実施態様>
本態様に係るラベリング処理装置(画像処理装置1)において、ラベリング処理部20は、第一ラベリング情報格納部30がフラッシュされた場合に、フラッシュ前に付与されたラベルと、フラッシュ後に付与されたラベルとの接続関係を示す前処理接続情報を第一ラベリング情報格納部30に記憶させることを特徴とする。
本態様によれば、第一ラベリング情報格納部をフラッシュしても、フラッシュ前後に付されたラベル同士の接続関係を第一ラベリング情報格納部に記憶させるので、フラッシュ前後のラベルについても問題なくラベル連結処理を行うことができる。
<Second embodiment>
In the labeling processing apparatus (image processing apparatus 1) according to this aspect, the
According to this aspect, even if the first labeling information storage unit is flushed, the connection relationship between the labels attached before and after the flashing is stored in the first labeling information storage unit, so that the labels before and after the flushing will not be a problem. A connection process can be performed.
<第三の実施態様>
本態様に係るラベリング処理装置(画像処理装置1)において、フラッシュ制御部40は、ラベリング処理部20によって付与されたラベルに係るラベル数が画像データのライン途中でフラッシュラベル数となった場合に、ラベリング処理部による該ラインの処理が終了したときに第一ラベリング情報格納部30をフラッシュすることを特徴とする。
画像データのライン途中で第一ラベリング情報格納部をフラッシュすることも可能であるが、ラベリング処理が複雑化し、ラベリング処理に係わる回路が肥大化するという問題がある。
本態様によれば、第一ラベリング情報格納部のフラッシュをライン単位で行うことによって、ラベリング処理を簡素化にすることができ、ラベリング処理に係わる回路をコンパクトにすることができる。
<Third embodiment>
In the labeling processing device (image processing device 1) according to this aspect, the
Although it is possible to flash the first labeling information storage part in the middle of the line of the image data, there is a problem that the labeling process becomes complicated and the circuit related to the labeling process becomes enlarged.
According to this aspect, by performing the flushing of the first labeling information storage unit on a line-by-line basis, the labeling process can be simplified, and the circuit related to the labeling process can be made compact.
<第四の実施態様>
本態様に係るラベリング処理装置(画像処理装置1)は、第一ラベリング情報格納部30のアクセス速度が、第二ラベリング情報格納部50のアクセス速度よりも速いことを特徴とする。
本態様によれば、ラベリング処理部が生成するラベリング情報を第一ラベリング情報格納部にリアルタイムで高速に記憶させることができる。また、アクセス速度が比較的低速なメモリは安価であるため、第二ラベリング情報格納部を1フレーム分のラベリング情報を記憶するために必要な程度に大容量化しても、装置を安価に構成することができる。
<Fourth Embodiment>
The labeling processing device (image processing device 1) according to this aspect is characterized in that the access speed of the first labeling
According to this aspect, the labeling information generated by the labeling processing unit can be stored in the first labeling information storage unit at high speed in real time. Further, since the memory having a relatively low access speed is inexpensive, even if the capacity of the second labeling information storage unit is increased to the extent necessary to store the labeling information for one frame, the device can be configured inexpensively. be able to.
<第五の実施態様>
本態様に係るラベリング処理装置(画像処理装置1)は、第一ラベリング情報格納部30の記憶容量が、第二ラベリング情報格納部50の記憶容量よりも少ないことを特徴とする。
本態様によれば、第一ラベリング情報格納部を高速アクセスが可能なメモリとしても、記憶容量を低容量とすることができるので、装置の低コスト化を実現できる。また、第二ラベリング情報格納部を大容量とすることによって、第一ラベリング情報格納部を低容量化しても、ラベリング処理において付与するラベル数は制限を受けず、これにより様々な画像のラベリング処理を行うことが可能となる。
<Fifth Embodiment>
The labeling processing apparatus (image processing apparatus 1) according to this aspect is characterized in that the storage capacity of the first labeling
According to this aspect, even if the first labeling information storage unit is a memory that can be accessed at high speed, the storage capacity can be made low, so that the cost of the device can be reduced. Further, by increasing the capacity of the second labeling information storage unit, even if the capacity of the first labeling information storage unit is reduced, the number of labels to be given in the labeling process is not limited, and thus the labeling process of various images is performed. It becomes possible to do.
<第六の実施態様>
本態様に係るラベリング処理装置(画像処理装置1)において、フラッシュラベル数は、フラッシュラベル数に対応したラベリング情報に係る記憶容量と、ラベリング処理部20によって付与されたラベルの個数がライン途中でフラッシュラベル数となった後、該ラインの残部について新規に付与されるラベル数の予測値に対応したラベリング情報に係る記憶容量と、を加算した容量が、第一ラベリング情報格納部30の記憶容量を超えないように設定されることを特徴とする。
画像データのライン途中でフラッシュを行えば、第一ラベリング情報格納部には記憶容量の最大限までラベリング情報を格納することができる。しかし、ラベリング処理の簡素化とラベリング処理に係わる回路のコンパクト化を考慮すると、フラッシュはライン単位で行う方が望ましい。そのためには、ライン単位でのフラッシュを保証できるようにする必要がある。
本態様においては、ラベリング処理部が付与したラベル数がライン途中でフラッシュラベル数に到達したとしても、第一ラベリング情報格納部には少なくとも当該ラインのラベリング処理が終了するまでに生成されるラベリング情報も格納できるような容量を持たせている。このようにすることでライン単位でのフラッシュ処理を保証することができる。
<Sixth embodiment>
In the labeling processing apparatus (image processing apparatus 1) according to the present aspect, the number of flash labels is the storage capacity of the labeling information corresponding to the number of flash labels and the number of labels given by the
If the flashing is performed in the middle of the line of the image data, the labeling information can be stored in the first labeling information storage unit up to the maximum storage capacity. However, considering the simplification of the labeling process and the compactness of the circuit related to the labeling process, it is preferable to perform the flash in units of lines. For that purpose, it is necessary to ensure the flash in units of lines.
In this aspect, even if the number of labels given by the labeling processing unit reaches the number of flash labels in the middle of the line, the labeling information generated in the first labeling information storage unit at least until the labeling process of the line is completed. It also has a capacity to store. By doing so, it is possible to guarantee the flash processing for each line.
<第七の実施態様>
本態様に係るラベリング処理装置(画像処理装置1)において、ラベリング処理部20は、ラベリング処理結果として、ラベル同士の接続関係を表す接続情報と、ラベルを付与された画素の数及び存在範囲をラベル毎に示す付加情報とを生成して第一ラベリング情報格納部30に記憶させ、画像データ中の各画素と各画素に付与されたラベルとの対応関係を示す画素・ラベル情報を生成して第二ラベリング情報格納部50に記憶させることを特徴とする。
本態様によれば、ラベリング処理中にリアルタイムで変更される接続情報と付加情報を第一ラベリング情報格納部に記憶させ、ラベリング処理中に変更されない画素・ラベル情報を第二ラベリング情報格納部に記憶させるので、第一ラベリング情報格納部の記憶容量を低容量化することができる。
<Seventh embodiment>
In the labeling processing device (image processing device 1) according to this aspect, the
According to this aspect, the connection information and the additional information that are changed in real time during the labeling process are stored in the first labeling information storage unit, and the pixel / label information that is not changed during the labeling process is stored in the second labeling information storage unit. Therefore, the storage capacity of the first labeling information storage section can be reduced.
1…画像処理装置(ラベリング処理装置)、11…CPU、12…レジスタ、13…ラベリング演算処理部、14…ライン、15…メモリ、16…I/F部、17…二値化処理部、18…ノイズ除去部、19…制御部、20…ラベリング処理部、21…現ライン処理部、22…ライン前処理結果保持部、30…第一ラベリング情報格納部、31…現在処理接続情報格納部、32…前処理接続情報格納部、33…第一付加情報格納部、40…フラッシュ制御部、41…ラベル数判定部、42…コントローラ、50…第二ラベリング情報格納部、51…全接続情報格納部、52…第二付加情報格納部、53…画素・ラベル情報保持部、54a〜54c…格納領域、55…付加情報格納領域、56…現在処理接続情報格納領域、57…前処理接続情報格納領域、60…ラベル連結処理部、70…走査マスク、71…注目画素、72a〜72d…参照画素
DESCRIPTION OF
Claims (7)
ラベリング処理部によって付与されたラベルに係るラベリング情報を記憶する第一ラベリング情報格納部と、
第一ラベリング情報格納部から転送されたラベリング情報を記憶する第二ラベリング情報格納部と、
ラベリング処理部によって付与されたラベルに係るラベル数がフラッシュラベル数に到達した場合に、第一ラベリング情報格納部に記憶されているラベリング情報を第二ラベリング情報格納部へ転送させると共に第一ラベリング情報格納部をフラッシュするフラッシュ制御部と、を備えることを特徴とするラベリング処理装置。 A labeling processing unit that attaches a label to a pixel of interest by referring to a label attached to a reference pixel adjacent to the pixel of interest of the image data;
A first labeling information storage unit that stores labeling information related to labels given by the labeling processing unit;
A second labeling information storage unit that stores the labeling information transferred from the first labeling information storage unit;
When the number of labels related to the label given by the labeling processing unit reaches the number of flash labels, the labeling information stored in the first labeling information storage unit is transferred to the second labeling information storage unit and the first labeling information is transferred. A labeling processing device, comprising: a flash control unit that flashes a storage unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017118442A JP6681077B2 (en) | 2017-06-16 | 2017-06-16 | Labeling processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2017118442A JP6681077B2 (en) | 2017-06-16 | 2017-06-16 | Labeling processor |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2019003469A JP2019003469A (en) | 2019-01-10 |
JP6681077B2 true JP6681077B2 (en) | 2020-04-15 |
Family
ID=65006920
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017118442A Active JP6681077B2 (en) | 2017-06-16 | 2017-06-16 | Labeling processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6681077B2 (en) |
-
2017
- 2017-06-16 JP JP2017118442A patent/JP6681077B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2019003469A (en) | 2019-01-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5854802B2 (en) | Image processing apparatus, image processing method, and computer program | |
JPH1166325A (en) | Method and device for determining boundary of object and recording medium recording boundary determination program for object | |
JP2006318032A (en) | Image processing method and image processor | |
CN103428511A (en) | Pattern processing device, pattern processing method | |
JP6815741B2 (en) | Image processing device and image processing method | |
JP6681077B2 (en) | Labeling processor | |
US20190244359A1 (en) | Image processing method and image processing device | |
KR20100052850A (en) | A rasterizer for 2d vector graphics and method | |
US5835629A (en) | Code pattern-image processing apparatus | |
JP5697475B2 (en) | Labeling processing apparatus and labeling processing method | |
JP6749528B1 (en) | Defect management device, modification management method, and modification management program | |
JP6922690B2 (en) | Character area extraction program, character area extraction device and character area extraction method | |
US11195249B2 (en) | Processing device having a row number determining unit | |
JP4585999B2 (en) | Image processing apparatus, image processing method, and program | |
JP2585872B2 (en) | Image noise removal device | |
JP3395346B2 (en) | Fillet coordinate generation method and device | |
JP4519272B2 (en) | Pattern inspection apparatus and pattern inspection method | |
JP2838556B2 (en) | Image processing device | |
JPH05189563A (en) | Image processor | |
JP2910295B2 (en) | Contour information extraction device | |
JP2785269B2 (en) | Noise removal device | |
JP2010061581A (en) | Image processing apparatus | |
JPH05143733A (en) | Contour extracting device | |
JP2001307097A (en) | Device and method for detecting pattern | |
JPH11284859A (en) | Image processing unit and its method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20190402 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20200306 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20200310 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20200313 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6681077 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |