JPH07249120A - Picture processing method - Google Patents

Picture processing method

Info

Publication number
JPH07249120A
JPH07249120A JP6038952A JP3895294A JPH07249120A JP H07249120 A JPH07249120 A JP H07249120A JP 6038952 A JP6038952 A JP 6038952A JP 3895294 A JP3895294 A JP 3895294A JP H07249120 A JPH07249120 A JP H07249120A
Authority
JP
Japan
Prior art keywords
pixel
value
pixels
starting point
image
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.)
Withdrawn
Application number
JP6038952A
Other languages
Japanese (ja)
Inventor
Atsushi Murakami
敦 村上
Muneki Hamashima
宗樹 浜島
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.)
Nikon Corp
Original Assignee
Nikon Corp
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 Nikon Corp filed Critical Nikon Corp
Priority to JP6038952A priority Critical patent/JPH07249120A/en
Publication of JPH07249120A publication Critical patent/JPH07249120A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PURPOSE:To simplify an arithmetic processing and to speedily recognize a pattern. CONSTITUTION:This picture processing method includes a first process where one of plural picture elements constituting the edges of a specified pattern T in a reference picture is set to be a start T(0), and the directions of the edges on which the plural picture elements are positioned are sequentially registered from the start T(0), a second process where the respective picture elements in the input picture are set to be starting points, whether the picture elements adjacent in the direction registered in the first process constitute the pattern edges or not is judged and the number of the picture elements judged to constitute the pattern edges is counted and a third process detecting the specified pattern T among the plural patterns included in the input picture elements based on the position of the starting point where the number of the picture elements counted in the second process becomes a maximum.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、入力画像中から登録
された参照画像を認識するために行われるパターン認識
を行うための画像処理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image processing method for performing pattern recognition for recognizing a reference image registered from an input image.

【0002】[0002]

【従来の技術】従来の画像処理方法は、登録された参照
画像と、その参照画像が含まれた入力画像とのパターン
認識を行い、これら参照画像と入力画像との相対的な位
置関係(ずれ)を求めていた。より具体的に説明する
と、上記した従来の画像処理方法では、参照画像及び入
力画像を2値化することなく、濃淡画像のままで互いの
相互相関値を求め、この相互相関値の最大値から参照画
像と入力画像との相対的な位置関係(ずれ)を求めてい
た。
2. Description of the Related Art A conventional image processing method performs pattern recognition between a registered reference image and an input image containing the reference image, and a relative positional relationship (deviation) between the reference image and the input image. ) Was required. More specifically, in the above-described conventional image processing method, the cross-correlation value of each of the gray-scale images is obtained without binarizing the reference image and the input image, and the maximum value of the cross-correlation value is calculated. The relative positional relationship (deviation) between the reference image and the input image has been obtained.

【0003】上記相互相関値として、画像の明るさやコ
ントラストによる影響を除去するため、参照画像と入力
画像との分散値で、参照画像と入力画像との共分散をし
た相互係数を算出していた。すなわち、相互相関の演算
は、入力画像Sと参照画像Tについて分散Dsを下記の
式(1)により求め、参照画像Tの分散値Dtを下記の
式(2)により求め、及び画像S,Tの共分散Dstを下
記の式(3)により求め、これら求めた分散Ds、Dt
及び共分散Dstから相関係数Cstを下記の式(4)
により算出することにより行われていた。
As the above-mentioned cross-correlation value, in order to remove the influence of the brightness and contrast of the image, the mutual coefficient which is the covariance of the reference image and the input image is calculated by the dispersion value of the reference image and the input image. . That is, the cross-correlation is calculated by obtaining the variance Ds of the input image S and the reference image T by the following equation (1), the variance value Dt of the reference image T by the following equation (2), and the images S, T. The covariance Dst of Ds, Dt is calculated by the following equation (3).
And the correlation coefficient Cst from the covariance Dst is given by the following equation (4).
It was done by calculating by.

【0004】[0004]

【数1】 [Equation 1]

【0005】ここで、Mは相互相関演算を行うべき領域
の画素のX方向の個数、NはY方向の個数であり、入力
画像Sと参照画像Tとの大きさは等しいものとしてい
る。また、相関係数Cstは、−1≦Cst≧1の範囲
の値をとり、入力画像Sと参照画像Tが一致した場合に
はCst=1、全く相関のない場合にはCst=0の値
をとる。
Here, M is the number of pixels in the X direction in the area in which the cross-correlation calculation is to be performed, N is the number in the Y direction, and the input image S and the reference image T have the same size. Further, the correlation coefficient Cst takes a value in the range of −1 ≦ Cst ≧ 1, and is Cst = 1 when the input image S and the reference image T match, and Cst = 0 when there is no correlation. Take

【0006】一般に、入力画像Sは、参照画像Tより大
きい。したがって、入力画像Sを参照画像Tと等しい大
きさに区切り、この区切りの相互相関をとるべき入力画
像Cの領域として、各区切り毎に順次走査して、相関係
数Cstが最大値をとる領域を入力画像Sと参照画像T
とが一致する箇所として判断されていた。上記した従来
の相互相関演算による画像処理方法では、パターン全体
の濃淡分布の情報そのまま用い、これを各画像の特徴と
してパターン認識しているため、入力画像Sと参照画像
Tとの間に明るさやコントラストの変化があっても比較
的確実にパターン認識が行えるとともに、パターンに多
少の欠陥があってもパターン認識できるという利点があ
った。
Generally, the input image S is larger than the reference image T. Therefore, the input image S is divided into the same size as the reference image T, and the region of the input image C where the cross-correlation of this segment is to be taken is sequentially scanned for each segment, and the region where the correlation coefficient Cst has the maximum value. Input image S and reference image T
It was determined that the and were to match. In the above-described image processing method by the cross-correlation calculation, the information of the grayscale distribution of the entire pattern is used as it is, and the pattern is recognized as a feature of each image. Therefore, the brightness between the input image S and the reference image T There is an advantage that the pattern can be recognized relatively reliably even if there is a change in contrast, and the pattern can be recognized even if the pattern has some defects.

【0007】[0007]

【発明が解決しようとする課題】しかし、上記した従来
の相互相関演算による画像処理方法では、前記した式
(1)〜(4)までの演算処理が複雑であり、しかも式
(1)から順に、式(2)、式(3)の順で計算し、最
後の式(4)まで計算をしないと相関値が求められない
ため、演算処理時間の短縮化が困難であるという第1の
問題点があった。
However, in the above-described conventional image processing method by the cross-correlation calculation, the calculation processing of the above-mentioned formulas (1) to (4) is complicated, and the formula (1) is sequentially followed. The first problem is that it is difficult to reduce the calculation processing time because the correlation value cannot be obtained unless the calculation is performed in the order of the formula (2) and the formula (3) and the last formula (4) is calculated. There was a point.

【0008】これに加え、図12(a)に示すような線
画による輪郭のみからなる画像を参照画像とした場合、
濃淡としての情報が少ないために、誤認識をする可能性
が高いという第2の問題点があった。すなわち、従来の
相互相関演算による画像処理方法では、パターン全体の
濃淡分布の一致を見てパターン認識を行うものであるた
め、このパターンの濃度分布自体が部分的に変化する
と、正確な認識が困難になる。
In addition to this, in the case where an image consisting only of the outline of a line drawing as shown in FIG.
There is a second problem that there is a high possibility of erroneous recognition due to the small amount of grayscale information. That is, in the conventional image processing method using the cross-correlation calculation, pattern recognition is performed by observing the matching of the grayscale distributions of the entire pattern. Therefore, if the density distribution itself of this pattern partially changes, accurate recognition is difficult. become.

【0009】特に、演算処理の高速化を目的として、入
力画像或いは参照画像に対して圧縮・平均化処理を行う
と、図12(a)に示すような画像は、エッジのみで鋭
敏な濃淡分布を示す。このため、圧縮・平均化により、
濃度分布の情報が損なわれるため、参照画像に対する入
力画像の誤認識の可能性が高くなる。また、画像の輪郭
線が物体の凹凸に基づくものである場合、この物体に照
射される光の方向により、図12(a)に示す画像が、
例えば同図(b)、(c)、(d)に示すように、濃淡
分布が全部又は一部逆転してしまうことがことがある。
このため、従来の相互相関演算による画像処理方法で
は、図12(a)に示す画像と、同図(b)、(c)、
(d)に示す画像とが異なる画像として誤認識されてし
まうおそれがある。
In particular, when the input image or the reference image is compressed and averaged for the purpose of speeding up the calculation process, the image as shown in FIG. Indicates. Therefore, by compression / averaging,
Since the information of the density distribution is lost, the possibility of erroneous recognition of the input image with respect to the reference image increases. When the contour line of the image is based on the unevenness of the object, the image shown in FIG.
For example, as shown in (b), (c), and (d) of the same drawing, the grayscale distribution may be reversed in whole or in part.
Therefore, in the conventional image processing method by cross-correlation calculation, the image shown in FIG. 12 (a) and the image shown in FIG. 12 (b), (c),
The image shown in (d) may be erroneously recognized as a different image.

【0010】そこで、請求項1記載の発明は、上記した
従来の技術の有する第1,第2の問題点に鑑みてなされ
たものであり、その目的とするところは、参照画像が示
すエッジの方向に沿って入力画像のパターンエッジの有
無を判定することで、演算処理を簡素化でき、迅速なパ
ターン認識を行うことができるばかりでなく、線画によ
る輪郭のみからなる画像についても確実にパターン認識
が行え、しかも画像の輪郭線が物体の凹凸に基づくもの
であっても確実にパターン認識が行えるようにした画像
処理方法を提供しようとするものである。
Therefore, the invention according to claim 1 has been made in view of the first and second problems of the above-mentioned conventional technique, and the purpose thereof is to detect the edge of the reference image. By determining the presence or absence of pattern edges in the input image along the direction, not only can the arithmetic processing be simplified and rapid pattern recognition can be performed, but pattern recognition can also be reliably performed for images that consist only of outlines of line drawings. It is an object of the present invention to provide an image processing method capable of reliably performing pattern recognition even when the contour line of the image is based on the unevenness of the object.

【0011】これに加え、請求項2記載の発明は、演算
処理の途中で相関が低いと判断された場合は、演算処理
を中止し、別の平均化画素を起点とする演算処理に移る
ことにより、無駄な演算処理時間を省き、迅速なパター
ン認識が行えるようにした画像処理方法を提供しようと
するものである。請求項3記載の発明は、請求項1及び
請求項2記載の発明の上記した目的に加え、隣接する複
数の画素のそれぞれ求めた複数の階調値の最大値と最小
値に基づいて、パターンエッジの判定を行っているの
で、入力画像の明るさやコントラストによる影響を除去
することができるようにした画像処理方法を提供しよう
とするものである。
In addition to this, in the invention described in claim 2, when it is determined that the correlation is low during the arithmetic processing, the arithmetic processing is stopped and the arithmetic processing starting from another averaging pixel is started. Therefore, it is intended to provide an image processing method in which wasteful calculation processing time is saved and rapid pattern recognition can be performed. According to a third aspect of the present invention, in addition to the above-described objects of the first and second aspects of the present invention, a pattern is formed based on the maximum value and the minimum value of a plurality of gradation values respectively obtained for a plurality of adjacent pixels. Since the edge determination is performed, it is an object of the present invention to provide an image processing method capable of removing the influence of the brightness and contrast of the input image.

【0012】さらに、請求項4記載の発明は、請求項1
及び請求項2記載の発明の上記した目的に加え、隣接す
る複数の画素のそれぞれ求めた各階調値に基づいて平滑
化微分をそれぞれ行っているので、請求項3記載の発明
と同様に、入力画像の明るさやコントラストによる影響
を確実に除去することができるばかりでなく、エッジが
ぼやけている場合にも、当該エッジの有無を確実に判定
できるようにした画像処理方法を提供しようとするもの
である。
Further, the invention of claim 4 is the same as claim 1.
In addition to the above-described object of the invention described in claim 2, smoothing differentiation is performed based on each gradation value obtained for each of a plurality of adjacent pixels. It is an object of the present invention to provide an image processing method that can reliably remove the influence of the brightness and contrast of an image, and can surely determine the presence or absence of the edge even when the edge is blurred. is there.

【0013】[0013]

【課題を解決するための手段】本発明は、上記した目的
を達成するためのものであり、以下にその内容を図面に
示した実施例を用いて説明する。請求項1記載の発明
は、図3に示すように、つぎの3つの各工程(100〜300)
を含むことを特徴とする。
The present invention is to achieve the above-mentioned object, and the contents thereof will be described below with reference to the embodiments shown in the drawings. The invention according to claim 1 has the following three steps (100 to 300) as shown in FIG.
It is characterized by including.

【0014】まず、第1の工程(100)は、例えば図1に
例示する参照画像中の特定パターンTのエッジを構成す
る複数の画素のうちの1つを起点T(0)とし、前記複数
の画素それぞれが位置するエッジの方向を、前記起点T
(0)より順番に登録する工程である。第2の工程(200)
は、入力画像中の各画素を始点とし、該始点となる画素
から順番に前記第1の工程(100)で登録した方向に隣接
する画素がパターンエッジを構成するか否かを判定する
と共に、パターンエッジを構成すると判定された画素の
個数をカウントする工程である。
First, in the first step (100), one of a plurality of pixels forming an edge of a specific pattern T in a reference image illustrated in FIG. The direction of the edge where each pixel of
This is a process of sequentially registering from (0). Second step (200)
Is to determine whether each pixel in the input image is a starting point, and pixels adjacent to each other in the direction registered in the first step (100) in order from the starting point pixel form a pattern edge, and This is a step of counting the number of pixels determined to form a pattern edge.

【0015】第3の工程300は、該第2の工程(200)でカ
ウントされた画素の個数が最大となる始点の位置に基づ
いて、前記入力画素に含まれる複数のパターンの中か
ら、前記特定パターンTを検出する工程である。請求項
2記載の発明は、図8に示すように、前記第2の工程(2
00)において、入力画像中のパターンエッジを構成する
と判定された画素のカウントされた個数が、所定の基準
値に満たない場合には、当該始点に対するパターンエッ
ジの判定を途中で中断し、前記当該始点の位置を変更す
るようにしたことを特徴とする。
The third step 300 is to select one of the plurality of patterns included in the input pixel based on the position of the starting point where the number of pixels counted in the second step (200) is maximum. This is a step of detecting the specific pattern T. According to a second aspect of the present invention, as shown in FIG. 8, the second step (2
In (00), when the counted number of pixels determined to form a pattern edge in the input image is less than a predetermined reference value, the determination of the pattern edge for the start point is interrupted midway, and the The feature is that the position of the starting point is changed.

【0016】請求項3記載の発明は、図7に示すよう
に、前記第2の工程(200)において、前記隣接する複数
の画素の階調値をそれぞれ求め、求めた各階調値の最大
値と最小値との差が、予め設定された基準値を越えた場
合に、パターンエッジを構成するものと判定するように
したことを特徴とする。請求項4記載の発明は、図8に
示すように、前記第2の工程(200)において、前記隣接
する複数の画素の階調値をそれぞれ求め、求めた各階調
値に基づいて平滑化微分をそれぞれ行い、これらの平滑
化微分を行って得た結果の最大値と最小値との差が、予
め設定された基準値を越えた場合に、パターンエッジを
構成するものと判定するようにしたことを特徴とする。
According to a third aspect of the present invention, as shown in FIG. 7, in the second step (200), the gradation values of the plurality of adjacent pixels are obtained, and the maximum value of the obtained gradation values is obtained. And the minimum value exceeds a preset reference value, it is determined that the pattern edge is configured. According to a fourth aspect of the present invention, as shown in FIG. 8, in the second step (200), the gradation values of the plurality of adjacent pixels are obtained, and the smoothing differentiation is performed based on the obtained gradation values. When the difference between the maximum value and the minimum value of the results obtained by performing these smoothing differentiations exceeds a preset reference value, it is determined that the pattern edge is formed. It is characterized by

【0017】[0017]

【作 用】したがって、請求項1記載の発明によれば、
従来の必要としていた複雑な相互相関演算処理が不要と
なる。すなわち、第1の工程(100)で登録された、例え
ば図1に例示する参照画像中の特定パターンTのエッジ
の方向を、第2の工程(200)で判定する画素の移動情報
として使用している。
[Operation] Therefore, according to the invention of claim 1,
The complicated cross-correlation calculation processing conventionally required becomes unnecessary. That is, for example, the direction of the edge of the specific pattern T in the reference image illustrated in FIG. 1 registered in the first step (100) is used as the movement information of the pixel determined in the second step (200). ing.

【0018】このため、第2の工程(200)では、隣接す
る画素がパターンエッジを構成するか否かの単純な比較
処理を行い、その結果を単にカウントすれば足る。ま
た、第3の工程(300)でも、第2の工程(200)でカウント
された各始点毎のカウント値を単純に比較するだけで足
る。請求項2記載の発明によれば、第2の工程(200)に
おいて、入力画像中のパターンエッジを構成すると判定
された画素のカウントされた個数が、所定の基準値に満
たない場合には、当該始点を含むパターンと参照画像中
の特定パターンTとのマッチング度が低いと予想され
る。
Therefore, in the second step (200), it suffices to perform a simple comparison process to determine whether or not adjacent pixels form a pattern edge, and simply count the result. Also, in the third step (300), it is sufficient to simply compare the count values for each starting point counted in the second step (200). According to the second aspect of the present invention, in the second step (200), when the counted number of pixels determined to form the pattern edge in the input image is less than a predetermined reference value, It is expected that the degree of matching between the pattern including the starting point and the specific pattern T in the reference image is low.

【0019】このため、当該始点に対するパターンエッ
ジの判定を途中で中断させることで、以後の判定を省略
できる。請求項3記載の発明によれば、隣接する複数の
画素の階調をそれぞれ求め、求めた複数の階調値の最大
値と最小値とを比較しているので、入力画像の明るさや
コントラストによる階調変化を除くことができる。
Therefore, by interrupting the determination of the pattern edge with respect to the starting point, the subsequent determination can be omitted. According to the third aspect of the present invention, since the gradations of a plurality of adjacent pixels are respectively obtained and the maximum value and the minimum value of the obtained plural gradation values are compared, it depends on the brightness and contrast of the input image. It is possible to eliminate gradation changes.

【0020】請求項4記載の発明によれば、求めた複数
の階調値に基づいて平滑化微分をそれぞれ行い、それら
の最大値と最小値とを比較しているので、入力画像の明
るさやコントラストによる階調変化を除くことができ
る。これに加え、平滑化微分を行うことで、求めた複数
の階調値の変化量を強調することができる。
According to the fourth aspect of the present invention, smoothing differentiation is performed on the basis of the obtained plurality of gradation values, and the maximum value and the minimum value are compared, so that the brightness of the input image and the It is possible to eliminate the gradation change due to the contrast. In addition to this, by performing smoothing differentiation, it is possible to emphasize the obtained variation amounts of a plurality of gradation values.

【0021】[0021]

【実施例】図1〜11は、本発明の一実施例を示すもの
であり、図1は参照画像の一例を示す説明図、図2は画
像処理装置を示すブロック図、図3は画像処理方法を示
すフローチャート、図4は図3の第1の工程を示すフロ
ーチャート、図5は図1の参照画像のパターンエッジの
方向を示す説明図、図6は図1の参照画像の一部を拡大
した説明図、図7は入力画像の明暗の判定方法を示す説
明図、図8は入力画像の明暗の他の判定方法を示す説明
図、図9は入力画像の一例を示す説明図、図10は入力
画像の明暗の判定方向を示す説明図、図11は図3の第
2の工程及び第3の工程を示すフローチャートをそれぞ
れ示す。
1 to 11 show an embodiment of the present invention, FIG. 1 is an explanatory view showing an example of a reference image, FIG. 2 is a block diagram showing an image processing apparatus, and FIG. 3 is image processing. FIG. 4 is a flowchart showing the method, FIG. 4 is a flowchart showing the first step of FIG. 3, FIG. 5 is an explanatory view showing the direction of the pattern edge of the reference image of FIG. 1, and FIG. FIG. 7 is an explanatory diagram showing a method for determining the brightness of an input image, FIG. 8 is an explanatory diagram showing another method for determining the brightness of an input image, and FIG. 9 is an explanatory diagram showing an example of the input image. FIG. 11 is an explanatory diagram showing the light / darkness determination direction of the input image, and FIG. 11 is a flowchart showing the second step and the third step of FIG. 3, respectively.

【0022】まず、本発明の画像処理方法は、参照画像
の特定パターンの輪郭、すなわちエッジと、入力画像に
含まれるであろう複数のパターンのパターンエッジとを
比較することにより、参照画像の特定パターンが、入力
画像中のどの部分に存在するかの判定を行っている。す
なわち、参照画像の特定パターンのエッジのある1つの
A点と、このA点とマッチングするであろう入力画像中
の1つのB点とを比較した場合に、入力画像中のB点の
周囲には、パターンエッジを構成するための必ず明暗差
が存在との考え方に基づいている。
First, the image processing method of the present invention specifies the reference image by comparing the contours of the specific pattern of the reference image, that is, the edges, with the pattern edges of a plurality of patterns that may be included in the input image. It is determined in which part of the input image the pattern exists. That is, when one point A having an edge of the specific pattern of the reference image is compared with one point B in the input image that is likely to match this point A, the point A around the point B in the input image is compared. Is based on the idea that there is always a difference between light and dark to form a pattern edge.

【0023】このため、参照画像中のA点と入力画像中
のB点とを直接対比するのでなく、参照画像の特定パタ
ーンのエッジの方向を1つの起点から順番に記憶してお
き、この方向に基づいて、明暗差の判定箇所を移動して
いる。すなわち、入力画像中の各画素を始点として、該
始点となる画素から、先に記憶された参照画像の特定パ
ターンのエッジの方向に従って順番に画素を移動させ、
当該画素を中心に明暗差の判定を行っている。
Therefore, instead of directly comparing the point A in the reference image with the point B in the input image, the direction of the edge of the specific pattern of the reference image is stored in order from one starting point, and this direction is stored. Based on the above, the determination point for the difference in brightness is moved. That is, with each pixel in the input image as the starting point, the pixel is moved in order from the starting point pixel in accordance with the direction of the edge of the previously stored specific pattern of the reference image,
The brightness difference is determined centering on the pixel.

【0024】そして、明暗差の最も多く存在する入力画
像中のある始点を、参照画像の特定パターンの起点と一
致するものと判定している。つぎに、図2を用いて、本
発明の画像処理方法に用いられる画像処理装置について
説明する。図2中、10は、画像処理装置を示し、この画
像処理装置10は、中央制御部11、画像メモリ部12、画像
演算処理部13を有する。そして、中央制御部11、画像メ
モリ部12、画像演算処理部13は、それぞれシステムバス
14及びデータバス15を介して相互に接続されている。
Then, it is determined that a certain starting point in the input image having the largest difference in brightness and darkness coincides with the starting point of the specific pattern of the reference image. Next, the image processing apparatus used in the image processing method of the present invention will be described with reference to FIG. In FIG. 2, reference numeral 10 denotes an image processing device, and the image processing device 10 has a central control unit 11, an image memory unit 12, and an image calculation processing unit 13. The central control unit 11, the image memory unit 12, and the image calculation processing unit 13 are respectively connected to the system bus.
They are mutually connected via 14 and a data bus 15.

【0025】上記中央制御部11は、図示しないが、CP
Uを中心にRAM及びROM等から構成され、画像の入
出力操作や演算処理操作等のコントロールを行うための
ものである。前記画像処理装置10のデータバス15側に
は、図2に示すように、オペレータが画像の入出力操作
をするとともに、処理結果を表示するためのアプリケー
ション部20が、インターフェース部21を介して接続され
ている。また、TVモニタ等の表示装置30がD/Aコン
バータ31を介して画像処理装置10のデータバス15側に接
続されている。さらに、TVカメラ等の撮像素子40が、
A/Dコンバータ41を介して画像処理装置10のデータバ
ス15側に接続されている。
Although not shown, the central control unit 11 has a CP
It is composed of a RAM, a ROM, and the like centering on U, and is for performing control such as image input / output operation and arithmetic processing operation. As shown in FIG. 2, the data bus 15 side of the image processing apparatus 10 is connected to an application unit 20 for displaying an image processing result by an operator through an interface unit 21 while an operator inputs and outputs an image. Has been done. A display device 30 such as a TV monitor is connected to the data bus 15 side of the image processing device 10 via a D / A converter 31. Furthermore, the image pickup device 40 such as a TV camera is
It is connected to the data bus 15 side of the image processing apparatus 10 via the A / D converter 41.

【0026】つぎに、図3のフローチャートを用いて、
本発明の画像処理方法を説明する。本発明の画像処理方
法は、図3に示すように、つぎの4つの各工程100〜400
から構成されている。まず、第1の工程100は、図1に
例示する参照画像中の特定パターンTのエッジを構成す
る複数の画素のうちの1つを起点T(0)とし、前記複数
の画素それぞれが位置するエッジの方向を、前記起点T
(0)より順番に登録する工程である。そして、エッジの
方向を示すデータは、参照画像データとして、図2に示
す中央制御部11中のメモリ内に格納される。
Next, using the flowchart of FIG.
The image processing method of the present invention will be described. The image processing method of the present invention, as shown in FIG.
It consists of First, in the first step 100, one of a plurality of pixels forming the edge of the specific pattern T in the reference image illustrated in FIG. 1 is set as a starting point T (0), and each of the plurality of pixels is located. The direction of the edge is defined as the starting point T
This is a process of sequentially registering from (0). Then, the data indicating the direction of the edge is stored as reference image data in the memory in the central control unit 11 shown in FIG.

【0027】上記第1の工程100の終了後、図3に示す
ように、次の第2の工程200に進む。上記第2の工程200
は、図9に例示する入力画像中の各画素を始点とし、該
始点となる画素から順番に前記第1の工程で登録した方
向に隣接する画素がパターンエッジを構成するか否かを
判定すると共に、パターンエッジを構成すると判定され
た画素の個数をカウントする工程である。
After completion of the first step 100, the process proceeds to the next second step 200 as shown in FIG. The second step 200
Is set to each pixel in the input image illustrated in FIG. 9 as a starting point, and it is determined whether or not pixels adjacent in the direction registered in the first step in order from the starting point pixel form a pattern edge. At the same time, it is a step of counting the number of pixels determined to form a pattern edge.

【0028】すなわち、図9に例示する入力画像は、図
2に示すように、撮像装置40で撮像され、その入力画像
データは、A/Dコンバータ41を介して画像処理装置10
に送出され、その画像メモリ部12内に格納される。一
方、中央制御部11中のメモリ内に格納された参照画像デ
ータが読み出され、この読み出された参照画像データ
と、画像メモリ部12内に格納された入力画像データと
が、画像演算処理部13で演算処理される。
That is, the input image illustrated in FIG. 9 is picked up by the image pickup device 40 as shown in FIG. 2, and the input image data is transmitted via the A / D converter 41 to the image processing device 10.
And is stored in the image memory unit 12. On the other hand, the reference image data stored in the memory of the central control unit 11 is read, and the read reference image data and the input image data stored in the image memory unit 12 are subjected to image calculation processing. The processing is performed by the unit 13.

【0029】上記第2の工程200の終了後、図3に示す
ように、次の第3の工程300に進む。上記第3の工程300
は、該第2の工程でカウントされた画素の個数が最大と
なる始点の位置に基づいて、前記入力画素に含まれる複
数のパターンの中から、前記特定パターンTを検出する
工程である。この第3の工程300も、前記第2の工程200
と同様に、図2に示す画像演算処理部13で演算処理され
る。
After the completion of the second step 200, the process proceeds to the next third step 300 as shown in FIG. Third step 300 above
Is a step of detecting the specific pattern T from a plurality of patterns included in the input pixel based on the position of the starting point where the number of pixels counted in the second step is the maximum. This third step 300 is also the same as the second step 200
Similarly, the image calculation processing unit 13 shown in FIG.

【0030】上記第3の工程300の終了後、図3に示す
ように、次の出力工程400に進む。上記出力工程400は、
第3の工程300の処理結果を、図2に示すように、イン
ターフェース部21を介してアプリケーション部20に出力
して表示する工程である。つぎに、上記した第1の工程
100の詳細を、図4に示したフローチャートを用いて具
体的に説明する。
After the completion of the third step 300, the process proceeds to the next output step 400 as shown in FIG. The output process 400 is
This is a step of outputting the processing result of the third step 300 to the application section 20 via the interface section 21 and displaying it, as shown in FIG. Next, the above-mentioned first step
Details of 100 will be specifically described with reference to the flowchart shown in FIG.

【0031】まず、参照画像とすべき特定パターンTが
刻まれたサンプルを撮像する。撮像して得られた参照画
像データは、演算処理時間の短縮化のために、図1に示
すように、p×q画素で構成される領域に分割される。
そして、p×q画素で構成される領域のデータの平均値
で代表する等の演算処理により、参照画像データの圧縮
平均化が行われる。
First, a sample in which a specific pattern T to be a reference image is engraved is picked up. The reference image data obtained by imaging is divided into regions composed of p × q pixels as shown in FIG. 1 in order to shorten the calculation processing time.
Then, the compression averaging of the reference image data is performed by a calculation process such as representing the average value of the data of the region formed by p × q pixels.

【0032】その後、図4に示すように、第1ステップ
101に進み、起点画素T(0)の指定が行われる。具体的に
は、オペレータがディスプレイ上の任意の平均化画素
を、例えばマウス等を用いて指定することにより行われ
る。上記第1ステップ101終了後、図4に示すように、
第2ステップ102に進む。
Then, as shown in FIG. 4, the first step
In step 101, the starting pixel T (0) is designated. Specifically, it is performed by the operator designating an arbitrary averaging pixel on the display using, for example, a mouse. After the first step 101 is completed, as shown in FIG.
Proceed to the second step 102.

【0033】上記第2ステップ102では、図6に示すよ
うに、指定された起点画素T(0)を中心とした3×3の
計9個の平均化画素A〜Iの各階調値G(A)〜G(I)の平
均値Gh(0)を算出する。具体的に図6の中心に位置す
る平均化画素Eは、起点画素T(0)がp×q画素で構成
される領域内に位置するので、図1中では、(p=3,
q=4)の座標で表せる。同様に、平均化画素Aは、
(p=2,q=3)、平均化画素Bは(p=2,q=
4)、平均化画素Cは(p=2,q=5)、平均化画素
Dは(p=3,q=3)、平均化画素Fは(p=3,q
=5)、平均化画素Gは(p=4,q=3)、平均化画
素Hは(p=4,q=4)、平均化画素Iは(p=4,
q=5)の座標で図1においてそれぞれ示すことができ
る。
In the second step 102, as shown in FIG. 6, each grayscale value G (9) of a total of nine averaging pixels A to I of 3 × 3 centered on the designated starting pixel T (0). The average value Gh (0) of A) to G (I) is calculated. Specifically, since the averaging pixel E located at the center of FIG. 6 is located in the area where the starting point pixel T (0) is composed of p × q pixels, in FIG.
It can be represented by the coordinates of q = 4). Similarly, the averaging pixel A is
(P = 2, q = 3), the averaged pixel B is (p = 2, q =
4), the averaging pixel C is (p = 2, q = 5), the averaging pixel D is (p = 3, q = 3), and the averaging pixel F is (p = 3, q).
= 5), the averaging pixel G is (p = 4, q = 3), the averaging pixel H is (p = 4, q = 4), and the averaging pixel I is (p = 4, q = 4).
Each can be shown in FIG. 1 by the coordinates of q = 5).

【0034】ここで、階調値G(A)は、図6の平均化画
素Aの階調値を示している。同様に、階調値G(B)は、
平均化画素B、階調値G(C)は平均化画素C、階調値G
(D)は平均化画素D、階調値G(E)は平均化画素E、階調
値G(F)は平均化画素F、階調値G(G)は平均化画素G、
階調値G(H)は平均化画素H、階調値G(I)は平均化画素
Iの各階調値をそれぞれ示す。
Here, the gradation value G (A) indicates the gradation value of the averaging pixel A in FIG. Similarly, the gradation value G (B) is
Averaged pixel B and gradation value G (C) are averaged pixel C and gradation value G
(D) is an averaging pixel D, tone value G (E) is an averaging pixel E, tone value G (F) is an averaging pixel F, tone value G (G) is an averaging pixel G,
The gradation value G (H) represents each gradation value of the averaging pixel H, and the gradation value G (I) represents each gradation value of the averaging pixel I.

【0035】上記第2ステップ102の終了後、第3ステ
ップ103及び第4ステップ104に進み、起点画素T(0)に
おける方向D(0)が判定される。方向D(0)は、起点画素
T(0)における次に進むべき方向を示している。具体的
には、図5に示すように、各方向「1」〜「4」の番号
を付して、当該番号に特定される。
After the completion of the second step 102, the process proceeds to the third step 103 and the fourth step 104, and the direction D (0) at the starting pixel T (0) is determined. The direction D (0) indicates the direction in which the starting pixel T (0) should proceed. Specifically, as shown in FIG. 5, the numbers “1” to “4” are assigned to the respective directions, and the numbers are specified.

【0036】第3ステップ103では、方向D(0)が「1」
であるか否かが判定される。すなわち、階調値G(A)〜
G(I)が、以下の条件を満足する場合には、方向D(0)が
「1」と判定される。 (1) G(D)>Gh(0),G(E)>Gh(0),G(F)>Gh(0)
の全ての条件を満足する場合。
In the third step 103, the direction D (0) is "1".
Is determined. That is, the gradation value G (A)
When G (I) satisfies the following conditions, the direction D (0) is determined to be "1". (1) G (D)> Gh (0), G (E)> Gh (0), G (F)> Gh (0)
When all the conditions of are satisfied.

【0037】(2) G(D)<Gh(0),G(E)<Gh(0),G
(F)<Gh(0)の全ての条件を満足する場合。ここで、上
記条件(1)又は(2)のいずれかの条件を満足する場合に
は、当該起点画素T(0)の方向D(0)が「1」の方向か
「3」の方向か区別できない。そこで、本実施例では、
「1」の方向を優先させている。
(2) G (D) <Gh (0), G (E) <Gh (0), G
When all the conditions of (F) <Gh (0) are satisfied. Here, when either of the above conditions (1) or (2) is satisfied, whether the direction D (0) of the origin pixel T (0) is the direction of “1” or the direction of “3” Indistinguishable. Therefore, in this embodiment,
The direction of "1" is prioritized.

【0038】なお、「1」の方向でなく、逆に「3」の
方向を優先させてもよい。上記条件(1)、(2)のいずれを
も満足しない場合には、第4ステップ104に進む。第4
ステップ104では、方向D(0)が「4」であるか否かが判
定される。すなわち、階調値G(A)〜G(I)が、以下の条
件を満足する場合には、方向D(0)が「4」と判定され
る。
The direction of "3" may be prioritized instead of the direction of "1". If neither of the above conditions (1) and (2) is satisfied, the process proceeds to the fourth step 104. Fourth
In step 104, it is determined whether the direction D (0) is "4". That is, when the gradation values G (A) to G (I) satisfy the following conditions, the direction D (0) is determined to be "4".

【0039】(3) G(B)>Gh(0),G(E)>Gh(0),G
(H)>Gh(0)の全ての条件を満足する場合。 (4) G(B)<Gh(0),G(E)<Gh(0),G(H)<Gh(0)
の全ての条件を満足する場合。ここで、上記条件(3)又
は(4)のいずれかの条件を満足する場合には、当該起点
画素T(0)の方向D(0)が「2」の方向か「4」の方向か区
別できない。
(3) G (B)> Gh (0), G (E)> Gh (0), G
When all the conditions of (H)> Gh (0) are satisfied. (4) G (B) <Gh (0), G (E) <Gh (0), G (H) <Gh (0)
When all the conditions of are satisfied. Here, when either of the above conditions (3) or (4) is satisfied, whether the direction D (0) of the origin pixel T (0) is the "2" direction or the "4" direction is determined. Indistinguishable.

【0040】そこで、本実施例では、「4」の方向を優
先させている。なお、「4」の方向でなく、逆に「2」
の方向を優先させてもよい。上記(1)〜(4)のいずれかの
条件を満足する場合には、次の第5ステップ105に進
む。また、上記(1)〜(4)のいずれの条件をも満足しない
場合には、起点画素T(0)の指定が不適切であり、第1
ステップ101に戻る。
Therefore, in this embodiment, the direction "4" is prioritized. Note that the direction is not "4" but "2"
The direction of may be prioritized. When any of the above conditions (1) to (4) is satisfied, the process proceeds to the next fifth step 105. If none of the above conditions (1) to (4) is satisfied, the designation of the starting pixel T (0) is inappropriate and the first pixel
Return to step 101.

【0041】上記第4ステップ104の終了後、図4に示
すように、次の第5ステップ105に進み、初期化が行わ
れる。具体的には、参照画像データ中の特定パターンT
の参照画像データ数Lを「0」とするとともに、特定パ
ターンTのエッジの方向D(L)(L>0)を「0」とす
る。
After completion of the fourth step 104, as shown in FIG. 4, the process proceeds to the next fifth step 105, and initialization is performed. Specifically, the specific pattern T in the reference image data
The reference image data number L is set to “0”, and the edge direction D (L) (L> 0) of the specific pattern T is set to “0”.

【0042】ここで、上記参照画像データ数Lは、処理
をする指定画素T(L)が、起点T(0)となる画素、すなわ
ち起点画素T(0)から数えて何番目の画素にあたるかを
示している。当然のことながら、指定画素T(0)は起点
画素T(0)と同一である。また、前記方向D(L)は、参照
画像データ数L番目の指定画素T(L)における次に進む
べき方向を示している。具体的には、方向D(L)は、図
5に示すように、各方向に「1」〜「4」の番号を付し
て、当該番号により特定される。
Here, the reference image data number L corresponds to the pixel at which the designated pixel T (L) to be processed becomes the starting point T (0), that is, the number of pixels counted from the starting point pixel T (0). Is shown. Of course, the designated pixel T (0) is the same as the starting pixel T (0). The direction D (L) indicates the direction in which the designated pixel T (L) having the L-th reference image data number should proceed to the next direction. Specifically, as shown in FIG. 5, the direction D (L) is specified by assigning numbers “1” to “4” to the respective directions.

【0043】上記第5ステップ105の終了後、図4に示
すように、次の第6ステップ106に進む。上記第6ステ
ップ106では、前記第2ステップ102で平均階調値G(0)
を求めたと同様にして、図6に示すように、参照画像デ
ータ数L番目の指定画素T(L)を中心とした3×3の計
9個の平均化画素A〜Iの各階調値G(A)〜G(I)の平均
値Gh(L)を算出する。
After completion of the fifth step 105, the process proceeds to the next sixth step 106 as shown in FIG. In the sixth step 106, the average gradation value G (0) is obtained in the second step 102.
Similarly to the above, as shown in FIG. 6, each gradation value G of a total of nine averaging pixels A to I of 3 × 3 centered on the designated pixel T (L) of the L-th reference image data number The average value Gh (L) of (A) to G (I) is calculated.

【0044】具体的に図6の中心に位置する平均化画素
Eは、起点画素T(0)がp×q画素で構成される領域内
に位置するので、図1中では、(p=3,q=4)の座
標で表せる。同様に、平均化画素Aは、(p=2,q=
3)、平均化画素Bは(p=2,q=4)、平均化画素
Cは(p=2,q=5)、平均化画素Dは(p=3,q
=3)、平均化画素Fは(p=3,q=5)、平均化画
素Gは(p=4,q=3)、平均化画素Hは(p=4,
q=4)、平均化画素Iは(p=4,q=5)の座標で
図1においてそれぞれ示すことができる。
Specifically, the averaging pixel E located at the center of FIG. 6 is located in the area where the starting point pixel T (0) is composed of p × q pixels, so in FIG. 1, (p = 3 , Q = 4). Similarly, the averaged pixel A has (p = 2, q =
3), the averaging pixel B is (p = 2, q = 4), the averaging pixel C is (p = 2, q = 5), and the averaging pixel D is (p = 3, q).
= 3), the averaging pixel F (p = 3, q = 5), the averaging pixel G (p = 4, q = 3), and the averaging pixel H (p = 4, q = 3).
q = 4) and the averaged pixel I can be shown in FIG. 1 by the coordinates (p = 4, q = 5), respectively.

【0045】ここで、階調値G(A)は、図6の平均化画
素Aの階調値を示している。同様に、階調値G(B)は、
平均化画素B、階調値G(C)は平均化画素C、階調値G
(D)は平均化画素D、階調値G(E)は平均化画素E、階調
値G(F)は平均化画素F、階調値G(G)は平均化画素G、
階調値G(H)は平均化画素H、階調値G(I)は平均化画素
Iの各階調値をそれぞれ示す。
Here, the gradation value G (A) indicates the gradation value of the averaging pixel A in FIG. Similarly, the gradation value G (B) is
Averaged pixel B and gradation value G (C) are averaged pixel C and gradation value G
(D) is an averaging pixel D, tone value G (E) is an averaging pixel E, tone value G (F) is an averaging pixel F, tone value G (G) is an averaging pixel G,
The gradation value G (H) represents each gradation value of the averaging pixel H, and the gradation value G (I) represents each gradation value of the averaging pixel I.

【0046】また、平均階調値Gh(L)は、参照画像デ
ータ数L番目の指定画素T(L)を中心とした3×3の計
9個の平均化画素A〜Iの各階調値G(A)〜G(I)の平均
値を示す。上記第6ステップ106の終了後、第7ステッ
プ107〜第10ステップ110に進み、各ステップ107〜110
においては、指定画素T(L)における方向D(L)が判定さ
れる。
The average gradation value Gh (L) is the gradation value of each of the nine averaged pixels A to I of 3 × 3 centered on the designated pixel T (L) of the L-th reference image data number. The average value of G (A) to G (I) is shown. After completion of the sixth step 106, the process proceeds to the seventh step 107 to the tenth step 110, and steps 107 to 110 are executed.
In, the direction D (L) of the designated pixel T (L) is determined.

【0047】まず、第7ステップ107では、図4に示す
ように、方向D(L)が「1」であるか否かが判定され
る。すなわち、各階調値G(A)〜G(I)が、以下の条件a
〜cの計3つの条件の何れか1つの条件を満足する場合
には、方向D(L)が「1」と判定される。 条件a (i) G(D)>Gh(L),G(E)>Gh(L),G(F)>Gh
(L)の全ての条件を満足し、 かつ1つ前の指定画
素T(L-1)の方向D(L-1)が「1」の場合。
First, in the seventh step 107, as shown in FIG. 4, it is determined whether or not the direction D (L) is "1". That is, each gradation value G (A) to G (I) has the following condition a.
The direction D (L) is determined to be "1" when any one of the three conditions (1 to c) is satisfied. Condition a (i) G (D)> Gh (L), G (E)> Gh (L), G (F)> Gh
When all the conditions of (L) are satisfied, and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "1".

【0048】(ii) G(D)<Gh(L),G(E)<Gh(L),
G(F)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「1」の場合。すなわ
ち、上記条件aの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「1」で、かつ当該指定画素T(L)の方向D(L)が
「1」であり、方向D(L)が直線的に「1」の方向に延
びていることわかる。 条件b (i) G(E)>Gh(L),G(F)>Gh(L),G(H)>Gh
(L)の全ての条件を満足し、 かつ1つ前の指定画
素T(L-1)の方向D(L-1)が「4」の場合。
(Ii) G (D) <Gh (L), G (E) <Gh (L),
When all the conditions of G (F) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "1". That is, when either the condition (i) or (ii) of the condition a is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is “1”, the direction D (L) of the designated pixel T (L) is “1”, and the direction D (L) extends linearly in the direction of “1”. Condition b (i) G (E)> Gh (L), G (F)> Gh (L), G (H)> Gh
All the conditions of (L) are satisfied, and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "4".

【0049】(ii) G(E)<Gh(L),G(F)<Gh(L),
G(H)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「4」の場合。すなわ
ち、上記条件bの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「4」で、又、当該指定画素T(L)の方向D(L)が
「1」であり、「4」から「1」に向かってL字形に屈
曲して、「1」の方向に延びていることわかる。 条件c (i) G(B)>Gh(L),G(E)>Gh(L),G(F)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「2」の場合。
(Ii) G (E) <Gh (L), G (F) <Gh (L),
When all the conditions of G (H) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "4". That is, when either the condition (i) or (ii) of the condition b is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "4", the direction D (L) of the designated pixel T (L) is "1", and the direction is "1" by bending in an L shape from "4" to "1". You can see that it extends to. Condition c (i) G (B)> Gh (L), G (E)> Gh (L), G (F)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "2".

【0050】(ii) G(B)<Gh(L),G(E)<Gh(L),
G(F)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「2」の場合。すなわ
ち、上記条件cの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「2」で、又、当該指定画素T(L)の方向D(L)が
「1」であり、「2」から「1」に向かってL字形に屈
曲して、「1」の方向に延びていることわかる。
(Ii) G (B) <Gh (L), G (E) <Gh (L),
When all the conditions of G (F) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "2". That is, when either the condition (i) or (ii) of the condition c is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "2", the direction D (L) of the designated pixel T (L) is "1", and the direction is "1" by bending in an L shape from "2" to "1". You can see that it extends to.

【0051】なお、1つ前の指定画素T(L-1)の方向D
(L-1)が「3」の場合について除いたのは、方向「3」
は、方向「1」と逆向きになるので、指定画素T(L)が
逆進することがないためである。上記した条件a〜cの
計3つの条件の何れをも満足しない場合には、図4に示
すように、第7ステップ107から次の第8ステップ108に
進む。
The direction D of the previous designated pixel T (L-1)
Excluding the case where (L-1) is "3", the direction is "3"
Is because the direction is opposite to the direction “1”, and therefore the designated pixel T (L) does not move backward. If none of the above three conditions a to c are satisfied, the process proceeds from the seventh step 107 to the next eighth step 108 as shown in FIG.

【0052】上記第8ステップ108では、図4に示すよ
うに、方向D(L)が「2」であるか否かが判断される。
すなわち、各階調値G(A)〜G(I)が、以下の条件d〜f
の計3つの条件の何れか1つのを満足する場合には、方
向D(L)が「2」と判定される。 条件d (i) G(B)>Gh(L),G(E)>Gh(L),G(H)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「2」の場合。
In the eighth step 108, as shown in FIG. 4, it is judged whether or not the direction D (L) is "2".
That is, each of the gradation values G (A) to G (I) has the following conditions d to f.
If any one of the three conditions is satisfied, the direction D (L) is determined to be “2”. Condition d (i) G (B)> Gh (L), G (E)> Gh (L), G (H)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "2".

【0053】(ii) G(B)<Gh(L),G(E)<Gh(L),
G(H)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「2」の場合。すなわ
ち、上記条件dの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「2」で、かつ当該指定画素T(L)の方向D(L)が
「2」であり、方向D(L)が直線的に「2」の方向に延
びていることわかる。 条件e (i) G(D)>Gh(L),G(E)>Gh(L),G(H)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「1」の場合。
(Ii) G (B) <Gh (L), G (E) <Gh (L),
When all the conditions of G (H) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "2". That is, when either the condition (i) or (ii) of the condition d is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "2", the direction D (L) of the designated pixel T (L) is "2", and the direction D (L) extends linearly in the direction "2". Condition e (i) G (D)> Gh (L), G (E)> Gh (L), G (H)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "1".

【0054】(ii) G(D)<Gh(L),G(E)<Gh(L),
G(H)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「1」の場合。すなわ
ち、上記条件eの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「1」で、又、当該指定画素T(L)の方向D(L)が
「2」であり、「1」から「2」に向かってL字形に屈
曲して、「2」の方向に延びていることわかる。 条件f (i) G(E)>Gh(L),G(F)>Gh(L),G(H)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「3」である場合。
(Ii) G (D) <Gh (L), G (E) <Gh (L),
When all the conditions of G (H) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "1". That is, when either condition (i) or (ii) of the above condition e is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "1", the direction D (L) of the designated pixel T (L) is "2", and the direction is "2" by bending in an L shape from "1" to "2". You can see that it extends to. Condition f (i) G (E)> Gh (L), G (F)> Gh (L), G (H)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "3".

【0055】(ii) G(E)<Gh(L),G(F)<Gh(L),
G(H)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「3」である場合。すな
わち、上記条件fの(i)又は(ii)のいずれかの条件を満
足する場合には、1つ前の指定画素T(L-1)の方向D(L-
1)が「3」で、又、当該指定画素T(L)の方向D(L)が
「2」であり、「3」から「2」に向かってL字形に屈
曲して、「2」の方向に延びていることわかる。
(Ii) G (E) <Gh (L), G (F) <Gh (L),
When all the conditions of G (H) <Gh (L) are satisfied, and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "3". That is, when either the condition (i) or (ii) of the condition f is satisfied, the direction D (L-
1) is "3", the direction D (L) of the designated pixel T (L) is "2", and the pixel is bent in an L-shape from "3" to "2" to form "2". You can see that it extends in the direction of.

【0056】なお、1つ前の指定画素T(L-1)の方向D
(L-1)が「4」の場合について除いたのは、方向「4」
は、方向「2」と逆向きになるので、指定画素T(L)が
逆進することがないためである。上記した条件e〜fの
計3つの条件の何れをも満足しない場合には、図4に示
すように、第8ステップ108から次の第9ステップ109に
進む。
The direction D of the previous designated pixel T (L-1)
Excluding the case where (L-1) is "4", the direction is "4"
Is because the direction is opposite to the direction “2”, and therefore the designated pixel T (L) does not move backward. If none of the above three conditions e to f is satisfied, as shown in FIG. 4, the process proceeds from the eighth step 108 to the next ninth step 109.

【0057】上記第9ステップ109では、図4に示すよ
うに、方向D(L)が「3」であるか否かが判断される。
すなわち、各階調値G(A)〜G(I)が、以下の条件g〜i
の計3つの条件の何れか1つのを満足する場合には、方
向D(L)が「3」と判定される。 条件g (i) G(D)>Gh(L),G(E)>Gh(L),G(F)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「3」である場合。
In the ninth step 109, as shown in FIG. 4, it is judged whether or not the direction D (L) is "3".
That is, each of the gradation values G (A) to G (I) has the following conditions g to i.
When any one of the three conditions is satisfied, the direction D (L) is determined to be “3”. Condition g (i) G (D)> Gh (L), G (E)> Gh (L), G (F)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "3".

【0058】(ii) G(D)<Gh(L),G(E)<Gh(L),
G(F)<Gh(L)の全ての条件を満足し、 かつ1つ
前の指定画素T(L-1)の方向D(L-1)が「3」である場
合。すなわち、上記条件gの(i)又は(ii)のいずれかの
条件を満足する場合には、1つ前の指定画素T(L-1)の
方向D(L-1)が「3」で、かつ当該指定画素T(L)の方向
D(L)が「3」であり、方向D(L)が直線的に「3」の方
向に延びていることわかる。 条件h (i) G(B)>Gh(L),G(D)>Gh(L),G(E)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「2」の場合。
(Ii) G (D) <Gh (L), G (E) <Gh (L),
When all the conditions of G (F) <Gh (L) are satisfied, and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "3". That is, when either condition (i) or (ii) of the condition g is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "3". It is also understood that the direction D (L) of the designated pixel T (L) is “3” and the direction D (L) linearly extends in the direction “3”. Condition h (i) G (B)> Gh (L), G (D)> Gh (L), G (E)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "2".

【0059】(ii) G(B)<Gh(L),G(D)<Gh(L),
G(E)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「2」の場合。すなわ
ち、上記条件hの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「2」で、又、当該指定画素T(L)の方向D(L)が
「3」であり、「2」から「3」に向かってL字形に屈
曲して、「3」の方向に延びていることわかる。 条件i (i) G(D)>Gh(L),G(E)>Gh(L),G(H)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「4」の場合。
(Ii) G (B) <Gh (L), G (D) <Gh (L),
When all the conditions of G (E) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "2". That is, when either the condition (i) or (ii) of the condition h is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "2", the direction D (L) of the designated pixel T (L) is "3", and the direction is "3" by bending in an L shape from "2" to "3". You can see that it extends to. Condition i (i) G (D)> Gh (L), G (E)> Gh (L), G (H)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) in 1) is "4".

【0060】(ii) G(D)<Gh(L),G(E)<Gh(L),
G(H)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「4」の場合。すなわ
ち、上記条件iの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「4」で、又、当該指定画素T(L)の方向D(L)が
「3」であり、「4」から「3」に向かってL字形に屈
曲して、「3」の方向に延びていることわかる。
(Ii) G (D) <Gh (L), G (E) <Gh (L),
When all the conditions of G (H) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "4". That is, when either the condition (i) or (ii) of the condition i is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "4", the direction D (L) of the designated pixel T (L) is "3", and the designated pixel T (L) is bent in an L shape from "4" to "3", and the direction is "3". You can see that it extends to.

【0061】なお、1つ前の指定画素T(L-1)の方向D
(L-1)が「1」の場合について除いたのは、方向「1」
は、方向「3」と逆向きになるので、指定画素T(L)が
逆進することがないためである。上記した条件g〜iの
計3つの条件の何れをも満足しない場合には、図4に示
すように、第9ステップ109から次の第10ステップ110
に進む。
The direction D of the previous designated pixel T (L-1)
Excluding the case where (L-1) is "1", the direction is "1".
Is because the direction is opposite to the direction “3”, and therefore the designated pixel T (L) does not move backward. If none of the above three conditions g to i are satisfied, as shown in FIG. 4, the ninth step 109 to the next tenth step 110 are performed.
Proceed to.

【0062】上記第10ステップ110では、図4に示す
ように、方向D(L)が「4」であるか否かが判断され
る。すなわち、各階調値G(A)〜G(I)が、以下の条件j
〜lの計3つの条件の何れか1つの条件を満足する場合
には、方向D(L)が「4」と判定される。 条件j (i) G(B)>Gh(L),G(E)>Gh(L),G(H)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「4」の場合。
In the tenth step 110, as shown in FIG. 4, it is determined whether or not the direction D (L) is "4". That is, each of the gradation values G (A) to G (I) has the following condition j.
The direction D (L) is determined to be “4” when any one of the three conditions of 1 to 3 is satisfied. Condition j (i) G (B)> Gh (L), G (E)> Gh (L), G (H)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) in 1) is "4".

【0063】(ii) G(B)<Gh(L),G(E)<Gh(L),
G(H)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「4」の場合。すなわ
ち、上記条件jの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「4」で、かつ当該指定画素T(L)の方向D(L)が
「4」であり、方向D(L)が直線的に「4」の方向に延
びていることわかる。 条件k (i) G(B)>Gh(L),G(D)>Gh(L),G(E)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「1」の場合。
(Ii) G (B) <Gh (L), G (E) <Gh (L),
When all the conditions of G (H) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "4". That is, when either the condition (i) or (ii) of the condition j is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "4", the direction D (L) of the designated pixel T (L) is "4", and the direction D (L) extends linearly in the direction "4". Condition k (i) G (B)> Gh (L), G (D)> Gh (L), G (E)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "1".

【0064】(ii) G(B)<Gh(L),G(D)<Gh(L),
G(E)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「1」の場合。すなわ
ち、上記条件kの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「1」で、又、当該指定画素T(L)の方向D(L)が
「4」であり、「1」から「4」に向かってL字形に屈
曲して、「4」の方向に延びていることわかる。 条件l (i) G(B)>Gh(L),G(E)>Gh(L),G(F)>Gh
(L)の全ての条件を満足し、かつ1つ前の指定画素T(L-
1)の方向D(L-1)が「3」の場合。
(Ii) G (B) <Gh (L), G (D) <Gh (L),
When all the conditions of G (E) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "1". That is, when either the condition (i) or (ii) of the condition k is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "1", the direction D (L) of the designated pixel T (L) is "4", and the direction is "4" by bending in an L shape from "1" to "4". You can see that it extends to. Condition l (i) G (B)> Gh (L), G (E)> Gh (L), G (F)> Gh
All the conditions of (L) are satisfied, and the previous designated pixel T (L-
When the direction D (L-1) of 1) is "3".

【0065】(ii) G(B)<Gh(L),G(E)<Gh(L),
G(F)<Gh(L)の全ての条件を満足し、かつ1つ前の指
定画素T(L-1)の方向D(L-1)が「3」の場合。すなわ
ち、上記条件lの(i)又は(ii)のいずれかの条件を満足
する場合には、1つ前の指定画素T(L-1)の方向D(L-1)
が「3」で、又、当該指定画素T(L)の方向D(L)が
「4」であり、「3」から「4」に向かってL字形に屈
曲して、「4」の方向に延びていることわかる。
(Ii) G (B) <Gh (L), G (E) <Gh (L),
When all the conditions of G (F) <Gh (L) are satisfied and the direction D (L-1) of the immediately preceding designated pixel T (L-1) is "3". That is, when either the condition (i) or (ii) of the condition 1 is satisfied, the direction D (L-1) of the immediately preceding designated pixel T (L-1)
Is "3", and the direction D (L) of the designated pixel T (L) is "4", and the direction is "4" by bending in an L shape from "3" to "4". You can see that it extends to.

【0066】なお、1つ前の指定画素T(L-1)の方向D
(L-1)が「2」の場合について除いたのは、方向「2」
は、方向「4」と逆向きになるので、指定画素T(L)が
逆進することがないためである。上記した条件j〜lの
計3つの条件の何れをも満足しない場合には、図4に示
すように、参照画像データの作成が不能であるため、処
理を終了する。
The direction D of the previous designated pixel T (L-1)
Excluding the case where (L-1) is "2", the direction is "2"
Is because the direction is opposite to the direction “4”, and therefore the designated pixel T (L) does not reverse. When none of the above three conditions j to l is satisfied, the reference image data cannot be created, as shown in FIG. 4, and the process ends.

【0067】これに対し、第7ステップ107〜第10ス
テップ110において、各条件a〜lのいずれかの満足す
る場合には、図4に示すように、第11ステップ111に
進む。上記第11ステップ111においては、図4に示す
ように、指定画像T(L)を方向D(L)に従って平均化画素
の1個分、移動する。上記第11ステップ111の終了
後、図4に示すように、第12ステップ112に進む。
On the other hand, in the seventh step 107 to the tenth step 110, if any of the conditions a to l is satisfied, the process proceeds to the eleventh step 111 as shown in FIG. In the eleventh step 111, as shown in FIG. 4, the designated image T (L) is moved by one averaging pixel in the direction D (L). After completion of the 11th step 111, the process proceeds to the 12th step 112 as shown in FIG.

【0068】上記第12ステップ112においては、図4
に示すように、参照画像データ数Lの値に「1」を加算
することで、指定画像T(L)が平均化画素の1個分移動
したことを明示する。上記第12ステップ112の終了
後、図4に示すように、第13ステップ113に進む。
In the twelfth step 112, as shown in FIG.
As shown in, the addition of "1" to the value of the reference image data number L clearly indicates that the designated image T (L) has moved by one averaging pixel. After the twelfth step 112 is finished, the process proceeds to the thirteenth step 113 as shown in FIG.

【0069】上記第13ステップ113では、指定画像T
(L)が、起点画素T(0)の位置まで戻り、特定パターンT
のパターンエッジに沿って一巡したか否かを判定してい
る。上記第13ステップ113において、指定画像T(L)が
一巡していないと判定された場合には、第6ステップ10
6に戻り、上記したステップを繰り返す。
In the 13th step 113, the designated image T
(L) returns to the position of the starting pixel T (0), and the specific pattern T
It is determined whether or not one round has been performed along the pattern edge of. When it is determined in the 13th step 113 that the designated image T (L) has not completed one cycle, the 6th step 10
Return to 6 and repeat the steps above.

【0070】これに対し、指定画像T(L)が一巡した判
定された場合には、図4に示すように、第13ステップ
113から第14ステップ114に進む。第14ステップ114
では、図4に示すように、参照画像データ数Lと、起点
画素T(0)の方向D(0)から順番に、指定画素T(1)の方
向D(1)、指定画素T(2)の方向D(2)、・・・起点画素
T(0)の手前に位置する指定画素T(L-1)の方向D(L-1)
を記憶する。
On the other hand, when it is determined that the designated image T (L) has completed one cycle, as shown in FIG.
From 113, the process proceeds to the 14th step 114. Fourteenth step 114
Then, as shown in FIG. 4, the reference pixel data number L and the direction D (1) of the designated pixel T (1) and the designated pixel T (2) are sequentially arranged from the direction D (0) of the starting pixel T (0). ) Direction D (2), ... Direction D (L-1) of the designated pixel T (L-1) located in front of the starting pixel T (0)
Memorize

【0071】すなわち、参照画像データ数Lと、方向D
(0)・・・D(L-1)を参照画像データとして、図2に示す
中央制御部11のメモリ内に格納する。例えば、図1に示
す特定パターンTを例に挙げると、そのエッジを構成す
る参照画像データ数Lは、「20」となる。また、参照
画像データの方向は、「4,1,1,1,2,2,2,
1,1,2,2,3,3,3,4,4,3,3,4,
4」となる。
That is, the number L of reference image data and the direction D
(0) ... D (L-1) is stored as reference image data in the memory of the central control unit 11 shown in FIG. For example, taking the specific pattern T shown in FIG. 1 as an example, the number L of reference image data forming the edge is “20”. The direction of the reference image data is "4, 1, 1, 1, 2, 2, 2, 2.
1, 1, 2, 2, 3, 3, 3, 4, 4, 3, 3, 4,
4 ”.

【0072】つぎに、図7,8を用いて、入力画像の明
暗差の判定方法について説明する。まず、明暗差の判定
に先立ち、入力画像データの画像処理について、図9に
例示する入力画像を例にとって説明する。まず、入力画
像を、図2に示すように、撮像装置40で撮像し、得られ
た入力画像データを、A/Dコンバータ41を介して画像
処理装置10に取り込み、その内部の画像メモリ部12内に
格納する。
Next, with reference to FIGS. 7 and 8, a method of determining the difference between the lightness and darkness of the input image will be described. First, the image processing of the input image data will be described with reference to the input image illustrated in FIG. 9 as an example prior to the determination of the brightness difference. First, as shown in FIG. 2, an input image is picked up by the image pickup device 40, the obtained input image data is fetched into the image processing device 10 via the A / D converter 41, and the image memory unit 12 therein is provided. Store in.

【0073】上記格納された入力画像データは、図2に
示す画像処理装置10の内部の画像演算処理部13で、参照
画像データと同様に、平均圧縮化が行われる。平均圧縮
化の手法は、先に参照画像データの箇所で説明したのと
同様に、図9に示すように、p×q画素で構成される領
域に分割され、該p×q画素で構成される領域のデータ
の平均値で代表する等の演算処理により、入力画像デー
タの圧縮平均化が行われる。
The stored input image data is average-compressed in the image arithmetic processing unit 13 inside the image processing apparatus 10 shown in FIG. 2, similarly to the reference image data. As in the case of the reference image data, the average compression method is divided into regions composed of p × q pixels and composed of p × q pixels, as shown in FIG. The compression averaging of the input image data is performed by an arithmetic process such as representing the average value of the data of the area.

【0074】以下に、入力画像データの平均化画素に対
する明暗の判定方法について、図7,8を用いて説明す
る。上記明暗の判定方法としては、つぎの2通りの方法
がある。まず、第1の判定方法は、図7に示すように、
中心となる平均化画素からそれぞれ前後n個離れた位置
の、中心となる平均化画素を除いた計2n個の平均化画
素の階調をそれぞれ求めている。
Hereinafter, a method of determining the brightness of the averaged pixels of the input image data will be described with reference to FIGS. There are the following two methods for determining the brightness. First, the first determination method is as shown in FIG.
The gray scales of a total of 2n averaged pixels at positions separated by n from the center of the averaged pixel before and after, respectively, excluding the centered averaged pixel, are obtained.

【0075】上記中心となる平均化画素の前後とは、参
照画像のエッジの方向に基づいて決定され、該方向に直
交する方向を指している。例えば、図10に示すよう
に、中心となる平均化画素に対応する、参照画像のエッ
ジの方向が縦方向、すなわち上下方向に延びている場合
には、その横方向、すなわち左右方向に位置する。これ
に対し、中心となる平均化画素が横方向、すなわち左右
方向に延びている場合には、その縦方向、すなわち上下
方向に位置する。
The front and back of the centered average pixel is determined based on the direction of the edge of the reference image, and refers to the direction orthogonal to the direction. For example, as shown in FIG. 10, when the edge of the reference image, which corresponds to the center averaging pixel, extends in the vertical direction, that is, in the vertical direction, it is located in the horizontal direction, that is, the horizontal direction. . On the other hand, when the centered averaging pixel extends in the horizontal direction, that is, the left-right direction, it is positioned in the vertical direction, that is, the vertical direction.

【0076】前記n個とは、図7の例では、n=4に設
定されている。このため、中心となる平均化画素から前
後4個分、離れた計8個の平均化画素の階調がそれぞれ
求められる。前記階調は、8ビットデータで表され、計
256階調となる。つぎに、求めた計2n個の平均化画
素の階調データのうちから、最大値と最小値とを抽出
し、抽出した最大値と最小値との差R、すなわち階調差
を求める。
In the example of FIG. 7, n is set to n = 4. Therefore, the gradations of four averaging pixels, which are four pixels before and after the averaging pixel that is the center, and are distant from each other, are obtained. The gradation is represented by 8-bit data and has a total of 256 gradations. Next, the maximum value and the minimum value are extracted from the calculated gradation data of the total 2n averaged pixels, and the difference R between the extracted maximum value and the minimum value, that is, the gradation difference is calculated.

【0077】そして、求めた差Rと予め設定された基準
値Thとを比較して、明暗有り・無しを決定している。
上記基準値Thの値は、入力画像データの始点(Xi,
Yj)とされた平均化画素を中心に上記した手順で求め
られた差R0、すなわち階調差に等しい値に設定されて
いる。
Then, the difference R thus obtained is compared with a preset reference value Th to determine whether light or dark is present or absent.
The value of the reference value Th is the starting point (Xi,
Yj) is set to a value equal to the difference R0 obtained by the above-described procedure centered on the averaged pixel, that is, the gradation difference.

【0078】ただし、基準値Thには、その最低値Th
_minが予め設定されており、例えば本実施例の8ビット
階調では、その1割程度の20程度に設定されている。
このため、前記始点(Xi,Yj)を中心として求めら
れた差R0が、最低値Th_min未満の場合には、基準値
Thの値が最低値Th_minに等しい値となる。すなわ
ち、基準値Thは、次の関係式で表される。 Th=max(R0,Th_min) したがって、基準値Thの値は、始点(Xi,Yj)毎
に変化する可能性がある。
However, the reference value Th has a minimum value Th.
_min is set in advance, and is set to about 20 which is about 10% of the 8-bit gradation of this embodiment.
Therefore, when the difference R0 found around the starting point (Xi, Yj) is less than the minimum value Th_min, the value of the reference value Th becomes equal to the minimum value Th_min. That is, the reference value Th is represented by the following relational expression. Th = max (R0, Th_min) Therefore, the value of the reference value Th may change for each starting point (Xi, Yj).

【0079】そして、第1の判定方法では、前記求めた
差Rが、予め設定された基準値Th以上の場合には、明
暗差有りと判定している。これに対し、階調差Rが、予
め設定された基準値Th未満の場合には、明暗差無しと
判定している。つぎに、第2の判定方法について、図8
を用いて説明する。まず、第2の判定方法では、先に説
明した第2の判定方法と同様の手順で、図8に示すよう
に、計2n個の平均化画素の階調データa〜jをそれぞ
れ求めている。
In the first determination method, when the obtained difference R is equal to or larger than the preset reference value Th, it is determined that there is a difference in brightness. On the other hand, when the gradation difference R is less than the preset reference value Th, it is determined that there is no difference in brightness. Next, regarding the second determination method, FIG.
Will be explained. First, in the second determination method, the gradation data a to j of a total of 2n averaged pixels are obtained as shown in FIG. 8 in the same procedure as the second determination method described above. .

【0080】そして、求めた階調データa〜jを、下記
の式に従って平滑化微分を行っている。 A=|(c−e)+2(b−f)+3(a−g)| B=|(d−f)+2(c−g)+3(b−h)| C=|(e−g)+2(d−h)+3(c−i)| D=|(f−h)+2(e−i)+3(d−j)| 求めた平滑化微分データA〜Dのうちから、最大値と最
小値とを抽出し、抽出した最大値と最小値との差Rを求
める。
Then, the obtained gradation data a to j are subjected to smoothing differentiation according to the following formula. A = | (c−e) +2 (b−f) +3 (a−g) | B = | (d−f) +2 (c−g) +3 (b−h) | C = | ( e−g) +2 (d−h) +3 (c−i) | D = | (f−h) +2 (e−i) +3 (d−j) | Obtained smoothed differential data A to The maximum value and the minimum value are extracted from D, and the difference R between the extracted maximum value and the minimum value is obtained.

【0081】そして、求めた差Rと予め設定された基準
値Thとを比較して、第1の判定方法と同様に、明暗有
り・無しを決定している。上記基準値Thは、その差R
0が、始点(Xi,Yj)を中心として求められた平滑
化微分データの最大値と最小値との差である点を除き、
第1の判定方法と同様に求められる。
Then, the difference R thus obtained is compared with a preset reference value Th to determine whether or not there is light or dark like the first determination method. The reference value Th is the difference R
Except that 0 is the difference between the maximum value and the minimum value of the smoothed differential data obtained with the start point (Xi, Yj) as the center,
It is obtained in the same manner as the first determination method.

【0082】まず、第1ステップ201に進み、図11に
示すように、入力画像データ中の1つの平均化画素を始
点(Xi,Yj)として特定する。ここで、始点(X
i,Yj)とは、一度も始点とされていない、平均化画
素のメモリ上での座標を示す。これに加え、始点(X
i,Yj)は、入力画像データ中の平均化画素の全てに
ついて行われる。ただし、処理範囲が入力画像データの
範囲を越えてしまう場合には、始点(Xi,Yj)から
除かれる。例えば、図9に例示する入力画像でいえば、
p×q画素で構成される領域中の(p=1,q=1)の
座標で表せる平均化画素を起点とした場合には、参照画
像データの方向、例えば「4」の方向に移動した際に、
入力画像データの範囲を越えてしまうことが明かである
ので、予め始点からは除かれている。
First, proceeding to the first step 201, as shown in FIG. 11, one averaging pixel in the input image data is specified as the starting point (Xi, Yj). Here, the starting point (X
i, Yj) indicates the coordinates on the memory of the averaged pixel, which has never been the starting point. In addition to this, the start point (X
i, Yj) is performed for all the averaged pixels in the input image data. However, when the processing range exceeds the range of the input image data, it is removed from the starting point (Xi, Yj). For example, with the input image illustrated in FIG.
When the averaging pixel that can be represented by the coordinates (p = 1, q = 1) in the area composed of p × q pixels is used as the starting point, the reference image data is moved in the direction, for example, “4”. When
Since it is clear that the input image data will exceed the range, it is excluded from the starting point in advance.

【0083】上記第1ステップ201の終了後、図11に
示すように、第2ステップ202に進み、初期化が行われ
る。具体的には、参照画像データの番地Nを「1」とす
るとともに、相関値S(i,j)を「0」とする。ここ
で、参照画像データの番地Nには、方向が記憶されてい
る。すなわち、図1に示す特定パターンTを例に挙げる
と、その参照画像データの番地Nの1番目には、方向
「4」が記憶されている。また、相関値S(i,j)
は、明暗有りと判定された画素数の累積値である。
After the completion of the first step 201, as shown in FIG. 11, the process proceeds to the second step 202 and initialization is performed. Specifically, the address N of the reference image data is set to "1" and the correlation value S (i, j) is set to "0". Here, the direction is stored in the address N of the reference image data. That is, taking the specific pattern T shown in FIG. 1 as an example, the direction “4” is stored at the first address N of the reference image data. Also, the correlation value S (i, j)
Is a cumulative value of the number of pixels determined to have light and dark.

【0084】上記第2ステップ202の終了後、図11に
示すように、第3ステップ203に進む。 上記第3ステ
ップ203では、図11に示すように、始点(Xi,Y
j)とした入力画像データの平均化画素についての明暗
の有無の判定が行われる。すなわち、始点(Xi,Y
j)における差R0が、図11に示すように、基準値T
hの最低値Th_min以上のときは、明暗有りと判定さ
れ、第3ステップ203から第4ステップ204に進み、現在
の相関値S(i,j)に「1」が加算される。
After the completion of the second step 202, the process proceeds to the third step 203 as shown in FIG. In the third step 203, as shown in FIG. 11, the starting point (Xi, Y
The presence / absence of light and dark is determined for the averaged pixels of the input image data described in j). That is, the starting point (Xi, Y
The difference R0 in j) is the reference value T, as shown in FIG.
When the minimum value Th_min is greater than or equal to Th_min, it is determined that there is light and darkness, the process proceeds from the third step 203 to the fourth step 204, and "1" is added to the current correlation value S (i, j).

【0085】これに対し、差R0が基準値Thの最低値
Th_min未満の場合には、当該始点(Xi,Yj)に基
づく以後の明暗の有無の判定処理を断念するが、以後の
処理については後述する。すなわち、差R0が基準値T
hの最低値Th_min未満の場合には、当該始点(Xi,
Yj)の位置の平均化画素には、参考画像データの特定
パターンTの起点画像T(0)と比較すべき、パターンエ
ッジが存在しないことが明らかであるためである。
On the other hand, when the difference R0 is less than the minimum value Th_min of the reference value Th, the subsequent determination process of presence / absence of light and dark based on the starting point (Xi, Yj) is abandoned. It will be described later. That is, the difference R0 is the reference value T
When it is less than the minimum value Th_min of h, the start point (Xi,
This is because it is clear that the averaging pixel at the position Yj) does not have a pattern edge to be compared with the starting image T (0) of the specific pattern T of the reference image data.

【0086】上記第4ステップ204の終了後、図11に
示すように、次の第5ステップ205に進み、基準値Th
が決定される。すなわち、始点(Xi,Yj)における
差R0と最低値Th_minとの最大値を、基準値Thと決
定する。もちろん、始点(Xi,Yj)における差R0
は、先の第3ステップ103で最低値Th_min以上である
ことが明らかなので、始点(Xi,Yj)における差R
0の値をそのまま基準値Thと考えてもよい。
After the end of the fourth step 204, as shown in FIG. 11, the process proceeds to the next fifth step 205 and the reference value Th
Is determined. That is, the maximum value of the difference R0 and the minimum value Th_min at the starting point (Xi, Yj) is determined as the reference value Th. Of course, the difference R0 at the starting point (Xi, Yj)
Is clearly greater than or equal to the minimum value Th_min in the third step 103, the difference R at the starting point (Xi, Yj) is
The value of 0 may be directly considered as the reference value Th.

【0087】上記第5ステップ205の終了後、図11に
示すように、次の第6ステップ206に進む。上記第6ス
テップ206では、明暗の判定の中心となる平均化画素
を、参照画像データのN番目に記憶されて方向に従っ
て、平均化画素1個分だけ移動する。例えば、図1に示
す特定パターンTを例に挙げると、その参照画像データ
の1番目には、方向「4」が記憶されている。このた
め、始点(Xi,Yj)に位置する平均化画素を、図9
において上方に1個分だけ移動する。
After the end of the fifth step 205, the process proceeds to the next sixth step 206 as shown in FIG. In the sixth step 206, the averaging pixel that is the center of the lightness / darkness determination is moved by one averaging pixel according to the direction stored in the Nth reference image data. For example, taking the specific pattern T shown in FIG. 1 as an example, the direction “4” is stored in the first of the reference image data. Therefore, the averaging pixel located at the start point (Xi, Yj) is
Move upward by one space at.

【0088】上記第6ステップ206の終了後、図11に
示すように、次の第7ステップ207に進み、参照画像デ
ータの現在の番地Nに「1」が加算される。上記第7ス
テップ207の終了後、図11に示すように、次の第8ス
テップ208に進む。上記第8ステップ208では、図11に
示すように、参照画像データの現在の番地Nが参照画像
データ数の総数Lに一致したか否かが判定される。すな
わち、参照画像データの番地Nが参照画像データ数の総
数Lを越えた場合には、一周分の明暗の有無の判定処理
が終了したことを意味し、当該始点(Xi,Yj)に基
づく明暗の有無の判定が終了しているが、以後の処理に
ついては後述する。
After completion of the sixth step 206, as shown in FIG. 11, the process proceeds to the next seventh step 207, and "1" is added to the current address N of the reference image data. After the completion of the seventh step 207, as shown in FIG. 11, the process proceeds to the next eighth step 208. In the eighth step 208, as shown in FIG. 11, it is determined whether the current address N of the reference image data matches the total number L of the reference image data numbers. That is, when the address N of the reference image data exceeds the total number L of the reference image data numbers, it means that the process for determining the presence / absence of light and darkness for one round is completed, and the lightness / darkness based on the starting point (Xi, Yj). Although the determination of the presence or absence of is completed, the subsequent processing will be described later.

【0089】これに対し、参照画像データの番地Nが参
照画像データ数の総数Lを越えていない場合には、一周
分の明暗の有無の判定処理が終了していないので、次の
第9ステップ209に進む。第9ステップ209では、図11
に示すように、先の第6ステップ206で移動した平均化
画素の明暗の有無の判定が行われる。
On the other hand, if the address N of the reference image data does not exceed the total number L of the reference image data numbers, the process of determining the presence / absence of light and darkness for one round has not been completed, and the next ninth step is performed. Continue to 209. In the ninth step 209, in FIG.
As shown in, the presence / absence of light / dark of the averaged pixel moved in the sixth step 206 is determined.

【0090】すなわち、明暗有りの場合には、図11に
示すように、次の第10ステップ210に進み、現在の相
関値S(i,j)に「1」が加算された後、第11ステ
ップ211に進む。これに対し、明暗無し場合には、図1
1に示すように、次の第9ステップ209から直接、第1
1ステップ211に進む。
That is, if there is light and dark, as shown in FIG. 11, the process proceeds to the next tenth step 210, and after adding "1" to the current correlation value S (i, j), the eleventh Proceed to step 211. On the other hand, when there is no light and shade,
1 directly from the next 9th step 209
1 Go to step 211.

【0091】上記第11ステップ211では、図11に示
すように、現在の相関値S(i,j)と、予め設定され
た最低値S_minとが比較され、明暗の有無の判定処理を
継続するか否かが判定される。上記S_minは、参考画像
の特定パータンの大きさに関係なく、入力画像のパター
ンマッチング度が判定できるように、明暗有りと判定さ
れる平均化画素の割合で設定され、例えば0.7〜0.
8以上の値が設定されている。
In the eleventh step 211, as shown in FIG. 11, the current correlation value S (i, j) is compared with a preset minimum value S_min, and the process of determining whether there is light or dark is continued. It is determined whether or not. The S_min is set by the ratio of averaged pixels determined to have light and dark so that the pattern matching degree of the input image can be determined regardless of the size of the specific pattern of the reference image, and is 0.7 to 0.
A value of 8 or more is set.

【0092】そして、現在の相関値S(i,j)と最低
値S_minとは、次の式により判定されている。 N−S(i,j)<L(1−Smin) すなわち、上記式の左辺により、現在の明暗無しと判定
された平均化画素数が求められる。例えばN=2で、現
在の相関値S(i,j)が「1」であれば、左辺の値
は、「1」となり、現在の明暗無しと判定された平均化
画素数は、1個なる。したがって、左辺の値は、平均化
画素が移動する度に変化する可能性がある。
The current correlation value S (i, j) and the minimum value S_min are determined by the following equation. N−S (i, j) <L (1−Smin) That is, the average number of pixels determined to have no current brightness is obtained from the left side of the above expression. For example, when N = 2 and the current correlation value S (i, j) is "1", the value on the left side is "1", and the current number of averaged pixels determined to have no brightness is one. Become. Therefore, the value on the left side may change each time the averaging pixel moves.

【0093】また、前記式の右辺により、最低値S_min
に基づいた最終的な明暗無しと判定される平均化画素数
が求められる。例えば、S_min=0.8と設定し、図1
に例示する参考画像データの特定パターンTを例に挙げ
ると、L=20であるので、右辺の値は、「4」とな
り、明暗無しと判定される平均化画素数が4個となる。
そして、前記式を満足する場合には、相関が低いと判断
し、当該始点(Xi,Yj)に基づく以後の明暗の有無
の判定処理を中止するが、以後の処理については後述す
る。
Further, according to the right side of the above equation, the minimum value S_min
Based on, the final average number of pixels determined to have no light and dark is obtained. For example, S_min = 0.8 is set, and FIG.
Taking the specific pattern T of the reference image data illustrated in the example as an example, since L = 20, the value on the right side is “4”, and the number of averaged pixels determined to have no light and shade is four.
Then, when the above expression is satisfied, it is determined that the correlation is low, and the subsequent determination processing of the presence or absence of light and dark based on the starting point (Xi, Yj) is stopped.

【0094】上記式を満足しない場合には、相関が低く
ないと判断し、第11ステップ211から第6ステップ206
に進み、当該始点(Xi,Yj)に基づく以後の明暗の
有無の判定処理を継続する。つぎに、第3ステップ203
で、始点(Xi,Yj)における明暗が無い場合、第8
ステップ208で、一周分の明暗の有無の判定処理が終了
している場合、先の第11ステップ211で、相関が低い
と判断された場合には、各々次の第12ステップ212に
進む。
If the above equation is not satisfied, it is determined that the correlation is not low, and the eleventh step 211 to the sixth step 206
Then, the process for determining the presence / absence of light and darkness based on the starting point (Xi, Yj) is continued. Next, the third step 203
If there is no light and shade at the starting point (Xi, Yj),
If it is determined in step 208 that the presence / absence of light and darkness for one round has been completed, and if it is determined in the previous eleventh step 211 that the correlation is low, the process proceeds to the next twelfth step 212.

【0095】上記第12ステップ212では、第11に示
すように、現在の始点数Mから「1」が減算される。上
記始点数Mは、入力画像データ中の始点(Xi,Yj)
とできる平均化画素の総数であり、予め設定されてい
る。すなわち、始点(Xi,Yj)は先に説明したよう
に、入力画像データ中の平均化画素の全てについて行わ
れる。このため、図9に例示する入力画像でいえば、p
×q画素で構成されているため、始点数Mは、p×q個
になる。しかし、処理範囲が入力画像データの範囲を越
えて場合には、予め始点(Xi,Yj)から除かれるた
め、これらの除かれた始点数を引いた数が、始点数Mと
なる。
In the twelfth step 212, as shown in the eleventh step, "1" is subtracted from the current starting point number M. The starting point number M is the starting point (Xi, Yj) in the input image data.
Is the total number of averaging pixels that can be set and is set in advance. That is, the starting point (Xi, Yj) is performed for all the averaged pixels in the input image data, as described above. Therefore, in the case of the input image illustrated in FIG. 9, p
Since it is composed of × q pixels, the number of starting points M is p × q. However, when the processing range exceeds the range of the input image data, it is removed from the starting point (Xi, Yj) in advance, and thus the number obtained by subtracting these removed starting points becomes the starting point number M.

【0096】上記第12ステップ212の終了後、図11
に示すように、第13ステップに進み、入力画像データ
中の始点(Xi,Yj)とすべき全ての平均化画素につ
いて明暗の判定処理が終了した否かが判定される。すな
わち、図11に示すように、現在の始点数Mが「0」に
なった場合には、入力画像データ中の始点(Xi,Y
j)とすべき全ての平均化画素について明暗の判定処理
が終了したものと判断し、第2の工程200を終了し、第
3の工程300に移行する。
After the above twelfth step 212 is completed, FIG.
As shown in, the process proceeds to the thirteenth step, and it is determined whether or not the lightness / darkness determination process has ended for all the averaged pixels that should be the starting point (Xi, Yj) in the input image data. That is, as shown in FIG. 11, when the current start point number M becomes "0", the start point (Xi, Y in the input image data is
It is determined that the brightness determination process has been completed for all the averaged pixels to be j), the second step 200 is ended, and the process proceeds to the third step 300.

【0097】これに対し、現在の始点数Mが「0」にな
っていない場合には、図11に示すように、第13ステ
ップ213から次の第14ステップ214に進む。上記第14
ステップ214では、一度も始点(Xi,Yj)とされて
いない、残る平均化画素に始点を移動し、その後、第1
ステップ201に戻り、当該新たな始点(Xi,Yj)に
ついて上記した手順に従って明暗の有無の判定処理を行
う。
On the other hand, when the current number M of starting points is not "0", the process proceeds from the 13th step 213 to the 14th step 214 as shown in FIG. 14th above
In step 214, the starting point is moved to the remaining averaging pixel which has never been set as the starting point (Xi, Yj), and then the first
Returning to step 201, the process for determining the presence / absence of light and dark is performed for the new starting point (Xi, Yj) according to the procedure described above.

【0098】つぎに、第3の工程300について、続いて
図11を用いて説明する。すなわち、第2の工程200の
第13ステップ213から第3の工程300の第1ステップ30
1に進む。上記第1ステップ301では、第2の工程200で
得た各始点(Xi,Yj)毎の相関値S(i,j)を比
較し、その最大値を求める。その結果、最大値を得た当
該始点(Xi,Yj)を、参照画像データの特定パター
ンTの起点画像T(0)に一致したものと判定する。
Next, the third step 300 will be described subsequently with reference to FIG. That is, the thirteenth step 213 of the second process 200 to the first step 30 of the third process 300.
Go to 1. In the first step 301, the correlation value S (i, j) for each starting point (Xi, Yj) obtained in the second step 200 is compared to obtain the maximum value. As a result, it is determined that the starting point (Xi, Yj) having the maximum value matches the starting point image T (0) of the specific pattern T of the reference image data.

【0099】[0099]

【発明の効果】本発明は、以上のように構成されている
ので、以下に記載されるような効果を奏する。請求項1
記載の発明によれば、従来の必要としていた複雑な相互
相関演算処理が不要となるので、演算処理を簡素化で
き、迅速なパターン認識を行うことができる。
Since the present invention is constituted as described above, it has the following effects. Claim 1
According to the invention described above, since the complicated cross-correlation calculation process which is conventionally required is not necessary, the calculation process can be simplified and the rapid pattern recognition can be performed.

【0100】これに加え、請求項1記載の発明によれ
ば、従来必要とされていた濃淡としての情報を用いる必
要がないので、線画による輪郭のみからなる画像につい
ても確実にパターン認識が行え、しかも画像の輪郭線が
物体の凹凸に基づくものであっても確実にパターン認識
を行うことができる。請求項2記載の発明によれば、演
算処理の途中で相関が低いと判断された場合は、演算処
理を中止し、別の平均化画素を起点とする演算処理に移
ることにより、無駄な演算処理時間を省き、迅速なパタ
ーン認識を行うことができる。
In addition to this, according to the invention described in claim 1, since it is not necessary to use the information as the light and shade which has been conventionally required, it is possible to surely perform the pattern recognition even for the image consisting only of the outline by the line drawing, Moreover, even if the contour line of the image is based on the unevenness of the object, it is possible to surely perform the pattern recognition. According to the second aspect of the present invention, when it is determined that the correlation is low during the arithmetic processing, the arithmetic processing is stopped and the arithmetic processing using another averaging pixel as a starting point is performed, so that useless arithmetic is performed. Processing time can be saved and rapid pattern recognition can be performed.

【0101】請求項3記載の発明によれば、入力画像の
明るさやコントラストによる影響を除去できるので、入
力画像のパターンエッジの判定を確実に行うことができ
る。請求項4記載の発明によれば、請求項3記載の発明
と同様に、入力画像の明るさやコントラストによる影響
を確実に除去することができるばかりでなく、エッジが
ぼやけている場合にも、当該エッジの有無を確実に判定
できる。
According to the third aspect of the present invention, the influence of the brightness and contrast of the input image can be removed, so that the pattern edge of the input image can be surely determined. According to the invention described in claim 4, similarly to the invention described in claim 3, not only can the influence of the brightness and the contrast of the input image be reliably removed, but also when the edge is blurred, The presence or absence of edges can be reliably determined.

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

【図1】参照画像の一例を示す説明図である。FIG. 1 is an explanatory diagram showing an example of a reference image.

【図2】画像処理装置を示すブロック図である。FIG. 2 is a block diagram showing an image processing apparatus.

【図3】画像処理方法を示すフローチャートである。FIG. 3 is a flowchart showing an image processing method.

【図4】図3の第1の工程を示すフローチャートであ
る。
FIG. 4 is a flowchart showing a first step of FIG.

【図5】図1の参照画像のエッジの方向を示す説明図で
ある。
FIG. 5 is an explanatory diagram showing the directions of edges of the reference image in FIG. 1.

【図6】図1の参照画像の一部を拡大した説明図であ
る。
FIG. 6 is an explanatory diagram in which a part of the reference image of FIG. 1 is enlarged.

【図7】入力画像の明暗の判定方向を示す説明図であ
る。
FIG. 7 is an explanatory diagram showing a lightness / darkness determination direction of an input image.

【図8】入力画像の明暗の他の判定方法を示す説明図で
ある。
FIG. 8 is an explanatory diagram showing another method for determining the brightness of an input image.

【図9】入力画像の一例を示す説明図である。FIG. 9 is an explanatory diagram showing an example of an input image.

【図10】入力画像の明暗の判定方向を示す説明図であ
る。
FIG. 10 is an explanatory diagram showing a lightness / darkness determination direction of an input image.

【図11】図3の第2の工程及び第3の工程を示すフロ
ーチャートである。
11 is a flow chart showing a second step and a third step of FIG.

【図12】同図の(a)〜(d)は、従来の画像処理方
法の問題点を説明するための各種画像を示す説明図であ
る。
12A to 12D are explanatory views showing various images for explaining problems of the conventional image processing method.

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

10 画像処理装置 11 中央制御部 12 画像メモリ部 13 画像演算処理
部 14 システムバス 15 データバス 20 撮像素子 21 A/Dコンバ
ータ 30 表示装置 31 D/Aコンバ
ータ 30 表示装置 41 A/Dコンバ
ータ 100〜114 第1の工程 200〜214 第2の工程 300〜301 第3の工程 400 出力工程 T 入力画像 T(0) 起点
10 Image processing device 11 Central control unit 12 Image memory unit 13 Image operation processing unit 14 System bus 15 Data bus 20 Image sensor 21 A / D converter 30 Display device 31 D / A converter 30 Display device 41 A / D converter 100 to 114 1st process 200-214 2nd process 300-301 3rd process 400 Output process T Input image T (0) Starting point

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 入力画像に含まれる複数のパターンの中
から、複数方向にエッジが形成された特定パターンを検
出する画像処理方法において、 参照画像中の前記特定パターンのエッジを構成する複数
の画素のうちの1つを起点とし、前記複数の画素それぞ
れが位置するエッジの方向を、前記起点より順番に登録
する第1の工程と、 前記入力画像中の各画素を始点とし、該始点となる画素
から順番に前記第1の工程で登録した方向に隣接する画
素がパターンエッジを構成するか否かを判定すると共
に、パターンエッジを構成すると判定された画素の個数
をカウントする第2の工程と、 該第2の工程でカウントされた画素の個数が最大となる
始点の位置に基づいて、前記入力画素に含まれる複数の
パターンの中から、前記特定パターンを検出する第3の
工程と、 を含むことを特徴とする画像処理方法。
1. An image processing method for detecting a specific pattern having edges formed in a plurality of directions from a plurality of patterns included in an input image, wherein a plurality of pixels forming an edge of the specific pattern in a reference image. A first step in which the direction of the edge where each of the plurality of pixels is located is registered in order from the starting point, and each pixel in the input image is set as the starting point A second step of determining whether or not pixels adjacent to each other in the direction registered in the first step in order from a pixel constitute a pattern edge, and counting the number of pixels determined to constitute a pattern edge; The specific pattern is detected from a plurality of patterns included in the input pixel based on the position of the starting point where the number of pixels counted in the second step is the maximum. An image processing method comprising: a third step.
【請求項2】 請求項1記載の画像処理方法において、 前記第2の工程において、入力画像中のパターンエッジ
を構成すると判定された画素のカウント数が、所定の基
準値に満たない場合には、当該始点に対するパターンエ
ッジの判定を途中で中断し、前記当該始点の位置を変更
するようにしたことを特徴とする画像処理方法。
2. The image processing method according to claim 1, wherein in the second step, when the count number of pixels determined to constitute a pattern edge in the input image is less than a predetermined reference value. The image processing method is characterized in that the determination of the pattern edge for the starting point is interrupted midway and the position of the starting point is changed.
【請求項3】 請求項1又は請求項2のいずれかに記載
の画像処理方法において、 前記第2の工程において、前記隣接する複数の画素の階
調値をそれぞれ求め、求めた各階調値の最大値と最小値
との差が、予め設定された基準値を越えた場合に、パタ
ーンエッジを構成するものと判定するようにしたことを
特徴とする画像処理方法。
3. The image processing method according to claim 1, wherein in the second step, tone values of the plurality of adjacent pixels are respectively obtained, and the tone values of the obtained tone values are calculated. An image processing method, wherein when the difference between the maximum value and the minimum value exceeds a preset reference value, it is determined that the pattern edge is formed.
【請求項4】 請求項1又は請求項2のいずれかに記載
の画像処理方法において、 前記第2の工程において、前記隣接する複数の画素の階
調値をそれぞれ求め、求めた各階調値に基づいて平滑化
微分をそれぞれ行い、これらの平滑化微分を行って得た
結果の最大値と最小値との差が、予め設定された基準値
を越えた場合に、パターンエッジを構成するものと判定
するようにしたことを特徴とする画像処理方法。
4. The image processing method according to claim 1, wherein in the second step, tone values of the plurality of adjacent pixels are respectively obtained, and the obtained tone values are set to the obtained tone values. Based on the smoothing differentiation, the difference between the maximum value and the minimum value of the results obtained by performing these smoothing differentiations constitutes a pattern edge when the difference exceeds a preset reference value. An image processing method characterized in that determination is made.
JP6038952A 1994-03-10 1994-03-10 Picture processing method Withdrawn JPH07249120A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6038952A JPH07249120A (en) 1994-03-10 1994-03-10 Picture processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6038952A JPH07249120A (en) 1994-03-10 1994-03-10 Picture processing method

Publications (1)

Publication Number Publication Date
JPH07249120A true JPH07249120A (en) 1995-09-26

Family

ID=12539542

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6038952A Withdrawn JPH07249120A (en) 1994-03-10 1994-03-10 Picture processing method

Country Status (1)

Country Link
JP (1) JPH07249120A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7130086B2 (en) 2000-01-31 2006-10-31 Canon Kabushiki Kaisha Image processing apparatus and method with forgery and/or fraud control
CN109919847A (en) * 2017-12-13 2019-06-21 彩优微电子(昆山)有限公司 Improve the method for enlarged drawing quality

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7130086B2 (en) 2000-01-31 2006-10-31 Canon Kabushiki Kaisha Image processing apparatus and method with forgery and/or fraud control
CN109919847A (en) * 2017-12-13 2019-06-21 彩优微电子(昆山)有限公司 Improve the method for enlarged drawing quality

Similar Documents

Publication Publication Date Title
US8285039B2 (en) Image processor
JPH0689344A (en) Pattern recognizing device
JP3993029B2 (en) Makeup simulation apparatus, makeup simulation method, makeup simulation program, and recording medium recording the program
CN112052782A (en) Around-looking-based parking space identification method, device, equipment and storage medium
JP4203279B2 (en) Attention determination device
JP3814353B2 (en) Image segmentation method and image segmentation apparatus
JP3860540B2 (en) Entropy filter and region extraction method using the filter
JPH07249120A (en) Picture processing method
CN115660952A (en) Image processing method, dictionary pen and storage medium
JP2000003436A (en) Device and method for recognizing isar picture
JP2001314374A (en) Corneal endothelial cell measuring apparatus
JP2004240909A (en) Image processor and image processing method
EP3832540A1 (en) Product positioning method
EP3582179B1 (en) Image processing apparatus, image processing method, and image processing program
JPH07146937A (en) Pattern matching method
CN112364693A (en) Barrier identification method, device and equipment based on binocular vision and storage medium
JPH0688789A (en) Method for extracting density fluctuation constitution picture element in image and method for judging concentration fluctuation mass
JPH0310107A (en) Inspecting method utilizing gradation pattern matching
JP2000207557A (en) Method for measuring quantity of positional deviation
CN112712499B (en) Object detection method and device and computer readable storage medium
JPH0735699A (en) Method and apparatus for detecting surface defect
JP3041056B2 (en) Semiconductor pellet detection method
JP2008083988A (en) Input form creation apparatus and program
JP2001283218A (en) Congestion state deciding method and device therefor
JPH07271989A (en) Boundary detecting method of background and object area, contour extracting method of object and object contour extracting device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010605