JPH11316193A - Method for dividing region of image - Google Patents

Method for dividing region of image

Info

Publication number
JPH11316193A
JPH11316193A JP12111798A JP12111798A JPH11316193A JP H11316193 A JPH11316193 A JP H11316193A JP 12111798 A JP12111798 A JP 12111798A JP 12111798 A JP12111798 A JP 12111798A JP H11316193 A JPH11316193 A JP H11316193A
Authority
JP
Japan
Prior art keywords
image
color
colors
representative color
pixels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP12111798A
Other languages
Japanese (ja)
Inventor
Yasushi Sasa
泰志 佐々
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 JP12111798A priority Critical patent/JPH11316193A/en
Publication of JPH11316193A publication Critical patent/JPH11316193A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a method for dividing a region of image, of which the region can be divided in a short processing time. SOLUTION: All color number obtained from color data of each pixel of a color image on a printed board are replaced by model color candidates with a limited color number by using a limited color displaying algorithm (53). As for the limited color displaying algorithm, a method selecting the model color candidate in order of decreasing a appearance frequency of color, a method of dividing a color space into a predetermined number of subspaces to select the model color candidate of each subspace, or a method converting the three- dimensional color space to one-dimensional arrangement and dividing the one- dimensional pixel array position to set the model color candidate, is used. By applying a rearrangement method to the model color candidate with the limited color number, the region is divided into a desired number of regions (55), and each pixel of the original color image is assigned to one of the divided regions to divide the desired pattern region (57).

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、複数のパターン領
域を含む画像を各パターン領域の画像に分割する画像の
領域分割方法に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to an image area dividing method for dividing an image including a plurality of pattern areas into images of each pattern area.

【0002】[0002]

【従来の技術】例えばプリント基板では、絶縁基板上に
信号線や電源線等の配線層あるいは半導体チップを搭載
するパッド部等の種々のパターン領域が形成されてい
る。このようなプリント基板の製造工程では、これら各
パターン領域の欠陥検査が行われる。パターン領域の欠
陥検査においては、プリント基板を撮像手段で撮像し、
得られた画像から信号線、電源線あるいはパッド部等の
各パターン領域を分割し、各パターン領域ごとにそれぞ
れ異なる検査基準を適用して各パターン領域の欠陥の有
無を検査するのが好ましい。
2. Description of the Related Art In a printed circuit board, for example, various pattern areas such as wiring layers for signal lines and power supply lines or pad portions for mounting semiconductor chips are formed on an insulating substrate. In the manufacturing process of such a printed board, a defect inspection of each of these pattern regions is performed. In the defect inspection of the pattern area, the printed circuit board is imaged by the imaging means,
It is preferable to divide each pattern region such as a signal line, a power supply line or a pad portion from the obtained image, and to inspect each pattern region for a defect by applying a different inspection standard to each pattern region.

【0003】図7は撮像手段により得られたプリント基
板の要部の画像を示す図である。図7のプリント基板の
画像10には、配線パターン領域11、レジスト領域1
2、パッド領域13およびシルク領域14の各パターン
領域が形成されており、各パターン領域は構成材料の違
いから異なる色を有している。
FIG. 7 is a view showing an image of a main part of a printed board obtained by an image pickup means. The image 10 of the printed circuit board in FIG.
2, pattern regions of a pad region 13 and a silk region 14 are formed, and each pattern region has a different color due to a difference in constituent materials.

【0004】図8〜図11は、それぞれ画像10から分
割された配線パターン領域11、レジスト領域12、パ
ッド領域13およびシルク領域14の画像を示してい
る。
FIGS. 8 to 11 show images of a wiring pattern area 11, a resist area 12, a pad area 13 and a silk area 14, respectively, divided from an image 10. FIG.

【0005】画像10を各パターン領域11〜14の画
像に分割する方法として、従来より再配置法(K−me
an法)と呼ばれる方法が一般的に用いられている。図
12〜図15は再配置法の説明図である。なお、ここで
は、説明の便宜上、画像の画素値を再配置法を用いて3
つの領域(クラスタ)に分割する方法について説明す
る。図12〜15において、多数の黒点は色空間16に
分布する画素の画素値15を示している。
As a method of dividing the image 10 into images of the respective pattern areas 11 to 14, a conventional rearrangement method (K-me
An method) is generally used. 12 to 15 are explanatory diagrams of the rearrangement method. Here, for convenience of explanation, the pixel values of the image are 3
A method of dividing into two regions (clusters) will be described. 12 to 15, a large number of black points indicate pixel values 15 of pixels distributed in the color space 16.

【0006】まず、図12において、分割する領域の
数、ここでは「3」を指定する。また、色空間16に、
3つに分割される領域の各中心位置を予測する初期値1
7を設定する。そして、各画素値15が3つの初期値1
7のいずれに近いかを算出し、同じ初期値17に近い画
素値15が含まれるように、全ての画素値15を3つの
領域R1〜R3に分割する。図12中の分割線X1はこ
の3つの領域R1〜R3の境界を示している。
First, in FIG. 12, the number of areas to be divided, here, "3" is designated. In the color space 16,
Initial value 1 for predicting each center position of the region divided into three
7 is set. Then, each pixel value 15 has three initial values 1
7 is calculated, and all the pixel values 15 are divided into three regions R1 to R3 so that the pixel values 15 close to the same initial value 17 are included. A division line X1 in FIG. 12 indicates a boundary between these three regions R1 to R3.

【0007】次に、図13において、分割された3つの
領域R1〜R3のそれぞれについて、各領域に含まれる
画素値15の平均値を求め、これを次の新たな領域の中
心値17aとして設定する。そして、全ての画素値15
が新たに設定された3つの中心値17aのいずれに近い
かを判定し、各画素値15を再び3つの領域R1a〜R
3aに分割する。分割線X2は3つの領域R1a〜R3
aの境界を示している。
Next, in FIG. 13, for each of the three divided regions R1 to R3, an average value of the pixel values 15 included in each region is obtained and set as the center value 17a of the next new region. I do. And all pixel values 15
Is determined to be closer to any of the three center values 17a newly set, and each pixel value 15 is again converted into the three regions R1a to R1a.
3a. The dividing line X2 has three regions R1a to R3.
The boundary of a is shown.

【0008】さらに、図14において、図13の処理と
同様の処理を繰り返し、画素値15を新たな3つの領域
R1b〜R3bに分割し、各領域R1b〜R3bの中心
値17bを算出する。
Further, in FIG. 14, the same processing as that of FIG. 13 is repeated to divide the pixel value 15 into three new regions R1b to R3b, and calculate the center value 17b of each of the regions R1b to R3b.

【0009】さらに、図15において、上記の処理を繰
り返し、前回の処理での中心値に対し、新たな中心値1
7iの位置がほぼ移動しなくなった状態で全ての画素値
15を3つの領域R1i〜R3iに分割する処理が終了
する。上記のような方法を用いて、画像データを画素値
が近接した3つの領域に分割することができる。
Further, in FIG. 15, the above processing is repeated, and a new center value 1 is added to the center value in the previous processing.
The process of dividing all the pixel values 15 into three regions R1i to R3i is completed in a state where the position of 7i has hardly moved. Using the method described above, the image data can be divided into three regions whose pixel values are close to each other.

【0010】このような再配置法を用いることにより、
複数のパターン領域を有する画像の各画素の画素値に基
づいて、互いの画素値が近接する画素をいくつかの塊
(領域)に分割することによって元画像から各パターン
領域の画像を分割することができる。
[0010] By using such a rearrangement method,
Dividing an image of each pattern area from an original image by dividing pixels having similar pixel values into several blocks (areas) based on pixel values of each pixel of the image having a plurality of pattern areas; Can be.

【0011】[0011]

【発明が解決しようとする課題】しかしながら、従来の
再配置法を用いて画像の領域分割処理を行うと、全ての
画像のデータ、例えば図12〜図15の例では全ての画
素値15に対して繰り返し演算を行う必要がある。この
ため、処理対象の画像の画素数が多くなると、その画素
数に応じて繰り返し演算の時間が長くなるという不都合
が生じる。
However, when the image is divided into regions using the conventional rearrangement method, all the image data, for example, all the pixel values 15 in the examples of FIGS. It is necessary to perform the operation repeatedly. For this reason, when the number of pixels of the image to be processed increases, there is a disadvantage that the time for the repetitive operation increases according to the number of pixels.

【0012】本発明の目的は、短い処理時間で領域分割
を行なうことが可能な画像の領域分割方法を提供するこ
とである。
An object of the present invention is to provide an image area dividing method capable of performing area division in a short processing time.

【0013】[0013]

【課題を解決するための手段および発明の効果】第1の
発明に係る画像の領域分割方法は、互いに色が異なる複
数のパターン領域を有する画像を各パターン領域の画像
に分割する画像の領域分割方法であって、画像を構成す
る各画素を色成分に対応する多次元空間に配置する工程
と、多次元空間に配置された複数の画素の色の中から所
定数の色を代表色候補として選択する工程と、各画素の
色を所定数の代表色候補のいずれかに置き換える工程
と、代表色候補で置き換えられた各画素に基づいて再配
置法を用いて多次元空間を指定した数の領域に分割し、
分割した領域に含まれる代表色候補に基づいて分割した
領域ごとに代表色を設定する工程と、画像を構成する各
画素の色が分割した領域ごとに設定された代表色のいず
れに近接するかを判定し、判定結果に基づいて各パター
ン領域の画像を生成する工程とを備えたものである。
According to a first aspect of the present invention, there is provided an image area dividing method for dividing an image having a plurality of pattern areas having different colors into images of each pattern area. A method of arranging each pixel constituting an image in a multidimensional space corresponding to a color component, and a predetermined number of colors from a plurality of pixels arranged in the multidimensional space as representative color candidates Selecting, replacing the color of each pixel with one of a predetermined number of representative color candidates, and specifying the number of multi-dimensional spaces designated by using a rearrangement method based on each pixel replaced with the representative color candidate. Divided into regions,
Setting a representative color for each of the divided regions based on the representative color candidates included in the divided region, and determining which of the representative colors set for each of the divided regions is closer to the color of each pixel constituting the image; And generating an image of each pattern area based on the determination result.

【0014】第1の発明に係る画像の領域分割方法にお
いては、画像に含まれる多数の色の中から代表色候補を
選択して各画素の色を置き換えることによって画像の各
画素が有する色数を減じた後、これらの画素に再配置法
を適用している。これにより、再配置法による繰り返し
演算の対象となる色の画素数を減少させることができ、
高速で、かつ短時間で画像を所望のパターン領域に分割
することができる。
In the image area dividing method according to the first invention, the number of colors of each pixel of the image is determined by selecting a representative color candidate from a large number of colors included in the image and replacing the color of each pixel. After the subtraction, the rearrangement method is applied to these pixels. This makes it possible to reduce the number of pixels of a color to be subjected to the repetitive operation by the rearrangement method,
The image can be divided into desired pattern areas at high speed and in a short time.

【0015】第2の発明に係る画像の領域分割方法は、
第1の発明に係る画像の領域分割方法の構成において、
所定数の色を代表色候補として選択する工程は、画像を
構成する複数の画素の色の中から出現頻度の高い順に所
定数の色を代表色候補として選択するものである。
According to a second aspect of the present invention, there is provided an image area dividing method,
In the configuration of the image area dividing method according to the first invention,
The step of selecting a predetermined number of colors as representative color candidates includes selecting a predetermined number of colors as representative color candidates from the colors of a plurality of pixels forming the image in the order of appearance frequency.

【0016】この場合には、画像の主要部を構成するパ
ターン領域の画素の出現頻度が高いことによって、これ
らのパターン領域を確実に画像から分割することができ
る。
In this case, since the appearance frequency of the pixels in the pattern region constituting the main part of the image is high, it is possible to surely divide these pattern regions from the image.

【0017】第3の発明に係る画像の領域分割方法は、
第1の発明に係る画像の領域分割方法の構成において、
所定数の色を代表色候補として選択する工程は、多次元
空間において画素が分布する分布空間を多次元空間の各
軸に沿って分割することによって分布空間を複数の部分
空間に分割する工程と、複数の部分空間に含まれる画素
の色に基づいて各部分空間ごとに代表色候補を設定する
工程とを含むものである。
According to a third aspect of the present invention, there is provided an image area dividing method,
In the configuration of the image area dividing method according to the first invention,
Selecting a predetermined number of colors as representative color candidates, dividing the distribution space into a plurality of subspaces by dividing the distribution space in which pixels are distributed in the multidimensional space along each axis of the multidimensional space; And setting a representative color candidate for each subspace based on the colors of the pixels included in the plurality of subspaces.

【0018】この場合には、多数の画素が分布する多次
元空間を少ない数の部分空間に分割して代表色候補を設
定することによって複数の画素が有する色の数を減じる
ことが可能となる。したがって、再配置法による繰り返
し演算の対象となる色の画素数が減少され、高速で、か
つ短時間で画像を所望のパターン領域に分割することが
できる。
In this case, it is possible to reduce the number of colors of a plurality of pixels by dividing a multidimensional space in which a large number of pixels are distributed into a small number of subspaces and setting representative color candidates. . Therefore, the number of pixels of the color to be subjected to the repetition operation by the rearrangement method is reduced, and the image can be divided into a desired pattern area at high speed in a short time.

【0019】第4の発明に係る画像の領域分割方法は、
第1の発明に係る画像の領域分割方法の構成において、
所定数の色を代表色候補として選択する工程は、多次元
空間に配置された複数の画素をスペースフィリング曲線
に沿って走査することによって複数の画素を1次元空間
に配列するとともに、1次元空間の各配列位置に対応す
る画素の出現頻度を示す頻度ヒストグラムを作成する工
程と、頻度ヒストグラムにおける各配列位置の画素の出
現頻度に基づいて1次元の配列位置を所定数の領域に分
割し、分割された領域に含まれる画素の色に基づいて分
割された領域ごとに代表色候補を設定する工程とを含む
ものである。
According to a fourth aspect of the present invention, there is provided an image area dividing method comprising:
In the configuration of the image area dividing method according to the first invention,
The step of selecting a predetermined number of colors as the representative color candidates includes arranging the plurality of pixels in a one-dimensional space by scanning a plurality of pixels arranged in a multidimensional space along a space-filling curve. Creating a frequency histogram indicating the frequency of appearance of pixels corresponding to each of the array positions; and dividing the one-dimensional array position into a predetermined number of regions based on the frequency of appearance of the pixels at each array position in the frequency histogram. And setting a representative color candidate for each of the divided regions based on the colors of the pixels included in the divided regions.

【0020】この場合には、スペースフィリング曲線を
用いて多次元空間を走査することによって近接した色を
有する画素が集合された1次元の頻度ヒストグラムを作
成することができる。そして、1次元の配列位置を分割
して代表色候補を設定することによって複数の画素が有
する色の数を減じることが可能となり、再配置法による
繰り返し演算の対象となる色の画素数を減少させること
ができる。したがって、高速で、かつ短時間で画像を所
望のパターン領域に分割することができる。
In this case, by scanning the multidimensional space using the space filling curve, it is possible to create a one-dimensional frequency histogram in which pixels having close colors are collected. By dividing the one-dimensional array position and setting representative color candidates, it is possible to reduce the number of colors of a plurality of pixels, and to reduce the number of pixels of a color to be subjected to the repetitive operation by the rearrangement method. Can be done. Therefore, an image can be divided into desired pattern areas at high speed and in a short time.

【0021】[0021]

【発明の実施の形態】以下、本発明の実施例について説
明する。図1は、本発明の実施例による画像の領域分割
方法のフロ−チャ−トである。以下では、図7に示すプ
リント基板の画像10を図8〜図11に示す各パタ−ン
領域の画像に分割する処理について説明する。
Embodiments of the present invention will be described below. FIG. 1 is a flowchart of an image area dividing method according to an embodiment of the present invention. Hereinafter, a process of dividing the image 10 of the printed circuit board shown in FIG. 7 into images of the respective pattern areas shown in FIGS. 8 to 11 will be described.

【0022】図7のプリント基板の画像10は、図8の
配線パタ−ン領域11、図9のレジスト領域12、図1
0のパッド領域13および図11のシルク領域14の画
像を含んでいる。これらの各パタ−ン領域11〜14
は、それぞれ構成材料が異なるため、表面の色が異なっ
ている。そこで、各パタ−ン領域11〜14の色を判別
することによって画像10から各パタ−ン領域11〜1
4を分割する。
An image 10 of the printed circuit board shown in FIG. 7 is composed of a wiring pattern area 11 shown in FIG. 8, a resist area 12 shown in FIG.
0 and the silk region 14 of FIG. Each of these pattern areas 11 to 14
Have different surface materials because they have different constituent materials. Therefore, by determining the color of each of the pattern areas 11 to 14, the pattern area 11 to 1
Divide 4

【0023】まず、CCD(電荷結合素子)カメラ等の
撮像手段によりプリント基板の画像10を各画素ごとの
赤、緑、青の画素値からなる色デ−タとして入力する
(ステップS1)。
First, an image 10 of a printed circuit board is input as color data composed of red, green, and blue pixel values for each pixel by image pickup means such as a CCD (charge coupled device) camera (step S1).

【0024】次に、入力された画像10の各画素を赤、
緑、青の3次元色空間に配置して画素の3次元分布を作
成する(ステップS2)。
Next, let each pixel of the input image 10 be red,
A three-dimensional distribution of pixels is created by arranging in a three-dimensional color space of green and blue (step S2).

【0025】さらに、入力された画像10の各画素の色
デ−タに基づいて画像10が有する多数の色を所定数の
代表色候補で代表させるために、限定色表示アルゴリズ
ムを適用する。限定色表示アルゴリズムを用いた代表色
候補の選定方法には次の3つの方法が用いられる。
Further, based on the color data of each pixel of the input image 10, a limited color display algorithm is applied to represent a large number of colors of the image 10 with a predetermined number of representative color candidates. The following three methods are used to select a representative color candidate using the limited color display algorithm.

【0026】第1の方法は、画像10において出現する
色の頻度を表した頻度ヒストグラムを作成し、出現頻度
の高い順から選択した所定数の色を代表色候補として選
択する方法である。すなわち、3次元色空間の各配置位
置における画素の出現頻度をカウントする。そして、出
現頻度の高い画素の色から順に所定数の色を選択し、こ
れを画像10の代表色候補とする。さらに、各画素の色
データを、所定数の代表色候補の中から最も近い代表色
候補の色データに置き換える。これにより、画像10に
含まれる数百〜数千種類の色を所定数の代表色候補に置
き換えることができる。
The first method is a method in which a frequency histogram representing the frequency of colors appearing in the image 10 is created, and a predetermined number of colors selected in descending order of appearance frequency are selected as representative color candidates. That is, the appearance frequency of the pixel at each arrangement position in the three-dimensional color space is counted. Then, a predetermined number of colors are selected in order from the color of the pixel having the highest appearance frequency, and this is set as a representative color candidate of the image 10. Further, the color data of each pixel is replaced with the color data of the closest representative color candidate from a predetermined number of representative color candidates. Thus, hundreds to thousands of colors included in the image 10 can be replaced with a predetermined number of representative color candidates.

【0027】第2の方法は、色空間線形分割法を用いる
方法である。色空間線形分割法は、赤、緑、青色空間内
で原画像の画素が分布している領域だけを線形に分割し
てその部分空間ごとに代表色候補を設定する方法であ
り、図2はこの色空間線形分割法の説明図である。
The second method is a method using a color space linear division method. The color space linear division method is a method of linearly dividing only an area where pixels of an original image are distributed in a red, green, and blue space and setting a representative color candidate for each of the partial spaces. FIG. 4 is an explanatory diagram of this color space linear division method.

【0028】まず、図2(a)に示すように、3次元色
空間の赤色軸Rに沿う画素の分布領域をn(整数)等分
する。次に、図2(b)に示すように、3次元色空間の
緑色軸Gに沿う画素の分布領域をn(整数)等分する。
さらに、図2(c)に示すように、3次元色空間の青色
軸Bに沿う画素の分布領域をn(整数)等分する。これ
により、3次元色空間の画素分布空間をほぼn3 の部分
空間4に分割する。そして、部分空間4ごとに色の代表
値を求め、この色を代表色候補とする。
First, as shown in FIG. 2A, a pixel distribution area along a red axis R in a three-dimensional color space is equally divided into n (integers). Next, as shown in FIG. 2B, the distribution region of the pixels along the green axis G in the three-dimensional color space is equally divided into n (integers).
Further, as shown in FIG. 2C, the distribution area of the pixels along the blue axis B in the three-dimensional color space is equally divided into n (integers). Thereby, the pixel distribution space of the three-dimensional color space is divided into approximately n 3 subspaces 4. Then, a representative value of a color is obtained for each subspace 4, and this color is set as a representative color candidate.

【0029】第3の方法は、スペ−スフィリング曲線を
用いて3次元色空間の画素分布の1次元化を行い、隣接
する色を統合することによって代表色候補を選定する方
法である。スペースフィリング曲線とは、所定の空間を
満たす格子点を一度だけ通るような曲線として定義され
るものであり、例えばペアノ(Peano)曲線やヒル
ベルト曲線等がこれに含まれる。図3は3次元色空間の
画素分布図である。図4はペアノ曲線の斜視図である。
さらに、図5は、頻度ヒストグラムを示す図である。
The third method is a method in which a pixel distribution in a three-dimensional color space is made one-dimensional using a space filling curve, and a representative color candidate is selected by integrating adjacent colors. The space filling curve is defined as a curve that passes through a grid point that satisfies a predetermined space only once, and includes, for example, a Peano curve, a Hilbert curve, and the like. FIG. 3 is a pixel distribution diagram in a three-dimensional color space. FIG. 4 is a perspective view of the Peano curve.
FIG. 5 shows a frequency histogram.

【0030】この方法では、まず3次元色空間を図4に
示すペアノ曲線に沿って走査し、図5に示すように1次
元の色空間に再配列して頻度ヒストグラムを作成する。
頻度ヒストグラムが求まると、頻度ヒストグラム横軸の
色の配列位置に沿って隣接する色を統合し、画素の出現
頻度が等しくなるように色の配列位置を分割する。そし
て、分割した領域S1〜Si毎に代表色候補を設定す
る。
In this method, first, a three-dimensional color space is scanned along a Peano curve shown in FIG. 4 and rearranged into a one-dimensional color space as shown in FIG. 5 to create a frequency histogram.
When the frequency histogram is obtained, adjacent colors are integrated along the color array position on the horizontal axis of the frequency histogram, and the color array position is divided so that the appearance frequency of the pixels becomes equal. Then, a representative color candidate is set for each of the divided areas S1 to Si.

【0031】上記の3つの方法のいずれかを用いること
により、数百〜数千種類の色からなる画像10を限定さ
れた数の代表色候補によって置き換ることができる(ス
テップS3)。
By using any of the above three methods, the image 10 consisting of hundreds to thousands of colors can be replaced by a limited number of representative color candidates (step S3).

【0032】なお、代表色候補の数としては、画像10
の種類に応じて予め求めておくことが好ましい。本発明
者による検討の結果では、画像10が700色程度で表
現されている場合には、代表色候補の数として実際の色
数の数%にまで限定することが可能であった。なお、代
表色候補の数を過度に限定すると、画像10から分割さ
れる領域が不正確となったり、パターン領域毎に分割す
ることが困難となる。
Note that the number of representative color candidates
Is preferably obtained in advance in accordance with the type of. As a result of the study by the present inventors, when the image 10 is represented by about 700 colors, it was possible to limit the number of representative color candidates to a few percent of the actual number of colors. If the number of the representative color candidates is excessively limited, the area divided from the image 10 becomes inaccurate, or it becomes difficult to divide each pattern area.

【0033】次に、画像10を複数の領域に分割するた
めの領域の分割数(クラスタ数)、後述する再配置法に
用いる初期値および終了条件を入力する。例えば、本実
施例では、画像10を図6〜図9の4つのパターン領域
11〜14に分割するため、クラスタ数として「4」を
入力する(ステップS4)。
Next, the number of divisions (the number of clusters) for dividing the image 10 into a plurality of areas, an initial value used in a rearrangement method described later, and an end condition are input. For example, in the present embodiment, “4” is input as the number of clusters in order to divide the image 10 into the four pattern regions 11 to 14 of FIGS. 6 to 9 (step S4).

【0034】そして、入力されたクラスタ数に基づい
て、代表色候補に置き換えられた画像10の各画素が配
置された3次元色空間を再配置法(K−mean法)を
用いて4つの領域に分割する。図6は再配置法による領
域分割の説明図である。図6において、黒点は3次元色
空間5における代表色候補に置き換えられた画素6を模
式的に示している。
Then, based on the input number of clusters, the three-dimensional color space in which the pixels of the image 10 replaced with the representative color candidates are arranged is divided into four regions by using the rearrangement method (K-mean method). Divided into FIG. 6 is an explanatory diagram of area division by the rearrangement method. In FIG. 6, black points schematically show the pixels 6 replaced with the representative color candidates in the three-dimensional color space 5.

【0035】まず、図6(a)において、分割する領域
の数、ここでは「4」を指定する。また、入力された4
つの色データの初期値7を色空間5の該当位置に設定す
る。そして、各代表色候補の画素6が4つの初期値7の
いずれに近いかを算出し、同じ初期値7に近い代表色候
補の画素6を含むように全ての代表色候補の画素6を4
つの領域r1〜r4に分割する。図6(a)中の分割線
Y1はこの4つの領域r1〜r4の境界を示している。
First, in FIG. 6A, the number of areas to be divided, here "4", is designated. Also, the input 4
An initial value 7 of the two color data is set at a corresponding position in the color space 5. Then, it is calculated which of the four initial values 7 the representative color candidate pixel 6 is closer to, and all the representative color candidate pixels 6 are set to 4 so as to include the representative color candidate pixel 6 close to the same initial value 7.
Is divided into two regions r1 to r4. A division line Y1 in FIG. 6A indicates a boundary between the four regions r1 to r4.

【0036】次に、図6(b)において、分割された4
つの領域r1〜r4のそれぞれに含まれる代表色候補の
画素6の色データの平均値を求め、これを次の新たな領
域の中心値7aとして設定する。そして、全ての代表色
候補の画素6が新たに設定された4つの中心値7aのい
ずれに近いかを判定し、各代表色候補の画素6を再び4
つの領域r1a〜r4aに分割する。分割線Y2は4つ
の領域r1a〜r4aの境界を示している。
Next, in FIG. 6B, the divided 4
The average value of the color data of the pixel 6 of the representative color candidate included in each of the regions r1 to r4 is obtained, and this is set as the center value 7a of the next new region. Then, it is determined which of the four center values 7a of the newly set representative color candidate pixels 6 is closer to each other.
Is divided into two regions r1a to r4a. The division line Y2 indicates a boundary between the four regions r1a to r4a.

【0037】さらに、図6(c)において、上記の処理
を繰り返し行い、各処理ごとの新たな中心値の変動量
が、終了条件で与えられた値よりも小さくなった状態
で、繰り返し演算処理を終了する。これにより、代表色
候補6の画素を4つの領域r1i〜r4iに分割するこ
とができる(ステップS5)。
Further, in FIG. 6 (c), the above processing is repeated, and in a state where the fluctuation amount of the new center value for each processing becomes smaller than the value given in the end condition, the repetitive arithmetic processing is performed. To end. Thus, the pixel of the representative color candidate 6 can be divided into four regions r1i to r4i (step S5).

【0038】さらに、4つに分割された各領域における
最終の中心値7iを代表色として設定する。これによ
り、4つの分割領域にそれぞれ対応した4つの代表色が
決定される(ステップS6)。
Further, the final center value 7i in each of the four divided areas is set as a representative color. Thus, four representative colors respectively corresponding to the four divided regions are determined (Step S6).

【0039】そして、画像10の各画素の色データと4
つの代表色の色データとを比較し、最も近接する代表色
の色データを各画素の色データに割り付ける。これによ
り、画像10が各画素の4つの色データに基づいて各々
分割される(ステップS7)。
Then, the color data of each pixel of the image 10 and 4
The color data of the representative color is compared with the color data of the two representative colors, and the color data of the closest representative color is assigned to the color data of each pixel. Thus, the image 10 is divided based on the four color data of each pixel (step S7).

【0040】このように、本実施例による画像の領域分
割では、画像10の実際の色を色数が限定された代表色
候補で置き換え、代表色候補に対して再配置法を適用し
て領域分割を行っている。代表色候補では、画像10が
有する全色数の数%程度の色数に限定することが可能で
ある。このため、再配置法の処理工程において、繰り返
し演算の対象となる代表色候補を数十〜数百程度の値に
することによって、全ての画素に対して繰り返し演算を
行う従来の場合に比べ、高速かつ短時間で繰り返し演算
を行い、領域分割を行うことができる。
As described above, in the region segmentation of the image according to the present embodiment, the actual colors of the image 10 are replaced with the representative color candidates having a limited number of colors, and the rearrangement method is applied to the representative color candidates to obtain the region. We are doing a split. In the representative color candidates, the number of colors can be limited to about several percent of the total number of colors of the image 10. For this reason, in the process of the rearrangement method, by setting the representative color candidate to be subjected to the repetition operation to a value of about several tens to several hundreds, compared with the conventional case of performing the repetition operation for all the pixels, Area calculation can be performed by repeatedly performing calculations at high speed and in a short time.

【0041】なお、上記の画像の領域分割方法におい
て、3つの代表色候補の選定方法の1つを選択して画像
の領域分割処理を行った結果、適切な領域分割が行われ
なかった場合には、他の代表色候補の選定方法を用いて
再度画像の領域分割処理を行うように構成してもよい。
In the above-described image region dividing method, when one of the three representative color candidate selection methods is selected and the image region dividing process is performed, if the appropriate region division is not performed, May be configured to perform the image area division process again using another representative color candidate selection method.

【0042】さらに、上記実施例においては、画像10
のクラスタ数(領域の分割数)に対し、代表色候補の数
が大きい場合について説明したが、クラスタ数が大きい
場合で、クラスタ数と代表色候補の数とを等しく設定し
た場合でも正確に画像の領域分割を行える場合には、代
表色候補の選定に用いた限定色表示アルゴリズムによっ
て画像の領域分割を行うことが可能となる。この場合に
は、再配置法による代表色候補の分割処理を省略するこ
とができる。
Further, in the above embodiment, the image 10
The case where the number of representative color candidates is large with respect to the number of clusters (the number of divisions of the region) has been described. When the area division can be performed, the area division of the image can be performed by the limited color display algorithm used for selecting the representative color candidate. In this case, the process of dividing the representative color candidates by the rearrangement method can be omitted.

【0043】また、画像の特徴に応じて代表色候補を選
択する3つの方法を適宜使い分けることにより、全ての
画素の色データから適切な色データを代表色候補として
選択することができる。そのため、従来のように全ての
画素に対して再配置法を適用する方法に比べても精度の
低下を抑制することができる。
By appropriately using the three methods of selecting the representative color candidates according to the characteristics of the image, appropriate color data can be selected as the representative color candidates from the color data of all the pixels. For this reason, it is possible to suppress a decrease in accuracy as compared with the conventional method in which the rearrangement method is applied to all pixels.

【0044】なお、上記の再配置法の処理において、色
空間5に配置された代表色候補の画素6に当該画素6の
出現頻度の情報を付加することにより、分割された4つ
の領域の中心値を算出する際の精度を向上することがで
きる。
In the above-described rearrangement processing, the information of the frequency of appearance of the pixel 6 is added to the pixel 6 of the representative color candidate arranged in the color space 5 so that the center of the four divided areas can be obtained. The accuracy in calculating the value can be improved.

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

【図1】本発明の実施例による画像の領域分割方法のフ
ローチャートである。
FIG. 1 is a flowchart of an image area dividing method according to an embodiment of the present invention.

【図2】色空間線形分割法の説明図である。FIG. 2 is an explanatory diagram of a color space linear division method.

【図3】3次元色空間における画素分布図である。FIG. 3 is a pixel distribution diagram in a three-dimensional color space.

【図4】ペアノ曲線の斜視図である。FIG. 4 is a perspective view of a Peano curve.

【図5】1次元の頻度ヒストグラムを示す図である。FIG. 5 is a diagram showing a one-dimensional frequency histogram.

【図6】代表色候補に適用する再配置法の説明図であ
る。
FIG. 6 is an explanatory diagram of a rearrangement method applied to a representative color candidate.

【図7】プリント基板の模式図である。FIG. 7 is a schematic view of a printed circuit board.

【図8】プリント基板の配線パターン領域の模式図であ
る。
FIG. 8 is a schematic diagram of a wiring pattern area of a printed circuit board.

【図9】プリント基板のレジスト領域の模式図である。FIG. 9 is a schematic view of a resist region of a printed circuit board.

【図10】プリント基板のパッド領域の模式図である。FIG. 10 is a schematic view of a pad area of a printed circuit board.

【図11】プリント基板のシルク領域の模式図である。FIG. 11 is a schematic diagram of a silk region of a printed circuit board.

【図12】従来の再配置法の説明図である。FIG. 12 is an explanatory diagram of a conventional rearrangement method.

【図13】従来の再配置法の説明図である。FIG. 13 is an explanatory diagram of a conventional rearrangement method.

【図14】従来の再配置法の説明図である。FIG. 14 is an explanatory diagram of a conventional rearrangement method.

【図15】従来の再配置法の説明図である。FIG. 15 is an explanatory diagram of a conventional rearrangement method.

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

5 色空間 6 代表色候補の画素 7 初期値 10 画像 11 配線パターン領域 12 レジスト領域 13 パッド領域 14 シルク領域 5 Color space 6 Representative color candidate pixel 7 Initial value 10 Image 11 Wiring pattern area 12 Resist area 13 Pad area 14 Silk area

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 互いに色が異なる複数のパターン領域を
有する画像を各パターン領域の画像に分割する画像の領
域分割方法であって、 前記画像を構成する各画素を色成分に対応する多次元空
間に配置する工程と、 前記多次元空間に配置された複数の画素の色の中から所
定数の色を代表色候補として選択する工程と、 前記各画素の色を前記所定数の代表色候補のいずれかに
置き換える工程と、 前記代表色候補で置き換えられた各画素に基づいて再配
置法を用いて前記多次元空間を指定した数の領域に分割
し、分割した領域に含まれる前記代表色候補に基づいて
前記分割した領域ごとに代表色を設定する工程と、 前記画像を構成する各画素の色が前記分割した領域ごと
に設定された前記代表色のいずれに近接するかを判定
し、判定結果に基づいて各パターン領域の画像を生成す
る工程とを備えたことを特徴とする画像の領域分割方
法。
1. An image area dividing method for dividing an image having a plurality of pattern areas having mutually different colors into images of each pattern area, wherein each pixel constituting the image is divided into a multidimensional space corresponding to a color component. And selecting a predetermined number of colors from among the colors of the plurality of pixels arranged in the multidimensional space as representative color candidates; and setting the colors of the pixels to the predetermined number of representative color candidates. Replacing the multi-dimensional space into a specified number of regions using a rearrangement method based on each pixel replaced by the representative color candidate, and the representative color candidate included in the divided region Setting a representative color for each of the divided regions on the basis of: determining which of the representative colors set for each of the divided regions the color of each pixel constituting the image is closer to, and determining Based on the result Area dividing method of the image characterized by comprising the step of generating an image of each pattern region.
【請求項2】 前記所定数の色を代表色候補として選択
する工程は、 前記画像を構成する複数の画素の色の中から出現頻度の
高い順に所定数の色を代表色候補として選択することを
特徴とする請求項1記載の画像の領域分割方法。
2. The step of selecting the predetermined number of colors as representative color candidates includes selecting a predetermined number of colors as representative color candidates from the colors of a plurality of pixels constituting the image in the order of appearance frequency. 2. The method according to claim 1, wherein the image is divided into regions.
【請求項3】 前記所定数の色を代表色候補として選択
する工程は、 前記多次元空間において画素が分布する分布空間を前記
多次元空間の各軸に沿って分割することによって前記分
布空間を複数の部分空間に分割する工程と、 前記複数の部分空間に含まれる画素の色に基づいて各部
分空間ごとに代表色候補を設定する工程とを含むことを
特徴とする請求項1記載の画像の領域分割方法。
3. The step of selecting the predetermined number of colors as representative color candidates includes dividing the distribution space in which pixels are distributed in the multidimensional space along each axis of the multidimensional space, thereby dividing the distribution space. 2. The image according to claim 1, further comprising: dividing the image into a plurality of subspaces; and setting a representative color candidate for each of the subspaces based on colors of pixels included in the plurality of subspaces. Area division method.
【請求項4】 前記所定数の色を代表色候補として選択
する工程は、 前記多次元空間に配置された複数の画素をスペースフィ
リング曲線に沿って走査することによって複数の画素を
1次元空間に配列するとともに、前記1次元空間の各配
列位置に対応する画素の出現頻度を示す頻度ヒストグラ
ムを作成する工程と、 前記頻度ヒストグラムにおける各配列位置の画素の出現
頻度に基づいて前記1次元の配列位置を所定数の領域に
分割し、前記分割された領域に含まれる画素の色に基づ
いて前記分割された領域ごとに代表色候補を設定する工
程とを含むことを特徴とする請求項1記載の画像の領域
分割方法。
4. The step of selecting the predetermined number of colors as representative color candidates includes: scanning a plurality of pixels arranged in the multi-dimensional space along a space filling curve to convert the plurality of pixels into a one-dimensional space. Arranging and generating a frequency histogram indicating the frequency of appearance of pixels corresponding to each array position in the one-dimensional space; and the one-dimensional array position based on the frequency of appearance of pixels at each array position in the frequency histogram. Dividing the image into a predetermined number of regions, and setting a representative color candidate for each of the divided regions based on the colors of the pixels included in the divided regions. How to segment the image.
JP12111798A 1998-04-30 1998-04-30 Method for dividing region of image Pending JPH11316193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12111798A JPH11316193A (en) 1998-04-30 1998-04-30 Method for dividing region of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12111798A JPH11316193A (en) 1998-04-30 1998-04-30 Method for dividing region of image

Publications (1)

Publication Number Publication Date
JPH11316193A true JPH11316193A (en) 1999-11-16

Family

ID=14803315

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12111798A Pending JPH11316193A (en) 1998-04-30 1998-04-30 Method for dividing region of image

Country Status (1)

Country Link
JP (1) JPH11316193A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7031510B2 (en) 2001-02-28 2006-04-18 Dainippon Screen Mfg. Co., Ltd. Region segmentation of color image
EP1700469A2 (en) * 2003-12-19 2006-09-13 Datacolor Holding Ag Spectrophotometer with digital camera
JP2020144691A (en) * 2019-03-07 2020-09-10 株式会社Screenホールディングス Model color determination method, inspection device, inspection method, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7031510B2 (en) 2001-02-28 2006-04-18 Dainippon Screen Mfg. Co., Ltd. Region segmentation of color image
EP1700469A2 (en) * 2003-12-19 2006-09-13 Datacolor Holding Ag Spectrophotometer with digital camera
EP1700469A4 (en) * 2003-12-19 2008-01-16 Datacolor Holding Ag Spectrophotometer with digital camera
JP2020144691A (en) * 2019-03-07 2020-09-10 株式会社Screenホールディングス Model color determination method, inspection device, inspection method, and program

Similar Documents

Publication Publication Date Title
US7646908B2 (en) Defect detection apparatus and defect detection method
US7386167B2 (en) Segmentation technique of an image
WO2005096181A1 (en) Learning type classification device and learning type classification method
JP2001156135A (en) Method and device for sorting defective image and manufacturing method of semiconductor device using them
EP0332706B1 (en) High speed image fault detecting method and apparatus
WO2002013177A1 (en) Method and apparatus for digital image segmentation using an iterative method
KR20060048146A (en) Segmentation technique of a color image according to colors
US20120237121A1 (en) Image processing device, image processing method, and storage medium for storing image processing program
JP2006279920A (en) Image display device, method of generating correction value of image display device, program for generating correction value of image display device, and recording medium recording program thereon
JP3560473B2 (en) Printed circuit board inspection apparatus and printed circuit board inspection method
JP2005513632A (en) Split an image using the water source method
CN109872287B (en) Method for correcting SEM image contour line graph
JPH11316193A (en) Method for dividing region of image
US20070013952A1 (en) Reverse diffusion digital halftone quantization
JP2002267427A (en) Method and device for measuring outer shape of honeycomb structure
JP2010127762A (en) Apparatus, method and program for analyzing tire ground contact
JP3783815B2 (en) Image processing device
JP6466797B2 (en) Data correction apparatus, drawing apparatus, inspection apparatus, data correction method, drawing method, inspection method, and program
JP2576336B2 (en) Image division method and apparatus
WO2023008509A1 (en) Information processing program and information processing device
JPS6381570A (en) Method and equipment used for data processing in electron beam device
JP2003149171A (en) Pattern examining device and method
SU1649500A1 (en) Method of making masks for extracting image fragments
JP2010108285A (en) Image processing method and computer program therefor
KR100363965B1 (en) Method of optimizing color image for 4 gray-level display