JP2014209310A - Labeling method, labeling device and defect inspection device - Google Patents

Labeling method, labeling device and defect inspection device Download PDF

Info

Publication number
JP2014209310A
JP2014209310A JP2013217278A JP2013217278A JP2014209310A JP 2014209310 A JP2014209310 A JP 2014209310A JP 2013217278 A JP2013217278 A JP 2013217278A JP 2013217278 A JP2013217278 A JP 2013217278A JP 2014209310 A JP2014209310 A JP 2014209310A
Authority
JP
Japan
Prior art keywords
run
label
update
thread
labeling
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.)
Granted
Application number
JP2013217278A
Other languages
Japanese (ja)
Other versions
JP6152034B2 (en
Inventor
拓矢 安田
Takuya Yasuda
拓矢 安田
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.)
Dainippon Screen Manufacturing Co Ltd
Original Assignee
Dainippon Screen Manufacturing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dainippon Screen Manufacturing Co Ltd filed Critical Dainippon Screen Manufacturing Co Ltd
Priority to JP2013217278A priority Critical patent/JP6152034B2/en
Priority to KR1020130161353A priority patent/KR101521725B1/en
Priority to CN201310751463.7A priority patent/CN104063270B/en
Priority to TW103101220A priority patent/TWI512687B/en
Publication of JP2014209310A publication Critical patent/JP2014209310A/en
Application granted granted Critical
Publication of JP6152034B2 publication Critical patent/JP6152034B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • G06T7/41Analysis of texture based on statistical description of texture

Abstract

PROBLEM TO BE SOLVED: To accelerate labeling processing.SOLUTION: A labeling method includes: an initial label setting process for setting mutually different labels to respective runs; an update process for defining the run as a processing object run for each run, determining whether or not a first connection run connecting to the processing object run exists, and performing individual update processing in which the label of one of the processing object run and the first connection run is updated to the label of the other when the first connection run exists; and a search process for searching for the mutually-connected runs among the plurality of runs on the basis of the plurality of labels after the update process to apply the same label. In the update process, the plurality of runs are divided into a plurality of sets, the individual update processing executed in each set is defined as an update thread, and the plurality of update threads are executed in parallel while permitting rewriting of the label by one update thread among the plurality of update threads and inhibiting rewriting of the label rewritten by the one update thread by other update threads on the basis of exclusion control.

Description

この発明は、二値画像データをランレングス化して作成された複数のランに対してラベルを付与するラベリング技術および当該ラベリング技術を適用した欠陥検査装置に関するものである。   The present invention relates to a labeling technique for assigning labels to a plurality of runs created by converting binary image data into run lengths, and a defect inspection apparatus to which the labeling technique is applied.

半導体基板やプリント基板等の製造技術分野では、製品に含まれる欠陥を検出しこれを分析・評価するために、評価対象物を顕微鏡等を介して撮像し、得られた画像から欠陥部を含む画像、いわゆる欠陥画像を抽出している。そして、当該欠陥画像の二値画像データに基づいて欠陥部の個数、面積や重心などを計測している。このとき、当該計測を自動的に行うために、ラベリング(連結領域抽出)処理が広く利用されている。例えば、特許文献1では、二値画像データを行毎にランレングス化して生成されるランに対して2パスのラベル付与処理を実行してラベリング処理の高速化が図られている。   In the field of manufacturing technology such as semiconductor substrates and printed circuit boards, in order to detect defects contained in products and analyze / evaluate them, the evaluation object is imaged through a microscope or the like, and defective portions are included from the obtained images. An image, a so-called defect image, is extracted. Based on the binary image data of the defect image, the number of defective portions, the area, the center of gravity, and the like are measured. At this time, in order to automatically perform the measurement, labeling (connected region extraction) processing is widely used. For example, in Patent Document 1, the labeling process is speeded up by executing a two-pass labeling process on a run generated by converting the binary image data into run lengths for each row.

特開2008−186123号公報JP 2008-186123 A

しかしながら、上記した特許文献1に記載の発明(以下「従来発明」という)では、上位のランデータから順に調査することを前提としており、これがさらなる高速化を阻害する要因のひとつになっている。また、上記従来発明では、異なるラベルが与えられたランデータ同士が同じ連結成分に属するか否かを記録するラベルテーブル、並びにラベル毎に当該ラベルに対応するランデータの数を関連付けたラン数テーブルを別途設ける必要がある。そのため、ランの数の増大や連結状態の複雑化に応じて上記ラベルテーブルおよびラン数テーブルの要素数が増大してしまい、これがラベリング処理の高速化を阻害する別の要因にもなっている。   However, the above-described invention described in Patent Document 1 (hereinafter referred to as “conventional invention”) is premised on the investigation starting from the higher rank run data, and this is one of the factors that hinder further speeding up. In the conventional invention, a label table that records whether or not run data given different labels belong to the same connected component, and a run number table that associates the number of run data corresponding to the label for each label. Must be provided separately. For this reason, the number of elements in the label table and the run number table increases in accordance with the increase in the number of runs and the complexity of the connected state, which is another factor that hinders the speeding up of the labeling process.

この発明は上記課題に鑑みなされたものであり、二値画像データのラベリング処理の高速化を図ることができる技術および当該技術を用いて欠陥検査を効率的に行う技術を提供することを目的とする。   The present invention has been made in view of the above problems, and an object thereof is to provide a technique capable of speeding up the labeling processing of binary image data and a technique for efficiently performing defect inspection using the technique. To do.

本発明にかかるラベリング方法は、二値画像データをランレングス化して作成された複数のランに対してラベリング処理を施すラベリング方法であって、各ランに対して互いに異なるラベルを設定する初期ラベル設定工程と、ラン毎に、当該ランを処理対象ランとするとともに当該処理対象ランに接続する第1連結ランが存在するか否かを判定し、第1連結ランが存在するときには、処理対象ランおよび第1連結ランのうちの一方のラベルを他方のラベルに更新する個別更新処理を行う更新工程と、更新工程後に、複数のラベルに基づいて複数のランのうち互いに接続するランを探索して同一のラベルを付与する探索工程とを備え、更新工程では、複数のランを複数組に分割するとともに各組で実行される個別更新処理を更新スレッドとし、排他制御のもと複数の更新スレッドのうち一の更新スレッドによるラベルの書換を許可するとともに一の更新スレッドにより書き換えられるラベルの他の更新スレッドによる書換を禁止しながら複数の更新スレッドを並列して実行することを特徴としている。   A labeling method according to the present invention is a labeling method in which a labeling process is performed on a plurality of runs created by run-lengthing binary image data, and different initial labels are set for each run. For each step, it is determined whether or not there is a first linked run that is to be treated as a run to be processed and connected to the run to be processed, and when there is a first linked run, An update process for performing an individual update process for updating one label of the first linked runs to the other label, and after the update process, a search is made for runs connected to each other among a plurality of runs based on a plurality of labels. And a search process for assigning a label, and in the update process, a plurality of runs are divided into a plurality of sets and an individual update process executed in each set is set as an update thread, Under a different control, allow rewriting of a label by one update thread among a plurality of update threads, and prohibit a rewrite by another update thread of a label that is rewritten by one update thread in parallel with a plurality of update threads. It is characterized by executing.

また、本発明にかかるラベリング装置は、二値画像データをランレングス化して作成された複数のランに対してラベリング処理を施すラベリング装置であって、各ランのラベルを記憶する記憶部と、演算処理を行うプロセッサコアを複数個有するプロセッサ部と、複数のラベルに互いに異なる値を初期設定した後で、ラン毎に、当該ランを処理対象ランとするとともに当該処理対象ランに接続する第1連結ランが存在するか否かを判定し、第1連結ランが存在するときには、処理対象ランおよび第1連結ランのうちの一方のラベルを他方のラベルに更新する個別更新処理を行い、さらに複数のラベルに基づいて複数のランのうち互いに接続するランを探索して同一のラベルを付与する制御部とを備え、複数のランはプロセッサコアの個数に応じて複数組に分割され、各プロセッサコアは分割された一または複数のランについて個別更新処理を更新スレッドとして実行し、制御部は、排他制御のもと複数の更新スレッドのうち一の更新スレッドによるラベルの書換を許可するとともに一の更新スレッドにより書き換えられるラベルの他の更新スレッドによる書換を禁止しながら複数の更新スレッドを並列して実行させることでラン毎の個別更新処理を行うことを特徴としている。   The labeling device according to the present invention is a labeling device that performs a labeling process on a plurality of runs created by converting the binary image data into run lengths, a storage unit that stores the labels of each run, and an arithmetic operation A processor unit having a plurality of processor cores that perform processing, and a first connection that, after initializing different values for a plurality of labels, sets each run as a processing target run and connects to the processing target run It is determined whether or not a run exists, and when a first linked run exists, an individual update process is performed to update one label of the processing target run and the first linked run to the other label, and A control unit that searches for a run connected to each other among a plurality of runs based on the label and assigns the same label, and the plurality of runs corresponds to the number of processor cores. And each processor core executes individual update processing as an update thread for one or more of the divided runs, and the control unit uses one update thread among the plurality of update threads under exclusive control. It is characterized by performing individual update processing for each run by allowing multiple update threads to run in parallel while permitting rewriting of labels and prohibiting rewriting by other update threads of labels that are rewritten by one update thread Yes.

さらに、本発明にかかる欠陥検査装置は、検査対象画像を取得する画像取得部と、検査対象画像を検査して欠陥部位が含まれる欠陥画像を抽出する画像抽出部と、欠陥画像を二値化処理して二値画像データを生成する二値化処理部と、二値画像データをランレングス化して複数のランを生成するラン生成部と、上記ラベリング装置と同一構成を有し、複数のランのうち互いに接続するランに対して同一のラベルを付与するラベリング手段とを備えることを特徴としている。   Furthermore, the defect inspection apparatus according to the present invention includes an image acquisition unit that acquires an inspection target image, an image extraction unit that inspects the inspection target image and extracts a defect image including a defective portion, and binarizes the defect image. A binarization processing unit that generates binary image data by processing, a run generation unit that generates a plurality of runs by run lengthing the binary image data, and has the same configuration as the labeling device, And labeling means for assigning the same label to runs connected to each other.

このように構成された発明では、ラン毎に互いに異なる値を有するラベルが初期設定される。そして、ラン毎に、個別更新処理が実行され、処理対象ランに接続する連結ランが存在するか否かに応じてラベルの更新が実行される。その後で、複数のラベルに基づいて複数のランのうち互いに接続するランが探索され、それに対して同一のラベルが付与される。このように更新工程と探索工程の2パス方式でラベリング処理を行う点で従来発明と共通するが、本発明では、ランの個数と同数のラベルによって二値画像データのラベリング処理が行われており、従来発明で用いていたラベルテーブルおよびラン数テーブルが不要であり、ラベリング処理の高速化が可能となっている。   In the invention thus configured, labels having different values are initialized for each run. Then, for each run, an individual update process is executed, and a label update is executed depending on whether or not there is a linked run connected to the process target run. Thereafter, based on the plurality of labels, a search is made for the runs that are connected to each other among the plurality of runs, and the same label is assigned thereto. In this way, the two-pass labeling process of the update process and the search process is common to the conventional invention. However, in the present invention, the binary image data is labeled using the same number of labels as the number of runs. Thus, the label table and the run number table used in the conventional invention are unnecessary, and the labeling process can be speeded up.

しかも、本発明の更新工程では、複数のランを複数組に分割するとともに各組で実行される個別更新処理を更新スレッドとし、それらの更新スレッドを並列して実行する。つまり、ラン毎の個別更新処理は並列実行される。したがって、ラベル更新については更新スレッド間で排他制御されるものの、上位のランから逐次的にラベルを付与する従来発明に比べ、ラベリング処理に要するトータル時間を大幅に短縮することができる。   Moreover, in the update process of the present invention, a plurality of runs are divided into a plurality of sets, and individual update processing executed in each set is set as an update thread, and these update threads are executed in parallel. That is, the individual update process for each run is executed in parallel. Therefore, although the label update is exclusively controlled between the update threads, the total time required for the labeling process can be greatly reduced as compared with the conventional invention in which labels are sequentially assigned from the upper run.

ここで、更新工程では、一の更新スレッドにより書き換えられるラベルの他の更新スレッドによる書換を禁止しているが、当該ラベル以外のラベル、つまり競合しないラベルについては他の更新スレッドによる書換を許可してもよい。これによって、処理効率を高めてラベリング処理に要する時間をさらに短縮することができる。
また、個別更新処理において、第1連結ランのラベルを更新したとき、第1連結ランに接続する処理対象ラン以外の第2連結ランが存在するか否かを判定し、第2連結ランが存在するときには、第1連結ランおよび第2連結ランのうちの一方のラベルを他方のラベルに更新するように構成してもよい。このように第1連結ランのみならず、当該第1連結ランを介して処理対象ランに接続する第2連結ランについても、ラベル更新しておくことで、処理対象ランに対する個別更新処理よりも後で実行される第2連結ランに対する個別更新処理に要する時間を短縮することができる。その結果、トータルの処理時間を短縮することができる。
Here, in the update process, rewriting by other update threads of the label that is rewritten by one update thread is prohibited, but rewriting by other update threads is permitted for labels other than the label, that is, labels that do not conflict. May be. As a result, the processing efficiency can be increased and the time required for the labeling process can be further shortened.
In the individual update process, when the label of the first linked run is updated, it is determined whether there is a second linked run other than the processing target run connected to the first linked run, and the second linked run exists. When doing so, you may comprise so that one label of a 1st connection run and a 2nd connection run may be updated to the other label. Thus, not only the first linked run but also the second linked run connected to the processing target run via the first linked run can be updated after the individual update process for the processing target run by updating the label. The time required for the individual update process for the second linked run executed in step S1 can be reduced. As a result, the total processing time can be shortened.

また、第1連結ランのラベルを更新する前の更新前ラベルと同一ラベルを有するランを第2連結ランとしてもよく、更新前ラベルを利用することで第2連結ランを容易に、且つ確実に見つけ出すことができ、好適である。   In addition, a run having the same label as the pre-update label before updating the label of the first connected run may be used as the second connected run, and the second connected run can be easily and reliably made using the pre-update label. It can be found and is preferred.

また、二値画像データを行毎にランレングス化してもよく、この場合、処理対象ランの下行に接続するランを第1連結ランとして判定することができる。   In addition, the binary image data may be run-length for each row, and in this case, the run connected to the lower row of the processing target run can be determined as the first connected run.

また、2パスのうち探索工程(複数のランのうち互いに接続するランを探索して同一のラベルを付与する工程)においてラン毎に個別探索処理を実行してもよい。この「個別探索処理」とは、一のランを処理対象ランとするとともに当該処理対象ランに接続する連結ランを複数のラベルに基づいて見つけ出して処理対象ランおよび連結ランのラベルを同一に書き換える処理を意味している。このようにラン毎の個別探索処理によって探索工程を合理的に行うことができる。しかも、上記したラン毎の個別更新処理と同様に、複数のランを複数組に分割するとともに各組で実行される個別探索処理を探索スレッドとし、排他制御のもと複数の探索スレッドのうち一の探索スレッドによるラベルの書換を許可するとともに一の探索スレッドにより書き換えられるラベルの他の探索スレッドによる書換を禁止しながら複数の探索スレッドを並列して実行してもよい。これによって、探索工程においても処理速度を高めてラベリング処理の高速化をより一層進めることができる。   Moreover, you may perform an individual search process for every run in the search process (The process which searches the run connected mutually among several runs and provides the same label) among 2 paths. This “individual search process” is a process in which one run is set as a process target run and a linked run connected to the process target run is found based on a plurality of labels, and the process target run and the label of the linked run are rewritten to the same Means. Thus, a search process can be rationally performed by the individual search process for each run. In addition, as in the individual update process for each run described above, a plurality of runs are divided into a plurality of sets, and the individual search process executed in each set is set as a search thread, and one of the plurality of search threads is controlled under exclusive control. A plurality of search threads may be executed in parallel while permitting rewriting of labels by the search thread and prohibiting rewriting of labels rewritten by one search thread by other search threads. Thereby, it is possible to further increase the speed of the labeling process by increasing the processing speed in the search process.

この発明によれば、ラベリング処理を実行するための処理の一部を並列で実行することができ、二値画像データのラベリング処理に要するトータル時間を短縮することができる。   According to the present invention, part of the process for executing the labeling process can be executed in parallel, and the total time required for the labeling process of the binary image data can be shortened.

この発明にかかるラベリング装置の一実施形態を装備する欠陥検査装置を用いる検査システムの概略構成を示す図である。It is a figure which shows schematic structure of the inspection system using the defect inspection apparatus equipped with one Embodiment of the labeling apparatus concerning this invention. 画像処理部の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of an image process part. 本発明にかかるラベリング装置の一実施形態に相当するラベリング部の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the labeling part corresponded to one Embodiment of the labeling apparatus concerning this invention. ラベリング部によるラベリング動作を示すフローチャートである。It is a flowchart which shows the labeling operation | movement by a labeling part. ラベリング部に与えられる二値画像データの一例を示す図である。It is a figure which shows an example of the binary image data given to a labeling part. 図5の二値画像データに対してランレングス化処理を実行して得られるランのランデータおよびラン同士の連結関係を示すラン接続データの初期値を示す図である。It is a figure which shows the initial value of the run connection data which show the run data of a run obtained by performing a run-length-ized process with respect to the binary image data of FIG. 5, and the connection relationship between runs. 各プロセッサコアで実行される個別更新処理を示すフローチャートである。It is a flowchart which shows the individual update process performed with each processor core. 各プロセッサコアで実行される個別更新処理の一例を示す模式図である。It is a schematic diagram which shows an example of the individual update process performed with each processor core. 各プロセッサコアで実行される個別探索処理を示すフローチャートである。It is a flowchart which shows the individual search process performed with each processor core. 各プロセッサコアで実行される個別探索処理の一例を示す模式図である。It is a schematic diagram which shows an example of the individual search process performed with each processor core.

図1はこの発明にかかるラベリング装置の一実施形態を装備する欠陥検査装置を用いる検査システムの概略構成を示す図である。この検査システム1は、検査対象である半導体基板(以下「基板」という。)Sの外観に現れたピンホールや異物等の欠陥検査を行う検査システムである。検査システム1は、基板S上の検査対象領域を撮像する撮像装置2と、撮像装置2からの画像データに基づいて欠陥検査を行う制御装置3を有する。   FIG. 1 is a diagram showing a schematic configuration of an inspection system using a defect inspection apparatus equipped with an embodiment of a labeling apparatus according to the present invention. The inspection system 1 is an inspection system for inspecting defects such as pinholes and foreign matters appearing on the appearance of a semiconductor substrate (hereinafter referred to as “substrate”) S to be inspected. The inspection system 1 includes an imaging device 2 that images an inspection target area on the substrate S, and a control device 3 that performs defect inspection based on image data from the imaging device 2.

本システムとは別に基板Sの製造ラインに設けられた基板検出装置Mにおいて基板Sに欠陥が発見されると、その欠陥の位置座標がこの検査システム1に与えられる。製造ラインに組み込まれた基板検出装置Mは、予め定められた処理アルゴリズムによって基板S全体を検査し、基板表面に欠陥としての要件を満たす領域があればその位置座標を取得して出力する。したがって、該基板検出装置Mが有する撮像部は比較的低解像度であり、処理アルゴリズムも固定的である。   When a defect is found in the substrate S in the substrate detection apparatus M provided in the production line of the substrate S separately from the present system, the position coordinates of the defect are given to the inspection system 1. The substrate detection apparatus M incorporated in the production line inspects the entire substrate S by a predetermined processing algorithm, and acquires and outputs the position coordinates if there is a region on the substrate surface that satisfies the requirement as a defect. Therefore, the imaging unit included in the substrate detection apparatus M has a relatively low resolution, and the processing algorithm is fixed.

一方、この検査システム1は、図示しないインターフェースを介して基板検出装置Mと接続されており、基板検出装置Mから欠陥として位置座標が報告された領域をより高い解像度を有する撮像装置2によって撮像するとともに、その画像を制御装置3が精査して欠陥の有無やその種類などをより詳しく判定するとともに、欠陥部分の画像を表示部に表示する。   On the other hand, the inspection system 1 is connected to the substrate detection apparatus M through an interface (not shown), and images an area in which position coordinates are reported as a defect from the substrate detection apparatus M by the imaging apparatus 2 having a higher resolution. At the same time, the control device 3 examines the image to determine in detail the presence or absence and type of the defect, and displays the image of the defective portion on the display unit.

撮像装置2は、基板S上の検査対象領域を撮像することにより画像データを取得する撮像部21、基板Sを保持するステージ22、および、撮像部21に対してステージ22を相対的に移動させるステージ駆動部23を有している。また、撮像部21は、照明光を出射する照明部211、基板Sに照明光を導くとともに基板Sからの光が入射する光学系212、および、光学系212により結像された基板Sの像を電気信号に変換する撮像デバイス213を有している。ステージ駆動部23はボールねじ、ガイドレールおよびモータにより構成され、制御装置3に設けられた装置制御部4がステージ駆動部23および撮像部21を制御することにより、基板S上の検査対象領域が撮像される。   The imaging device 2 moves the stage 22 relative to the imaging unit 21 that acquires image data by imaging the inspection target region on the substrate S, the stage 22 that holds the substrate S, and the imaging unit 21. A stage driving unit 23 is provided. In addition, the imaging unit 21 includes an illumination unit 211 that emits illumination light, an optical system 212 that guides illumination light to the substrate S and receives light from the substrate S, and an image of the substrate S formed by the optical system 212. An imaging device 213 for converting the signal into an electrical signal. The stage drive unit 23 includes a ball screw, a guide rail, and a motor. The device control unit 4 provided in the control device 3 controls the stage drive unit 23 and the imaging unit 21, so that the inspection target region on the substrate S is changed. Imaged.

制御装置3は装置制御部4を有しており、この装置制御部4が予め読み込まれた制御プログラムを実行することにより、図1に示す制御装置各部を以下のように動作させる。制御装置3は、上記の装置制御部4のほか、画像取得部5および画像処理部6を備えている。画像取得部5は、撮像部21から出力される電気信号をデータ化して、撮像画像に対応する画像データを取得する。画像処理部6は、画像取得部5が取得した画像データに対して適宜の画像処理を施して、画像に含まれる欠陥の検出や欠陥部分の画像(以下「欠陥画像」という)を作成する。なお、当該画像処理部6は本発明にかかるラベリング装置の一実施形態であるラベリング部を含んでおり、欠陥画像に対するラベリング処理を高速に実行可能となっている。画像処理部6、特にラベリング部の構成および動作については、後で詳述する。   The control device 3 has a device control unit 4, and when the device control unit 4 executes a control program read in advance, each unit of the control device shown in FIG. 1 is operated as follows. The control device 3 includes an image acquisition unit 5 and an image processing unit 6 in addition to the device control unit 4 described above. The image acquisition unit 5 converts the electrical signal output from the imaging unit 21 into data, and acquires image data corresponding to the captured image. The image processing unit 6 performs appropriate image processing on the image data acquired by the image acquisition unit 5 to detect a defect included in the image and create an image of a defective portion (hereinafter referred to as “defect image”). The image processing unit 6 includes a labeling unit that is an embodiment of a labeling apparatus according to the present invention, and can perform a labeling process on a defective image at high speed. The configuration and operation of the image processing unit 6, particularly the labeling unit, will be described in detail later.

さらに、制御装置3は、各種データを記憶するための記憶部7、ユーザからの操作入力を受け付けるキーボードおよびマウスなどの入力受付部8および操作手順や処理結果等のユーザ向け視覚情報を表示する表示部9などを備えている。また、図示を省略しているが、光ディスク、磁気ディスク、光磁気ディスク等のコンピュータ読み取り可能な記録媒体から情報の読み取りを行う読取装置を有し、検査システム1の他の構成との間で信号を送受信する通信部が、適宜、インターフェイス(I/F)を介する等して接続される。   Further, the control device 3 displays a storage unit 7 for storing various data, an input receiving unit 8 such as a keyboard and a mouse for receiving an operation input from the user, and a visual information for the user such as an operation procedure and a processing result. Part 9 and the like. Although not shown in the figure, a reading device for reading information from a computer-readable recording medium such as an optical disk, a magnetic disk, a magneto-optical disk, etc. Are suitably connected via an interface (I / F) or the like.

図2は画像処理部の概略構成を示すブロック図である。画像処理部6は、フィルタリング部61、差分抽出部62、二値化処理部63、ラベリング部64および孤立除去処理部65を有している。フィルタリング部61には、画像取得部5から撮像画像が送られてくるとともに、記憶部7から参照画像が送られてくる。これら両画像のうち撮像画像は、撮像装置2によって撮像された基板Sの画像であり、欠陥検出検査の対象となる検査対象画像に相当する。また、参照画像は欠陥のない理想的な基板に対応する画像であり、この実施形態では、次に説明するように、検査対象画像と参照画像との比較によって検査対象画像から欠陥検出が行われる。これらの欠陥画像および参照画像は記憶部7に記憶され、必要に応じて参照されるが、外部の記憶媒体に記憶された画像データを必要に応じて読み込む形態であってもよい。   FIG. 2 is a block diagram illustrating a schematic configuration of the image processing unit. The image processing unit 6 includes a filtering unit 61, a difference extraction unit 62, a binarization processing unit 63, a labeling unit 64, and an isolated removal processing unit 65. A captured image is sent from the image acquisition unit 5 to the filtering unit 61, and a reference image is sent from the storage unit 7. Of these two images, the picked-up image is an image of the substrate S picked up by the image pickup device 2 and corresponds to an inspection target image to be subjected to defect detection inspection. Further, the reference image is an image corresponding to an ideal substrate having no defect, and in this embodiment, as will be described below, defect detection is performed from the inspection target image by comparing the inspection target image with the reference image. . These defect images and reference images are stored in the storage unit 7 and referred to as necessary. However, image data stored in an external storage medium may be read as necessary.

フィルタリング部61は、検査対象画像および参照画像のそれぞれについて、画像ノイズおよび欠陥と関係のない軽微な画像の差異を除去するためのフィルタリング処理を行い、各画像を差分抽出部62に送る。この差分抽出部62は、本発明の「画像抽出部」の一例に相当するものであり、フィルタリング処理後の検査対象画像および参照画像の差分を求めることで画像内容が互いに異なる領域を抽出し、当該差分画像を二値化処理部63に送る。そして、二値化処理部63は適宜の閾値によって差分画像を二値化して二値画像データBFIを生成し、ラベリング部64に送る。このラベリング部64は二値画像データBFIをランレングス化して複数のランを生成し、当該複数のランに対してラベルを付与する。さらに、孤立除去処理部65がラベリングされた二値画像から残留する孤立点を除去する。これにより、求める欠陥位置画像が作成され、画像処理部6が出力される。   The filtering unit 61 performs a filtering process for removing minor image differences unrelated to image noise and defects for each of the inspection target image and the reference image, and sends each image to the difference extraction unit 62. The difference extraction unit 62 corresponds to an example of the “image extraction unit” of the present invention, and extracts the regions having different image contents by obtaining the difference between the inspection target image and the reference image after the filtering process, The difference image is sent to the binarization processing unit 63. Then, the binarization processing unit 63 binarizes the difference image with an appropriate threshold value, generates binary image data BFI, and sends it to the labeling unit 64. The labeling unit 64 generates a plurality of runs by converting the binary image data BFI into run lengths and assigns labels to the plurality of runs. Further, the isolated removal processing unit 65 removes remaining isolated points from the labeled binary image. Thereby, the required defect position image is created and the image processing unit 6 is output.

図3は、本発明にかかるラベリング装置の一実施形態に相当するラベリング部の概略構成を示すブロック図である。このラベリング部64は複数のプロセッサコア641を有するGPU(Graphics Processing Unit)642を備えている。このGPU642では、各プロセッサコア641が個別更新処理部643および個別探索処理部644として機能し、ラン毎の個別更新処理および個別探索処理をそれぞれ一のスレッドとして実行する。本実施形態では、ラン毎の個別更新処理が本発明の「更新スレッド」の一例に相当し、ラン毎の個別探索処理が本発明の「探索スレッド」の一例に相当している。なお、個別更新処理および個別探索処理については、後で詳述する。   FIG. 3 is a block diagram showing a schematic configuration of a labeling unit corresponding to an embodiment of a labeling apparatus according to the present invention. The labeling unit 64 includes a GPU (Graphics Processing Unit) 642 having a plurality of processor cores 641. In this GPU 642, each processor core 641 functions as the individual update processing unit 643 and the individual search processing unit 644, and executes the individual update processing and individual search processing for each run as one thread. In this embodiment, the individual update process for each run corresponds to an example of the “update thread” of the present invention, and the individual search process for each run corresponds to an example of the “search thread” of the present invention. The individual update process and the individual search process will be described in detail later.

また、ラベリング部64は二値画像データBFI、ランr[m]を特定するためのデータ(以下「ランデータ」という)、ラン接続データid[m]を記憶するラベリング用記憶部645を有している。これらのデータについても、後で具体例を示しながら詳述する。   The labeling unit 64 includes a labeling storage unit 645 for storing binary image data BFI, data for specifying the run r [m] (hereinafter referred to as “run data”), and run connection data id [m]. ing. These data will be described in detail later with specific examples.

さらに、ラベリング部64は、CPU(Central Processing Unit)やメモリなどで構成された演算処理部646が設けられている。演算処理部646では、CPUが所定のプログラムに従って演算処理することにより、二値画像データBFIをランレングス化してランr[m]を生成するラン生成部647、GPU642内の各プロセッサコア641で実行されるスレッドを排他制御しながら並列して実行させる並列処理制御部648、ならびにランr[m]およびラン接続データid[m]に含まれるラベル番号を初期化するデータ初期設定部649を備えている。このように演算処理部646が本発明の「制御部」として機能する。   Further, the labeling unit 64 is provided with an arithmetic processing unit 646 configured by a CPU (Central Processing Unit), a memory, and the like. In the arithmetic processing unit 646, the CPU performs arithmetic processing according to a predetermined program, thereby executing the run generation unit 647 that generates the run r [m] by converting the binary image data BFI into run length, and is executed by each processor core 641 in the GPU 642. A parallel processing control unit 648 that executes the thread to be executed in parallel with exclusive control, and a data initial setting unit 649 that initializes the label number included in the run r [m] and the run connection data id [m]. Yes. Thus, the arithmetic processing unit 646 functions as a “control unit” of the present invention.

次に、上記のように構成されたラベリング部64によるラベリング動作について図4ないし図10を参照しつつ説明する。図4はラベリング部によるラベリング動作を示すフローチャートである。二値化処理部63により作成された二値画像データBFIがラベリング部64に与えられると、ラベリング部64の演算処理部646はラベリング部64の各部を制御してラベリング処理を実行する。まず、当該二値画像データBFIが一時的にラベリング用記憶部645に登録される。また、二値画像データBFIに対し、ランレングス化処理がラン生成部647で実行されて複数のランr[m]が生成され(ステップS1)、ラベリング用記憶部645に記憶される。なお、ランレングス化処理についは従来周知技術が数多く提案されており、本実施形態においても一般的なランレングス化処理をそのまま用いている。したがって、ランレングス化処理の説明は省略する。   Next, a labeling operation by the labeling unit 64 configured as described above will be described with reference to FIGS. FIG. 4 is a flowchart showing a labeling operation by the labeling unit. When the binary image data BFI created by the binarization processing unit 63 is given to the labeling unit 64, the arithmetic processing unit 646 of the labeling unit 64 controls each part of the labeling unit 64 to execute a labeling process. First, the binary image data BFI is temporarily registered in the labeling storage unit 645. In addition, a run length process is performed on the binary image data BFI by the run generation unit 647 to generate a plurality of runs r [m] (step S1), which are stored in the labeling storage unit 645. Many known techniques have been proposed for the run-length process, and the general run-length process is used as it is in this embodiment. Therefore, the description of the run length process is omitted.

図5はラベリング部に与えられる二値画像データの一例を示す図である。また、図6は図5の二値画像データに対してランレングス化処理を実行して得られるランのランデータおよびラン同士の連結関係を示すラン接続データの初期値を示す図である。図5および図6(a)中の縦方向および横方向の数値(0,1,2,…)は、マトリクス配列された画素の行方向および列方向の座標位置、つまり行インデクスおよび列インデクスを示している。また、図5において、ハッチングが施された画素は、「1」の画素データを有する画素であることを示す一方、ハッチングが施されていない画素は、「0」の画素データを有する画素であることを示している。このような画素データを有する二値画像データBFIに対して行毎のランレングス化処理を加えると、図6(a)に示すランが得られる。具体的には、0行目および4行目においては、「1」の画素は存在しないので、ランは作成されず、1行目ないし3行目においては、それぞれ2個、2個および1個のランが作成される。この明細書では、ランレングス化処理によって作成された各ランのラン番号を「m」で表し、ランの作成順に0,1,2,…の値を取っており、ラン番号mのランをr[m]で表す。   FIG. 5 is a diagram showing an example of binary image data given to the labeling unit. FIG. 6 is a diagram showing the run data of the run obtained by executing the run length process on the binary image data of FIG. 5 and the initial value of the run connection data indicating the connection relationship between the runs. The numerical values (0, 1, 2,...) In FIG. 5 and FIG. 6A indicate the coordinate positions in the row direction and the column direction of the pixels arranged in a matrix, that is, the row index and the column index. Show. In FIG. 5, hatched pixels indicate pixels having pixel data “1”, while pixels not hatched are pixels having pixel data “0”. It is shown that. When run length conversion processing for each row is applied to the binary image data BFI having such pixel data, the run shown in FIG. 6A is obtained. Specifically, since the pixel “1” does not exist in the 0th and 4th rows, no run is created, and in the 1st to 3rd rows, 2, 2 and 1 respectively. Runs are created. In this specification, the run number of each run created by the run length process is represented by “m”, and the values of 0, 1, 2,... Are taken in the run creation order. [M].

また、図5の二値画像データBFIをランレングス化処理して作成されるランr[0]〜r[4]のランデータをラン番号順にラベリング用記憶部645のランデータ記憶領域に格納した状態が図6(b)に図示されている。同図(b)中において、「ラベル番号」は当該ランに付与されたラベルを示し、「始端画素位置」は二値画像データBFIにおける当該ランの始端画素位置を示す列インデクスを示し、「終端画素位置」は二値画像データBFIにおける当該ランの終端画素位置を示す列インデクスを示し、「行インデクス」は二値画像データBFIにおける当該ランの行インデクスを示している。これらのうち「ラベル番号」は、当該ランと当該ラン以外のランとの連結関係を示す値であり、後で説明する更新処理(ステップS3)および探索処理(ステップS4)を実行することで図5に示す二値画像データBFIにおいて相互に連結しているラン同士に対して同じ値が付与される。なお、本実施形態では、探索処理(ステップS4)を効率的に実行するために、ラン同士の連結関係を示すラン接続表を有している。このラン接続表では、ランr[m]の接続状態を示すデータとしてラン接続データid[m]が設けられ、ラベル番号によりランr[m]とその他のランとの接続状態を示しており、例えば図6(c)に示すような表形式でラベリング用記憶部645のラン接続データ記憶領域に格納される。   Further, the run data of the runs r [0] to r [4] created by the run-length processing of the binary image data BFI of FIG. 5 are stored in the run data storage area of the labeling storage unit 645 in the order of run numbers. The state is illustrated in FIG. In FIG. 7B, “label number” indicates a label assigned to the run, “start pixel position” indicates a column index indicating the start pixel position of the run in the binary image data BFI, and “end” “Pixel position” indicates a column index indicating the end pixel position of the run in the binary image data BFI, and “Row index” indicates a row index of the run in the binary image data BFI. Among these, the “label number” is a value indicating a connection relationship between the run and a run other than the run, and the update process (step S3) and the search process (step S4) described later are executed. In the binary image data BFI shown in FIG. 5, the same values are assigned to the runs connected to each other. In the present embodiment, in order to efficiently execute the search process (step S4), a run connection table indicating a connection relationship between runs is provided. In this run connection table, run connection data id [m] is provided as data indicating the connection status of the run r [m], and the connection status between the run r [m] and other runs is indicated by the label number. For example, it is stored in the run connection data storage area of the labeling storage unit 645 in a table format as shown in FIG.

図4に戻ってラベリング処理の説明を続ける。本実施形態では、二値画像データBFIからランを作成した際に、ラン毎に、当該ランと当該ラン以外のランとの連結関係を示すラベルとして互いに異なるラベル番号を設定する(ステップS2)。本実施形態では、ランr[m]のラベル番号およびラン接続データid[m]のラベル番号をラン番号mと一致させている。つまり、ランr[0]、r[1]、…のラベル番号をそれぞれ「0」、「1」、…に初期設定するとともに、ラン接続データid[0]、id[1]、…のラベル番号についてもそれぞれ「0」、「1」、…に初期設定する。   Returning to FIG. 4, the description of the labeling process will be continued. In this embodiment, when a run is created from the binary image data BFI, a different label number is set for each run as a label indicating the connection relationship between the run and a run other than the run (step S2). In the present embodiment, the label number of the run r [m] and the label number of the run connection data id [m] are matched with the run number m. That is, the label numbers of the runs r [0], r [1],... Are initialized to “0”, “1”,... And the labels of the run connection data id [0], id [1],. The numbers are also initially set to “0”, “1”,.

次のステップS3では更新処理(ステップS3)が実行される。この更新処理では、ラン毎に個別更新処理が実行される。この「個別更新処理」とは、一のランを処理対象ランとするとともに当該処理対象ランの下行で縦および斜めに接続する連結ランが存在するか否かを判定し、連結ランが存在するときには、処理対象ランおよび連結ランのうちのラン接続データのラベル番号の大きい方を小さいラベル番号に更新する処理であり、本実施形態では複数個(例えばn個)のランのそれぞれについて個別更新処理を実行する。ここで、これらn個の個別更新処理をシリアル、例えばラン番号順に行うことも可能であるが、この場合、更新処理に多大な時間を費やしてしまう。   In the next step S3, update processing (step S3) is executed. In this update process, an individual update process is executed for each run. This “individual update process” is to determine whether or not there is a connected run that has one run as the processing target run and is connected vertically and diagonally in the lower row of the processing target run. In the present embodiment, individual update processing is performed for each of a plurality of (for example, n) runs. Run. Here, it is possible to perform these n individual update processes serially, for example, in the order of run numbers, but in this case, a great deal of time is spent on the update process.

そこで、本実施形態では、ラン毎の個別更新処理を一のスレッドとし、GPU642内の各プロセッサコア641によりスレッドが並列的に実行される。つまり、図3に示すように、第0プロセッサコア641ではランr[0]を処理対象ランとして個別更新処理が実行され、これに並行して第1プロセッサコア641ではランr[1]を処理対象ランとして個別更新処理が実行される。また、その他のランr[2]、r[3]、…、r[n]についても、上記個別更新処理と並行して実行される。ただし、各個別更新処理では、後述するようにラン接続データ中のラベル番号の更新作業が伴うため、本実施形態では並列処理制御部648がプロセッサコア641間での排他制御を行う。   Therefore, in this embodiment, the individual update process for each run is set as one thread, and the threads are executed in parallel by the processor cores 641 in the GPU 642. That is, as shown in FIG. 3, the 0th processor core 641 executes the individual update process with the run r [0] as the processing target run, and the first processor core 641 processes the run r [1] in parallel with this. The individual update process is executed as the target run. The other runs r [2], r [3],..., R [n] are also executed in parallel with the individual update process. However, since each individual update process involves an update of the label number in the run connection data as will be described later, the parallel processing control unit 648 performs exclusive control between the processor cores 641 in this embodiment.

図7は各プロセッサコアで実行される個別更新処理を示すフローチャートである。また、図8は各プロセッサコアで実行される個別更新処理の一例を示す模式図である。ここでは、まず図7を参照しつつラン番号p(p=0,1,2,…またはn)のランr[p]に対する個別更新処理の基本動作を説明し、その後で図8の具体例を参照しつつラベル番号の更新例について説明する。   FIG. 7 is a flowchart showing an individual update process executed by each processor core. FIG. 8 is a schematic diagram showing an example of an individual update process executed by each processor core. Here, first, the basic operation of the individual update process for the run r [p] of the run number p (p = 0, 1, 2,... Or n) will be described with reference to FIG. 7, and then the specific example of FIG. An example of updating the label number will be described with reference to FIG.

ランr[p]の個別更新処理は第pプロセッサコア641により以下の手順で実行される。ステップS11では、ランr[p]を処理対象ランとし、この処理対象ランr[p]の下行に接続されるランを第1連結ランとして抽出する。そして、第1連結ランが抽出されなかった場合(ステップS12で「NO」の場合)には、当該スレッドでの個別更新処理を終了する。   The individual update process for the run r [p] is executed by the p-th processor core 641 in the following procedure. In step S11, the run r [p] is set as the processing target run, and the run connected to the lower row of the processing target run r [p] is extracted as the first connected run. If the first connected run is not extracted (in the case of “NO” in step S12), the individual update process in the thread is terminated.

一方、第1連結ランが抽出された場合(ステップS12で「YES」の場合)には、以下のステップS13〜S21を実行してラベル番号の更新を行う。なお、ここでは、ランr[p]の下行に位置するランr[q]が第1連結ランとして抽出されたものとして説明を続ける。   On the other hand, when the first connected run is extracted (in the case of “YES” in step S12), the following steps S13 to S21 are executed to update the label number. Here, the description will be continued assuming that the run r [q] located in the lower row of the run r [p] is extracted as the first connected run.

次のステップS13では、ランr[p]、r[q]にそれぞれ対応するラン接続データid[p]、id[q]をラベリング用記憶部645から読み出す。ここで、ラン接続データid[p]、id[q]が同じ値、つまり同一のラベル番号が設定されており、既に連結関係が設定されている場合(ステップS14で「YES」の場合)には、当該個別更新処理を終了する。   In the next step S13, the run connection data id [p] and id [q] respectively corresponding to the runs r [p] and r [q] are read from the labeling storage unit 645. Here, when the run connection data id [p] and id [q] have the same value, that is, the same label number is set and the connection relationship has already been set (in the case of “YES” in step S14). Ends the individual update process.

一方、ステップS14で「NO」と判定される、つまりラン接続データid[p]、id[q]が異なっている(互いに異なるラベル番号が設定されている)場合には、ラン接続データの更新が行われる。このようにラン接続データid[p]、id[q]が相互に異なるということは、ラン[p]とラン[q]との間に連結関係が成立していないことを意味している。しかしながら、実際には接続関係が成立しているため、ラン接続データid[p]、id[q]の大小関係に応じて一方のラベル番号を他方のラベル番号に更新する(ステップS15〜S19)。   On the other hand, if “NO” is determined in step S14, that is, if the run connection data id [p] and id [q] are different (different label numbers are set), update of the run connection data is performed. Is done. As described above, the fact that the run connection data id [p] and id [q] are different from each other means that no connection relationship is established between the run [p] and the run [q]. However, since the connection relationship is actually established, one label number is updated to the other label number according to the size relationship between the run connection data id [p] and id [q] (steps S15 to S19). .

ステップS15でラン接続データid[p]、id[q]を対比し、その対比結果からラン接続データid[p]がラン接続データid[q]よりも大きなラベル番号であることが判明した場合には、ラン接続データid[p]をラン接続データid[q]に書き換え、ラン接続データid[p]をより小さなラベル番号に更新する(ステップS16)。また、このように変更される側のランr[p]のラベル番号を値(old_dum)として登録し、変更される前のラン接続データid[p]を値(old_id)として登録するとともに、変更された後のラン接続データid[p]を値(new_id)として登録する(ステップS17)。   When the run connection data id [p] and id [q] are compared in step S15, and it is found from the comparison result that the run connection data id [p] has a larger label number than the run connection data id [q]. , The run connection data id [p] is rewritten with the run connection data id [q], and the run connection data id [p] is updated to a smaller label number (step S16). In addition, the label number of the run r [p] on the side to be changed in this way is registered as a value (old_dum), and the run connection data id [p] before the change is registered as a value (old_id). The run connection data id [p] after being registered is registered as a value (new_id) (step S17).

逆に、ラン接続データid[q]がラン接続データid[p]よりも大きなラベル番号であることが判明した場合には、ラン接続データid[q]をラン接続データid[p]に書き換え、ラン接続データid[q]をより小さなラベル番号に更新する(ステップS18)。また、このように変更される側のランr[q]のラベル番号を値(old_dum)として登録し、変更される前のラン接続データid[q]を値(old_id)として登録するとともに、変更された後のラン接続データid[q]を値(new_id)として登録する(ステップS19)。   Conversely, when it is found that the run connection data id [q] has a larger label number than the run connection data id [p], the run connection data id [q] is rewritten to the run connection data id [p]. The run connection data id [q] is updated to a smaller label number (step S18). Further, the label number of the run r [q] on the side to be changed in this way is registered as a value (old_dum), the run connection data id [q] before the change is registered as a value (old_id), and the change is made The run connection data id [q] after being registered is registered as a value (new_id) (step S19).

そして、値(old_dum)と値(old_id)とが一致する場合(ステップS20で「YES」の場合)には、当該個別更新処理を終了する。一方、両者が一致しない場合(ステップS10で「NO」の場合)には、ラベル番号を更新した側のラン(以下「更新ラン」という)が処理対象ランおよび上記第1連結ラン以外のラン(以下「第2連結ラン」という)と連結している。そこで、このような第2連結ランが存在する場合には、ステップS21を実行した上でステップS13に戻る。すなわち、ステップS21ではラン番号pを値(old_id)に書き換えるとともにラン番号qを値(new_id)に書き換える。これによって、更新ランが新たなランr[p]として、また第2連結ランが新たなランr[q]として設定され、ステップS13に戻り、更新ランと第2連結ランとの間でラベル番号の異同をチェックし(ステップS14)、ラベル番号が異なる場合には大きい方のラベル番号を小さい方のラベル番号に更新する(ステップS15〜S19)。   When the value (old_dum) and the value (old_id) match (in the case of “YES” in step S20), the individual update process ends. On the other hand, if the two do not match (in the case of “NO” in step S10), the run whose label number has been updated (hereinafter referred to as “update run”) is a run other than the processing target run and the first linked run ( (Hereinafter referred to as “second connected run”). Therefore, when such a second linked run exists, step S21 is executed, and then the process returns to step S13. That is, in step S21, the run number p is rewritten to a value (old_id) and the run number q is rewritten to a value (new_id). As a result, the updated run is set as a new run r [p] and the second linked run is set as a new run r [q], and the process returns to step S13, and the label number is set between the updated run and the second linked run. (Step S14). If the label numbers are different, the larger label number is updated to the smaller label number (steps S15 to S19).

このように個別更新処理では、処理対象ランと直接的に接続する直接連結ランのみならず、当該直接連結ランを介して処理対象ランと間接的に接続する間接連結ランについてもラベル番号を更新している。   As described above, in the individual update process, the label number is updated not only for the directly connected run directly connected to the processing target run but also for the indirectly connected run indirectly connected to the processing target run through the directly connected run. ing.

次に、図6(a)および(b)に示すランr[0]〜r[4]に対して更新処理を実行した場合の一例(図8)を参照しつつ更新処理(ステップS3)の内容をさらに詳しく説明する。なお、図8中の縦軸は時間経過を表しており、開始時点ではラン接続データid[0]〜id[4]はそれぞれ初期値、つまり0〜4に設定されている。ラン接続データid[0]〜id[4]のうち梨字模様を付したものは更新変更後のラベル番号を示している。また、「第0スレッド」〜「第4スレッド」の下方に並んでいる項目(「連結ラン:存在」、「書換禁止」など)は各プロセッサコア641で実行される処理内容を示している。   Next, the update process (step S3) will be described with reference to an example (FIG. 8) in which the update process is executed for the runs r [0] to r [4] shown in FIGS. The contents will be described in more detail. The vertical axis in FIG. 8 represents the passage of time, and the run connection data id [0] to id [4] are set to initial values, that is, 0 to 4 at the start time. Of the run connection data id [0] to id [4], those with a pear pattern indicate the label number after the update change. Further, items (“connected run: existence”, “rewrite prohibition”, etc.) arranged below “0th thread” to “4th thread” indicate the contents of processing executed by each processor core 641.

n個のプロセッサコア641のうち5個のプロセッサコア641では、それぞれランr[0]〜r[4]の個別更新処理が並列的に実行される。これらのうちランr[3]、r[4]の個別更新処理はそれぞれ第3スレッドおよび第4スレッドとして実行されるが、ともに下行がなく、第1連結ランが存在しないために、早期にスレッド(ステップS3−3、S3−4)を終了し、個別更新処理を完了する。一方、ランr[0]〜r[2]の個別更新処理では連結ランが存在することが確認され、それらに対応するラン接続データの読出、対比、書換などが行われる。ここで、例えば第2スレッド(ランr[2]の個別更新処理)では、処理対象ランであるランr[2]と、それに接続する連結ランr[4]とのラン接続データid[2]、id[4]の値、つまりラベル番号が読み出される。ここでは、
id[2]=2、
id[4]=4、
となっている。これらを対比した結果、ラン接続データid[4]がラン接続データid[2]よりも大きい値であるため、ラン接続データid[4]のラベル番号をラン接続データid[2]のラベル番号に書き換える必要がある。こうして第2スレッドでの書換準備が最先に整うと、並列処理制御部648により第0スレッドおよび第1スレッドの個別更新処理におけるデータ書換が一時的に禁止された状態で、ラン接続データid[4]の書換が実行され、ラン接続データid[4]のラベル番号は「4」から「2」に更新される。また、更新されたランr[4]のラベル番号である値(old_dum)と、変更前のラン接続データid[4]である値(old_id)とはともに「4」であり、同じ値であることから第2スレッド(ステップS3−2)を終了する。
Of the n processor cores 641, five of the processor cores 641 execute the individual update processes of the runs r [0] to r [4] in parallel. Of these, the individual update processes of the runs r [3] and r [4] are executed as the third thread and the fourth thread, respectively, but both do not descend and the first linked run does not exist. (Steps S3-3 and S3-4) are terminated, and the individual update process is completed. On the other hand, in the individual update processing of the runs r [0] to r [2], it is confirmed that there are linked runs, and read, contrast, rewrite, and the like of the run connection data corresponding to them are performed. Here, for example, in the second thread (individual update process of run r [2]), run connection data id [2] between run r [2], which is the process target run, and linked run r [4] connected thereto. , Id [4], that is, the label number is read out. here,
id [2] = 2,
id [4] = 4,
It has become. As a result of comparison, since the run connection data id [4] has a larger value than the run connection data id [2], the label number of the run connection data id [4] is changed to the label number of the run connection data id [2]. Need to be rewritten. Thus, when the rewriting preparation in the second thread is first, the parallel connection control unit 648 temporarily disables the data rewriting in the individual update processing of the 0th thread and the 1st thread, and the run connection data id [ 4] is executed, and the label number of the run connection data id [4] is updated from “4” to “2”. Further, the value (old_dum) that is the label number of the updated run r [4] and the value (old_id) that is the run connection data id [4] before the change are both “4”, which is the same value. Thus, the second thread (step S3-2) is terminated.

次に、同図に示すように、第1スレッドにおいて書換準備が整うと、並列処理制御部648により第0スレッドの個別更新処理におけるデータ書換が一時的に禁止された状態で、ラン接続データid[2]、id[3]の書換が実行される。より具体的には、第1スレッド(ランr[1]の個別更新処理)では、処理対象ランであるランr[1]と下行でランr[2]、r[3]が接続しており、これらが第1連結ランと認定される。そして、処理対象ランr[1]のラン接続データid[1]と、連結ランr[2]、r[3]のラン接続データid[2]、id[3]とを読み出す。それらは、
id[1]=1、
id[2]=2、
id[3]=3、
となっている。これらを対比した結果、ラン接続データid[2]、id[3]はいずれもラン接続データid[1]よりも大きい値であるため、ラン接続データid[2]、id[3]のラベル番号をともにラン接続データid[1]のラベル番号に書き換える。また、更新されたランr[2]については、そのラベル番号である値(old_dum)と、変更前のラン接続データid[2]である値(old_id)とはともに「2」である。また、更新されたランr[3]については、そのラベル番号である値(old_dum)と、変更前のラン接続データid[3]である値(old_id)とはともに「3」である。このようにランr[2]、r[3]のいずれについても、値(old_dum)と値(old_id)とは同じ値であることから第1スレッド(ステップS3−1)を終了する。
Next, as shown in the figure, when the first thread is ready for rewriting, the parallel connection control unit 648 temporarily prohibits data rewriting in the individual update process of the 0th thread, and the run connection data id [2] and id [3] are rewritten. More specifically, in the first thread (individual update process of run r [1]), run r [1] that is the process target run and runs r [2] and r [3] are connected in the lower row. These are recognized as the first consolidated run. Then, the run connection data id [1] of the processing target run r [1] and the run connection data id [2] and id [3] of the linked runs r [2] and r [3] are read. They are,
id [1] = 1,
id [2] = 2,
id [3] = 3,
It has become. As a result of comparison, since the run connection data id [2] and id [3] are both larger values than the run connection data id [1], the labels of the run connection data id [2] and id [3] Both numbers are rewritten to the label number of the run connection data id [1]. For the updated run r [2], the value (old_dum) that is the label number and the value (old_id) that is the run connection data id [2] before the change are both “2”. For the updated run r [3], the value (old_dum) that is the label number and the value (old_id) that is the run connection data id [3] before the change are both “3”. As described above, since the value (old_dum) and the value (old_id) are the same for both the runs r [2] and r [3], the first thread (step S3-1) is terminated.

最後に残った第0スレッド(ランr[0]の個別更新処理)では、処理対象ランであるランr[0]と下行でランr[2]が接続しており、これを連結ランとして上記第1スレッドおよび第2スレッドと同様にしてラン接続データid[2]のラベル番号をラン接続データid[0]のラベル番号に書き換える。ただし、更新されたラン接続データid[2]は既に1回書き換えられて初期値(ランr[2]の初期ラベル番号=2)から「1」となっており、当該ランr[2]のラベル番号である値(old_dum)と、変更前のラン接続データid[2]である値(old_id)とはそれぞれ「2」、「1」であり、異なっている。そこで、図7のステップS21で実行しているように、ラン接続データid[0]、id[1]の読出、対比、書換を行い、図8の下部分に示すように、ラン接続データid[1]のラベル番号をラン接続データid[0]のラベル番号に書き換える。こうして、更新されたランr[1]のラベル番号である値(old_dum)と、変更前のラン接続データid[1]である値(old_id)とはともに「1」であり、同じ値であることから第0スレッド(ステップS3−0)を終了する。このように、ランr[1]は処理対象ランr[0]と直接的に接続されていないが、ランr[2]を介して間接的に接続されており、それについてもラン接続データの更新が行われる。   In the last remaining 0th thread (individual update process of run r [0]), run r [0], which is the process target run, and run r [2] are connected in the lower row, and this is used as a linked run. Similar to the first thread and the second thread, the label number of the run connection data id [2] is rewritten to the label number of the run connection data id [0]. However, the updated run connection data id [2] has already been rewritten once and becomes “1” from the initial value (initial label number = 2 of run r [2]). The value (old_dum) that is the label number and the value (old_id) that is the run connection data id [2] before the change are “2” and “1”, respectively, and are different. Therefore, the read connection data id [0] and id [1] are read, compared, and rewritten as executed in step S21 in FIG. 7, and the run connection data id is shown in the lower part of FIG. The label number of [1] is rewritten to the label number of run connection data id [0]. Thus, the value (old_dum) that is the label number of the updated run r [1] and the value (old_id) that is the run connection data id [1] before the change are both “1” and the same value. Thus, the 0th thread (step S3-0) is terminated. As described above, the run r [1] is not directly connected to the processing target run r [0], but is indirectly connected via the run r [2]. Updates are made.

こうして全てのスレッドが終了すると、更新処理(ステップS3)が完了し、図6(a)および(b)に示すランr[0]〜r[4]に対して更新処理を実行することでラン接続データid[0]〜id[4]が(0,1,2,3,4)から(0,0,0,1,2)に更新される。なお、上記説明からわかるように、1スレッド1ランで並行処理しているため、どのランが先に処理されるかによって更新処理後のラン接続データid[0]〜id[4]のラベル番号は異なる値を取り得る。   When all the threads are finished in this way, the update process (step S3) is completed, and the update process is executed on the runs r [0] to r [4] shown in FIGS. 6A and 6B. The connection data id [0] to id [4] is updated from (0, 1, 2, 3, 4) to (0, 0, 0, 1, 2). As can be seen from the above description, since parallel processing is performed in one thread and one run, the label numbers of the run connection data id [0] to id [4] after the update processing depend on which run is processed first. Can take different values.

次に、図4に戻ってラベリング処理の説明を続ける。上記更新処理(ステップS3)が完了すると、探索処理(ステップS4)を実行する。この探索処理も更新処理と同様に、ラン毎の個別探索処理を一のスレッドとし、並列処理制御部648により書換タイミングを制御しながらGPU642内の各プロセッサコア641によりスレッドを並列的に実行する。つまり、図3に示すように、第0プロセッサコア641ではランr[0]を処理対象ランとして個別探索処理が実行され、これに並行して第1プロセッサコア641ではランr[1]を処理対象ランとして個別探索処理が実行される。また、その他のランr[2]、r[3]、…、r[n]についても、上記個別探索処理と並行して実行される。なお、「個別探索処理」とは、一のランを処理対象ランとするとともに当該処理対象ランに接続する連結ランをデータ接続表(ラン接続データid[0]、id[1]、…、id[n])に基づいて見つけ出して処理対象ランおよび連結ランのラベル番号を同一に書き換えるものである。以下、図9および図10を参照しつつ個別探索処理について詳述する。   Next, returning to FIG. 4, the description of the labeling process will be continued. When the update process (step S3) is completed, a search process (step S4) is executed. Similarly to the update process, the individual search process for each run is set as one thread, and the thread is executed in parallel by each processor core 641 in the GPU 642 while the rewrite timing is controlled by the parallel processing control unit 648. In other words, as shown in FIG. 3, the 0th processor core 641 executes the individual search process with the run r [0] as the processing target run, and the first processor core 641 processes the run r [1] in parallel therewith. An individual search process is executed as the target run. The other runs r [2], r [3],..., R [n] are also executed in parallel with the individual search process. The “individual search process” refers to one run as a process target run and a connected run connected to the process target run in a data connection table (run connection data id [0], id [1],..., Id [N]), the label numbers of the processing target run and the linked run are rewritten to be the same. Hereinafter, the individual search process will be described in detail with reference to FIGS. 9 and 10.

図9は各プロセッサコアで実行される個別探索処理を示すフローチャートである。また、図10は各プロセッサコアで実行される個別探索処理の一例を示す模式図である。ここにおいても、個別更新処理の場合と同様に、まず図9を参照しつつランr[p]に対する個別探索処理の基本動作を説明し、その後で図10の具体例を参照しつつラベル番号の書換例について説明する。   FIG. 9 is a flowchart showing an individual search process executed by each processor core. FIG. 10 is a schematic diagram showing an example of an individual search process executed by each processor core. Here, as in the case of the individual update process, first, the basic operation of the individual search process for the run r [p] will be described with reference to FIG. 9, and then the label number will be changed with reference to the specific example of FIG. An example of rewriting will be described.

ランr[p]の個別探索処理は第pプロセッサコア641により以下の手順で実行される。ステップS31では、ランr[p]を処理対象ランとし、この処理対象ランr[p]に対応するラン接続データid[p]をラン接続表から読み出し、取得する。そして、そのラン接続データid[p]が処理対象ランr[p]のラベル番号の初期値と等しいか否かを判定する(ステップS32)。ここで、同一であると判定した場合には、そのまま個別探索処理を完了する。一方、異なると判定した場合(ステップS32で「NO」の場合)には、ステップS33〜S38を実行してラベル番号の書換を行う。   The individual search process for the run r [p] is executed by the p-th processor core 641 according to the following procedure. In step S31, the run r [p] is a process target run, and the run connection data id [p] corresponding to the process target run r [p] is read from the run connection table and acquired. Then, it is determined whether or not the run connection data id [p] is equal to the initial value of the label number of the processing target run r [p] (step S32). Here, if it is determined that they are the same, the individual search process is completed as it is. On the other hand, if it is determined that they are different (in the case of “NO” in step S32), steps S33 to S38 are executed to rewrite the label number.

ステップS33でラン接続データid[p]を値(new_dum)として登録した後、ラン接続データid[new_dum]をラン接続表から読み出す(ステップS34)。そして、ラン接続データid[new_dum]と、値(new_dum)とが等しいか否かを判定し(ステップS35)、それらが等しくないと判定する間、値(new_dum)をラン接続データid[new_dum]に書き換え(ステップS36)、ステップS34に戻って新たなラン接続データid[new_dum]の読出を繰り返す。   After registering the run connection data id [p] as a value (new_dum) in step S33, the run connection data id [new_dum] is read from the run connection table (step S34). Then, it is determined whether or not the run connection data id [new_dum] is equal to the value (new_dum) (step S35). While it is determined that they are not equal, the value (new_dum) is changed to the run connection data id [new_dum]. (Step S36), the process returns to step S34, and reading of new run connection data id [new_dum] is repeated.

そして、ラン接続データid[new_dum]と、値(new_dum)とが一致した時点(ステップS35で「YES」と判定された時点)で、ラン番号pのランr[p]のラベル番号を値(new_dum)に書き換える(ステップS37)。また、ラン接続データid[p]についても、同様に値(new_dum)に書き換え(ステップS38)、当該個別探索処理を終了する。なお、この書換は個別更新処理の場合と同様に並列処理制御部648により書換タイミングを制御された状態で実行される。   Then, when the run connection data id [new_dum] matches the value (new_dum) (when it is determined “YES” in step S35), the label number of the run r [p] of the run number p is set to the value ( new_dum) (step S37). Similarly, the run connection data id [p] is also rewritten to a value (new_dum) (step S38), and the individual search process is terminated. This rewriting is executed in a state in which the rewriting timing is controlled by the parallel processing control unit 648 as in the case of the individual update processing.

次に、図8に示すように更新処理によってラン接続表が初期状態から更新されるのに続いて探索処理を実行した場合の一例(図10)を参照しつつ探索処理(ステップS4)の内容をさらに詳しく説明する。なお、ここでは、ランr[4]を処理対象ランとする個別探索処理について図10を参照しつつ説明する。図10中の縦軸は時間経過を表しており、ランr[0]〜r[4]のラベル番号の初期値はそれぞれ0〜4に設定されている。ラベル番号のうち梨地模様を付したものは探索対象となっているラベル番号を示している。また、「第4スレッド」の下方に並んでいる項目(「id[4]の取得→id[4]=2」など)は第4プロセッサコア641で実行される処理内容を示している。   Next, as shown in FIG. 8, the contents of the search process (step S <b> 4) with reference to an example (FIG. 10) when the search process is executed after the run connection table is updated from the initial state by the update process. Will be described in more detail. Here, an individual search process using the run r [4] as a process target run will be described with reference to FIG. The vertical axis in FIG. 10 represents the passage of time, and the initial values of the label numbers of the runs r [0] to r [4] are set to 0 to 4, respectively. Among the label numbers, those with a satin pattern indicate the label numbers to be searched. In addition, items arranged below “fourth thread” (such as “acquisition of id [4] → id [4] = 2”) indicate processing contents executed by the fourth processor core 641.

第4プロセッサコア641では、ランr[4]を処理対象ランとし、この処理対象ランr[4]に対応するラン接続データid[4]をラン接続表から読み出し、この値(=2)をランr[4]のラベル番号の初期値(=4)と対比したところ、両者が不一致であることを確認する。すると、読み出し対象を、ラン接続データid[4]が示すラベル番号(new_dum)のラン接続データid[new_dum]、つまりラン接続データid[2]に移動し、ラン接続表からラン接続データid[2]を読み出し、この値(=0)をランr[2]のラベル番号の初期値(=2)と対比する。そして、両者が不一致であることを確認すると、再び読み出し対象を、ラン接続データid[2]が示すラベル番号(new_dum)のラン接続データid[new_dum]、つまりラン接続データid[0]に移動し、ラン接続表からラン接続データid[0]を読み出し、この値(=0)をランr[0]のラベル番号の初期値(=0)と対比する。すると、両者が一致することを確認し、処理対象ランr[4]のラベル番号をその値に書き換え、このスレッドを終了する。なお、その他のスレッドについても同様の個別探索処理が実行され、その結果、互いに接続するランが探索されて同一のラベルが付与される。例えば図5に示す二値画像データに対してランレングス化処理して得られたランr[0]〜r[4](図6参照)については同一のラベル(=0)が付与される。   The fourth processor core 641 sets the run r [4] as a process target run, reads the run connection data id [4] corresponding to the process target run r [4] from the run connection table, and sets this value (= 2). When compared with the initial value (= 4) of the label number of run r [4], it is confirmed that the two do not match. Then, the read target is moved to the run connection data id [new_dum] of the label number (new_dum) indicated by the run connection data id [4], that is, the run connection data id [2], and the run connection data id [[ 2] is read, and this value (= 0) is compared with the initial value (= 2) of the label number of run r [2]. When it is confirmed that they do not match, the read target is moved again to the run connection data id [new_dum] of the label number (new_dum) indicated by the run connection data id [2], that is, the run connection data id [0]. Then, the run connection data id [0] is read from the run connection table, and this value (= 0) is compared with the initial value (= 0) of the label number of the run r [0]. Then, it is confirmed that they match each other, the label number of the processing target run r [4] is rewritten with the value, and this thread is terminated. Note that the same individual search process is executed for the other threads, and as a result, the runs connected to each other are searched and given the same label. For example, the same label (= 0) is assigned to the runs r [0] to r [4] (see FIG. 6) obtained by performing the run length processing on the binary image data shown in FIG.

以上のように、本実施形態では、ランr[m]毎に互いに異なる値を有するラベル番号が初期設定された後、更新処理(ステップS3)および探索処理(ステップS4)の2パス工程を実行している。これらのうち更新処理(ステップS3)では、ランr[m]毎に、個別更新処理(ステップS3−0、S3−1、…)を実行して処理対象ランに接続する連結ランが存在するか否かに応じてラベル番号を更新している。また、探索処理(ステップS4)では、ランr[m]毎に、個別探索処理(ステップS4−0、S4−1、…)を実行して処理対象ランに接続する連結ランを更新後のラベル番号に基づいて見つけ出して処理対象ランおよび連結ランのラベルを同一に書き換えている。このように、ランの個数mと同数個のラベル番号によって二値画像データBFIのラベリング処理を行うことができ、ラベリング処理を高速化することができる。   As described above, in this embodiment, after the label numbers having different values are initialized for each run r [m], the two-pass process of the update process (step S3) and the search process (step S4) is executed. doing. Of these, in the update process (step S3), for each run r [m], is there a linked run that executes the individual update process (steps S3-0, S3-1,...) And connects to the process target run? The label number is updated according to whether or not. Further, in the search process (step S4), for each run r [m], the individual search process (steps S4-0, S4-1,...) Is executed and the linked run connected to the process target run is updated. Based on the number, the labels of the processing target run and the linked run are rewritten to be the same. Thus, the labeling process of the binary image data BFI can be performed with the same number of label numbers as the number m of runs, and the labeling process can be speeded up.

また、更新処理(ステップS3)および探索処理(ステップS4)のいずれも、1ラン1スレッドでラン毎の個別更新処理および個別探索処理を並列的に実行しているため、ラベリング処理に要するトータル時間を大幅に短縮することができる。   In addition, since both the update process (step S3) and the search process (step S4) execute the individual update process and the individual search process for each run in parallel in one run and one thread, the total time required for the labeling process Can be greatly shortened.

さらに、個別更新処理(ステップS3−0、S3−1、…)においては、処理対象ランに直接接続する第1連結ランのラベル番号を更新した際には、その第1連結ランのみならず、第1連結ランに接続する処理対象ラン以外の第2連結ランが存在する場合には、第2連結ランについてもラベル更新するように構成している。そのため、処理対象ランに対する個別更新処理よりも後で実行される第2連結ランに対する個別更新処理に要する時間を短縮することができる。その結果、トータルの処理時間を短縮することができる。   Furthermore, in the individual update process (steps S3-0, S3-1,...), When the label number of the first linked run directly connected to the processing target run is updated, not only the first linked run, When there is a second linked run other than the process target run connected to the first linked run, the second linked run is also updated. Therefore, the time required for the individual update process for the second linked run executed after the individual update process for the processing target run can be reduced. As a result, the total processing time can be shortened.

なお、本発明は上記した実施形態に限定されるものではなく、その趣旨を逸脱しない限りにおいて上述したもの以外に種々の変更を行うことが可能である。例えば、上記実施形態では、1ラン1スレッドにより個別更新処理を並列的に実行しているが、複数のランr[m]の分割態様はこれに限定されるものではない。つまり、プロセッサコア641の個数に応じて複数のランr[m]の分割態様を適宜変更してもよく、複数のランr[m]をプロセッサコア641の個数に応じて複数組に分割し、各プロセッサコアが分割された一または複数のランについて個別更新処理を更新スレッドとして実行するように構成してもよい。これらの点については個別探索処理でも全く同様である。   The present invention is not limited to the above-described embodiment, and various modifications other than those described above can be made without departing from the spirit of the present invention. For example, in the above embodiment, the individual update processing is executed in parallel by one run and one thread, but the division mode of the plurality of runs r [m] is not limited to this. That is, the division mode of the plurality of runs r [m] may be appropriately changed according to the number of the processor cores 641, and the plurality of runs r [m] are divided into a plurality of sets according to the number of the processor cores 641. An individual update process may be executed as an update thread for one or a plurality of runs into which each processor core is divided. These points are exactly the same in the individual search process.

また、上記実施形態では、個別更新処理および個別更新処理を実行するために複数のプロセッサコア641を有するGPU642を用いているが、GPUの代わりに複数のCPUを設け、各CPUで一のスレッドを実行するように構成してもよい。また、GPU642内に演算処理部646やラベリング用記憶部645を設けてもよい。   In the above embodiment, the GPU 642 having a plurality of processor cores 641 is used to execute the individual update process and the individual update process. However, instead of the GPU, a plurality of CPUs are provided, and each CPU has one thread. It may be configured to execute. Further, an arithmetic processing unit 646 and a labeling storage unit 645 may be provided in the GPU 642.

また、上記実施形態では、第0〜第nプロセッサコア641の上位に位置する並列処理制御部648がラベリング用記憶部645のアクセス管理を行い、更新処理および探索処理のいずれにおいても、一のスレッドによるデータ書換に応じて他のスレッドによるデータ書換を一時的に禁止している。つまり、一のスレッドで例えばラン接続データid[m](ただし、0≦m≦n)の書換を行う場合、他のスレッドがラン接続データid[m]を書き換えるのを一時的に禁止してラベル更新の競合を回避するのみならず、それ以外のラン接続データの書換も一時的に禁止している。このようなアクセス管理は必ずしも最適なものであるといえず、改善の余地がある。例えば処理速度のさらなる向上を図るためには、並列処理制御部648によるラベリング用記憶部645のアクセス管理を以下のように実行するのが望ましい。すなわち、一のスレッドでラン接続データid[m]の書換を行う時には、他のスレッドがラン接続データid[m]を書き換えるのを一時的に禁止してラベル更新の競合を回避する一方で、ラン接続データid[m]以外のラン接続データへのアクセスを自由化してデータ書換を許可するのが好適である。   In the above-described embodiment, the parallel processing control unit 648 positioned above the 0th to nth processor cores 641 performs access management of the labeling storage unit 645, and one thread is used in both the update processing and the search processing. According to the data rewriting by, data rewriting by other threads is temporarily prohibited. That is, for example, when rewriting run connection data id [m] (however, 0 ≦ m ≦ n) in one thread, other threads are temporarily prohibited from rewriting run connection data id [m]. In addition to avoiding label update conflict, rewriting of other run connection data is temporarily prohibited. Such access management is not necessarily optimal, and there is room for improvement. For example, in order to further improve the processing speed, it is desirable to execute access management of the labeling storage unit 645 by the parallel processing control unit 648 as follows. That is, when the run connection data id [m] is rewritten by one thread, the other thread temporarily prohibits rewriting the run connection data id [m] to avoid label update contention. It is preferable to permit data rewriting by liberalizing access to run connection data other than the run connection data id [m].

また、上記実施形態では、二値画像データBFIを行毎にランレングス化してランr[m]を得るとともに、処理対象ランの下行で、且つ縦および斜め方向に接続するランを連結ランとして判定しているが、ランレングス化の態様も連結ランの判定態様もこれに限定されるものではなく、例えば列毎にランレングス化し、当該ランレングス化処理により作成されたランに対して本発明にかかるラベリング方法を適用することができる。また、上記実施形態では、上記したように下行のランに対する8近傍探索により連結ランを決定しているが、その他の探索方法、例えば4近傍探索により連結ランを決定してしてもよい。 また、上記実施形態のランレングス化処理では画像全体で一度にランを生成しているが、画像を適当なサイズ領域に分断し、各分断範囲でランを生成してもよい。ただし、この場合には、分断領域同士の境界でランの接続判定処理を行う必要がある。   Further, in the above embodiment, the binary image data BFI is run length for each row to obtain the run r [m], and the run that is connected to the processing target run in the vertical and diagonal directions is determined as a connected run. However, neither the run-length mode nor the connected run determination mode is limited to this. For example, the run-length mode is run for each column, and the run created by the run-length process is applied to the present invention. Such a labeling method can be applied. In the above embodiment, as described above, the linked run is determined by the 8-neighbor search for the descending run. However, the linked run may be determined by another search method, for example, the 4-neighbor search. In the run length conversion process of the above embodiment, the run is generated for the entire image at one time. However, the run may be generated in each divided range by dividing the image into appropriate size regions. However, in this case, it is necessary to perform a run connection determination process at the boundary between the divided regions.

また、上記実施形態では、連番のラベル番号(0,1,2,…)が本発明の「ラベル」として用いられているが、これと異なる番号や番号以外の値を本発明の「ラベル」として用いてもよい。また、より小さな番号に書き換えてラベル更新しているが、ラベル更新の態様もこれに限定されるものではない。   In the above-described embodiment, the serial number (0, 1, 2,...) Is used as the “label” of the present invention, but a different number or a value other than the number is used as the “label” of the present invention. May be used. Moreover, although the label is updated by rewriting to a smaller number, the manner of label update is not limited to this.

さらに、上記実施形態では、装置内部で二値画像データBFIをランレングス化した後、当該ランレングス化処理により作成されたランに対してラベリング処理を施しているが、本発明に適用対象はこれに限定されるものではなく、例えば外部装置により作成されたランをラベリングする装置や方法に対して本発明を適用してもよい。   Furthermore, in the above embodiment, the binary image data BFI is run-length inside the apparatus, and then the labeling process is performed on the run created by the run-length process. For example, the present invention may be applied to an apparatus or method for labeling a run created by an external apparatus.

この発明は、二値画像データをランレングス化して作成された複数のランに対してラベルを付与するラベリング技術に対して好適に適用することができる。   The present invention can be suitably applied to a labeling technique for assigning labels to a plurality of runs created by converting the binary image data into run lengths.

1…検査システム
5…画像取得部
6…画像処理部
21…撮像部
62…差分抽出部(画像抽出部)
63…二値化処理部
64…ラベリング部
641…プロセッサコア
642…GPU
643…個別更新処理部
644…個別探索処理部
645…ラベリング用記憶部
646…演算処理部(制御部)
647…ラン生成部
648…並列処理制御部
649…データ初期設定部
DESCRIPTION OF SYMBOLS 1 ... Inspection system 5 ... Image acquisition part 6 ... Image processing part 21 ... Imaging part 62 ... Difference extraction part (image extraction part)
63: Binarization processing unit 64: Labeling unit 641 ... Processor core 642 ... GPU
643 ... Individual update processing unit 644 ... Individual search processing unit 645 ... Labeling storage unit 646 ... Calculation processing unit (control unit)
647 ... run generation unit 648 ... parallel processing control unit 649 ... data initial setting unit

Claims (11)

二値画像データをランレングス化して作成された複数のランに対してラベリング処理を施すラベリング方法であって、
各ランに対して互いに異なるラベルを設定する初期ラベル設定工程と、
前記ラン毎に、当該ランを処理対象ランとするとともに当該処理対象ランに接続する第1連結ランが存在するか否かを判定し、前記第1連結ランが存在するときには、前記処理対象ランおよび前記第1連結ランのうちの一方のラベルを他方のラベルに更新する個別更新処理を行う更新工程と、
前記更新工程後に、前記複数のラベルに基づいて前記複数のランのうち互いに接続するランを探索して同一のラベルを付与する探索工程とを備え、
前記更新工程では、前記複数のランを複数組に分割するとともに各組で実行される個別更新処理を更新スレッドとし、排他制御のもと前記複数の更新スレッドのうち一の更新スレッドによるラベルの書換を許可するとともに前記一の更新スレッドにより書き換えられるラベルの他の更新スレッドによる書換を禁止しながら前記複数の更新スレッドを並列して実行することを特徴とするラベリング方法。
A labeling method for performing a labeling process on a plurality of runs created by converting the binary image data into run lengths,
An initial label setting step for setting different labels for each run;
For each run, it is determined whether or not there is a first connected run connected to the target run and the target run. When the first connected run exists, the target run and An update process for performing an individual update process for updating one label of the first linked runs to the other label;
After the updating step, a search step of searching for a run connected to each other among the plurality of runs based on the plurality of labels and providing the same label,
In the update step, the plurality of runs are divided into a plurality of sets, and an individual update process executed in each set is used as an update thread, and the label is rewritten by one update thread among the plurality of update threads under exclusive control. A labeling method wherein the plurality of update threads are executed in parallel while prohibiting rewriting by another update thread of a label rewritten by the one update thread.
請求項1に記載のラベリング方法であって、
前記更新工程では、前記一の更新スレッドにより書き換えられるラベル以外のラベルの前記他の更新スレッドによる書換を許可するラベリング方法。
The labeling method according to claim 1,
In the update step, a labeling method for permitting rewriting by the other update thread of a label other than the label rewritten by the one update thread.
請求項1または2に記載のラベリング方法であって、
前記個別更新処理では、前記処理対象ランおよび前記第1連結ランのうちラベルを更新した方のランを更新ランとし、当該更新ランに対して前記処理対象ランおよび前記第1連結ラン以外の第2連結ランが接続するか否かを判定し、前記第2連結ランが存在するときには、さらに前記更新ランおよび前記第2連結ランのうち一方のラベルを他方のラベルに更新するラベリング方法。
A labeling method according to claim 1 or 2,
In the individual update process, the run whose label has been updated among the process target run and the first connected run is set as an update run, and a second other than the process target run and the first connected run with respect to the update run. A labeling method for determining whether or not a connected run is connected, and further updating one label of the updated run and the second connected run to the other label when the second connected run exists.
請求項1ないし3のいずれか一項に記載のラベリング方法であって、
前記複数のランは前記二値画像データを行毎にランレングス化して得られるものであり、
前記個別更新処理では、前記処理対象ランの下行に接続するランを前記第1連結ランとして判定するラベリング方法。
A labeling method according to any one of claims 1 to 3,
The plurality of runs are obtained by converting the binary image data into run lengths for each row,
In the individual update process, a labeling method for determining a run connected to the downstream of the processing target run as the first linked run.
請求項1ないし4のいずれか一項に記載のラベリング方法であって、
前記探索工程では、前記ラン毎に、当該ランを処理対象ランとするとともに当該処理対象ランに接続する連結ランを前記複数のラベルに基づいて見つけ出して前記処理対象ランおよび前記連結ランのラベルを同一に書き換える個別探索処理を実行するラベリング方法。
A labeling method according to any one of claims 1 to 4,
In the search step, for each of the runs, the run is set as a process target run and a connected run connected to the process target run is found based on the plurality of labels, and the label of the process target run and the connected run is the same. A labeling method that executes individual search processing to be rewritten.
請求項5に記載のラベリング方法であって、
前記探索工程では、前記複数のランを複数組に分割するとともに各組で実行される個別探索処理を探索スレッドとし、排他制御のもと前記複数の探索スレッドのうち一の探索スレッドによるラベルの書換を許可するとともに前記一の探索スレッドにより書き換えられるラベルの他の探索スレッドによる書換を禁止しながら前記複数の探索スレッドを並列して実行するラベリング方法。
The labeling method according to claim 5,
In the search step, the plurality of runs are divided into a plurality of sets, and individual search processing executed in each set is set as a search thread, and rewriting of a label by one search thread among the plurality of search threads under exclusive control. A labeling method that executes the plurality of search threads in parallel while prohibiting rewriting by another search thread of a label that is rewritten by the one search thread.
請求項6に記載のラベリング方法であって、
前記探索工程では、前記一の探索スレッドにより書き換えられるラベル以外のラベルの前記他の探索スレッドによる書換を許可するラベリング方法。
The labeling method according to claim 6,
In the searching step, a labeling method for permitting rewriting of a label other than the label rewritten by the one searching thread by the other searching thread.
二値画像データをランレングス化して作成された複数のランに対してラベリング処理を施すラベリング装置であって、
各ランのラベルを記憶する記憶部と、
演算処理を行うプロセッサコアを複数個有するプロセッサ部と、
前記複数のラベルに互いに異なる値を初期設定した後で、前記ラン毎に、当該ランを処理対象ランとするとともに当該処理対象ランに接続する第1連結ランが存在するか否かを判定し、前記第1連結ランが存在するときには、前記処理対象ランおよび前記第1連結ランのうちの一方のラベルを他方のラベルに更新する個別更新処理を行い、さらに前記複数のラベルに基づいて前記複数のランのうち互いに接続するランを探索して同一のラベルを付与する制御部とを備え、
前記複数のランは前記プロセッサコアの個数に応じて複数組に分割され、
各プロセッサコアは分割された一または複数のランについて前記個別更新処理を更新スレッドとして実行し、
前記制御部は、排他制御のもと前記複数の更新スレッドのうち一の更新スレッドによるラベルの書換を許可するとともに前記一の更新スレッドにより書き換えられるラベルの他の更新スレッドによる書換を禁止しながら前記複数の更新スレッドを並列して実行させることで前記ラン毎の個別更新処理を行うことを特徴とするラベリング装置。
A labeling device that performs a labeling process on a plurality of runs created by converting binary image data into run lengths,
A storage unit for storing the label of each run;
A processor unit having a plurality of processor cores for performing arithmetic processing;
After initially setting different values for the plurality of labels, for each run, it is determined whether or not there is a first linked run that is the target run and connected to the target run. When the first linked run exists, an individual update process for updating one label of the processing target run and the first linked run to the other label is performed, and the plurality of labels are further updated based on the plurality of labels. A controller that searches for orchids connected to each other and assigns the same label,
The plurality of runs are divided into a plurality of sets according to the number of the processor cores,
Each processor core executes the individual update process as an update thread for one or more divided runs,
The control unit permits rewriting of a label by one update thread among the plurality of update threads under exclusive control and prohibits rewriting by another update thread of a label rewritten by the one update thread. A labeling device that performs an individual update process for each run by executing a plurality of update threads in parallel.
請求項8に記載のラベリング装置であって、
前記制御部は、前記ラン毎に、当該ランを処理対象ランとするとともに当該処理対象ランに接続する連結ランを前記複数のラベルに基づいて見つけ出して前記処理対象ランおよび前記連結ランのラベルを同一に書き換える個別探索処理を実行するラベリング装置。
A labeling device according to claim 8,
The control unit, for each run, sets the run as a processing target run and finds a connected run connected to the processing target run based on the plurality of labels, so that the label of the processing target run and the connection run is the same A labeling device that executes an individual search process to be rewritten.
請求項9に記載のラベリング装置であって、
各プロセッサコアは分割された一または複数のランについて前記個別探索処理を探索スレッドとして実行し、
前記制御部は、排他制御のもと前記複数の探索スレッドのうち一の探索スレッドによるラベルの書換を許可するとともに前記一の探索スレッドにより書き換えられるラベルの他の探索スレッドによる書換を禁止ながら前記複数の探索スレッドを並列して実行させることで前記ラン毎の個別探索処理を行うラベリング装置。
The labeling device according to claim 9,
Each processor core executes the individual search process as a search thread for one or a plurality of divided runs,
The control unit permits rewriting of a label by one search thread among the plurality of search threads under exclusive control and prohibits rewriting by another search thread of a label rewritten by the one search thread. A labeling device that performs individual search processing for each run by executing the search threads in parallel.
検査対象画像を取得する画像取得部と、
前記検査対象画像を検査して欠陥部位が含まれる欠陥画像を抽出する画像抽出部と、
前記欠陥画像を二値化処理して二値画像データを生成する二値化処理部と、
前記二値画像データをランレングス化して複数のランを生成するラン生成部と、
請求項8ないし10のいずれか一項に記載のラベリング装置と同一構成を有し、前記複数のランのうち互いに接続するランに対して同一のラベルを付与するラベリング手段と
を備えることを特徴とする欠陥検査装置。
An image acquisition unit for acquiring an image to be inspected;
An image extraction unit that inspects the inspection target image and extracts a defect image including a defective portion;
A binarization processing unit that binarizes the defect image to generate binary image data;
A run generation unit that generates a plurality of runs by converting the binary image data into a run length;
A labeling device having the same configuration as the labeling device according to any one of claims 8 to 10, further comprising labeling means for giving the same label to runs connected to each other among the plurality of runs. Defect inspection equipment.
JP2013217278A 2013-03-22 2013-10-18 Labeling method, labeling device and defect inspection device Active JP6152034B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2013217278A JP6152034B2 (en) 2013-03-22 2013-10-18 Labeling method, labeling device and defect inspection device
KR1020130161353A KR101521725B1 (en) 2013-03-22 2013-12-23 Labeling method, labeling apparatus and defect inspection apparatus
CN201310751463.7A CN104063270B (en) 2013-03-22 2013-12-31 Labeling method, tag device and flaw detection apparatus
TW103101220A TWI512687B (en) 2013-03-22 2014-01-14 Labeling method, labeling apparatus and defect inspecting apparatus

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2013059728 2013-03-22
JP2013059728 2013-03-22
JP2013217278A JP6152034B2 (en) 2013-03-22 2013-10-18 Labeling method, labeling device and defect inspection device

Publications (2)

Publication Number Publication Date
JP2014209310A true JP2014209310A (en) 2014-11-06
JP6152034B2 JP6152034B2 (en) 2017-06-21

Family

ID=51903498

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013217278A Active JP6152034B2 (en) 2013-03-22 2013-10-18 Labeling method, labeling device and defect inspection device

Country Status (3)

Country Link
JP (1) JP6152034B2 (en)
KR (1) KR101521725B1 (en)
TW (1) TWI512687B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116028141A (en) * 2023-03-30 2023-04-28 菲特(天津)检测技术有限公司 Tag data processing method and system and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254924A (en) * 2020-02-13 2021-08-13 斑马智行网络(香港)有限公司 Data processing method, resource access method, device and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165955A (en) * 1991-12-13 1993-07-02 Sony Corp Image processing method
JP2005189966A (en) * 2003-12-24 2005-07-14 Ricoh Co Ltd Image processing device
JP2008186124A (en) * 2007-01-29 2008-08-14 Seiko Epson Corp Method, program, and device for processing image data

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3583684B2 (en) * 2000-01-12 2004-11-04 シャープ株式会社 Image defect detection apparatus and image defect detection method
JP2002230540A (en) * 2001-02-02 2002-08-16 Fuji Xerox Co Ltd Image processing method
US7310722B2 (en) * 2003-12-18 2007-12-18 Nvidia Corporation Across-thread out of order instruction dispatch in a multithreaded graphics processor
JP2008186123A (en) * 2007-01-29 2008-08-14 Seiko Epson Corp Method, program, and device for processing image data
US7876328B2 (en) * 2007-02-08 2011-01-25 Via Technologies, Inc. Managing multiple contexts in a decentralized graphics processing unit
JP2009145285A (en) * 2007-12-18 2009-07-02 Dainippon Screen Mfg Co Ltd Defect detecting method and defect detecting apparatus
JP2009211331A (en) * 2008-03-03 2009-09-17 Sony Corp Image processing method
JP5159373B2 (en) * 2008-03-06 2013-03-06 オリンパス株式会社 Board inspection method
JP2009262161A (en) * 2008-04-22 2009-11-12 Olympus Corp Correcting apparatus, correcting method, control device, and program
US8082426B2 (en) * 2008-11-06 2011-12-20 Via Technologies, Inc. Support of a plurality of graphic processing units
JP5537282B2 (en) * 2009-09-28 2014-07-02 株式会社日立ハイテクノロジーズ Defect inspection apparatus and defect inspection method
CN102169093B (en) * 2010-12-20 2012-10-10 湖南大学 Multi-station machine vision imaging detection method and system based on graphics processor
JP5697475B2 (en) * 2011-02-07 2015-04-08 キヤノン株式会社 Labeling processing apparatus and labeling processing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165955A (en) * 1991-12-13 1993-07-02 Sony Corp Image processing method
JP2005189966A (en) * 2003-12-24 2005-07-14 Ricoh Co Ltd Image processing device
JP2008186124A (en) * 2007-01-29 2008-08-14 Seiko Epson Corp Method, program, and device for processing image data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
井村 誠孝、外2名: ""GPUを用いた画像の連結成分抽出に関する一考察"", 情報処理学会研究報告 グラフィクスとCAD(CG), vol. No.138, JPN6017018241, 15 April 2010 (2010-04-15), JP, pages 1 - 5 *
東海林 健二、宮道 壽一: ""ラン情報を用いた高速連結成分ラベリング"", 電気学会論文誌C, vol. 121, no. 2, JPN6017018239, 1 February 2001 (2001-02-01), JP, pages 392 - 400 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116028141A (en) * 2023-03-30 2023-04-28 菲特(天津)检测技术有限公司 Tag data processing method and system and electronic equipment

Also Published As

Publication number Publication date
TW201437968A (en) 2014-10-01
KR101521725B1 (en) 2015-05-19
JP6152034B2 (en) 2017-06-21
KR20140115931A (en) 2014-10-01
TWI512687B (en) 2015-12-11

Similar Documents

Publication Publication Date Title
US7171039B2 (en) Defect classification/inspection system
JP6544716B2 (en) DATA GENERATION APPARATUS, DATA GENERATION METHOD, AND DATA GENERATION PROGRAM
JP2018005639A (en) Image classification device, image inspection device, and program
JP2006098151A (en) Pattern inspection device and pattern inspection method
KR102559021B1 (en) Apparatus and method for generating a defect image
JP2014203309A (en) Image processing apparatus, control method, and program
JP2006252563A (en) Method of detecting defect in image
JP4442119B2 (en) Image recognition apparatus and image recognition method, and teaching apparatus and teaching method of image recognition apparatus
CN113012096B (en) Display screen sub-pixel positioning and brightness extraction method, device and storage medium
WO2013074721A1 (en) Edge tracing with hysteresis thresholding
JP2014137284A (en) Teacher data creation support device, teacher data creation device, image classification device, teacher data creation support method, teacher data creation method and image classification method
JP6197340B2 (en) Image processing apparatus, image processing method, and program
JP6152034B2 (en) Labeling method, labeling device and defect inspection device
CN111724406A (en) Region communication merging method, device, equipment and medium
JP6425468B2 (en) Teacher data creation support method, image classification method, teacher data creation support device and image classification device
JP2013205320A (en) Inspection condition determination method, inspection method, and inspection device
KR101630078B1 (en) Data calculation method, data calculation apparatus, and defect inspection apparatus
JP6173088B2 (en) Inspection device, inspection method, program, and recording medium
JP2010276504A (en) Pattern edge detection method
CN101236164A (en) Method and system for defect detection
JP2015042942A (en) Image processor, defect detection device, image processing method, program, and, recording medium
JP6074210B2 (en) Image processing apparatus, appearance inspection apparatus, image processing method, and appearance inspection method
CN104063270B (en) Labeling method, tag device and flaw detection apparatus
JP2004165395A (en) Inspection data analysis program and inspecting program
JP2690936B2 (en) Digital image analyzer

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160608

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170515

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: 20170523

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170526

R150 Certificate of patent or registration of utility model

Ref document number: 6152034

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250