JPH0850655A - Edge trace method - Google Patents

Edge trace method

Info

Publication number
JPH0850655A
JPH0850655A JP7082434A JP8243495A JPH0850655A JP H0850655 A JPH0850655 A JP H0850655A JP 7082434 A JP7082434 A JP 7082434A JP 8243495 A JP8243495 A JP 8243495A JP H0850655 A JPH0850655 A JP H0850655A
Authority
JP
Japan
Prior art keywords
edge
edge pixel
pixel
search
found
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
JP7082434A
Other languages
Japanese (ja)
Inventor
Nobuyuki Fujiwara
伸行 藤原
Makoto Niwakawa
誠 庭川
Toshikazu Onda
寿和 恩田
Koji Igura
浩司 井倉
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.)
Meidensha Corp
Meidensha Electric Manufacturing Co Ltd
Original Assignee
Meidensha Corp
Meidensha Electric 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 Meidensha Corp, Meidensha Electric Manufacturing Co Ltd filed Critical Meidensha Corp
Priority to JP7082434A priority Critical patent/JPH0850655A/en
Publication of JPH0850655A publication Critical patent/JPH0850655A/en
Pending legal-status Critical Current

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

PURPOSE:To obtain a comparatively long edge chain even if edge image data is finely divided. CONSTITUTION:When a processing searching the next edge picture element existing in the range of 1 pix around an edge picture element by defining the edge picture element as a search center from edge image data is repeated by successively shifting the search center, the search of the next edge picture element is performed S 4 by shifting the search center to a discovered edge picture element S 6 when this edge picture element can be discovered. When the edge picture element can not be discovered, an edge trace is not terminated and the location of the next edge picture element is estimated from the positional data of the already determined edge picture element S 9. The processing is continued by shifting the search center to the picture element at this estimated location S 6.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はいわゆる画像処理におけ
るエッジトレース方法に関し、特に、任意の空間的な画
像データ群の中から、特定の条件を満たす画素であるエ
ッジ画素の連なりであるエッジチェーンを得る際のトレ
ース性能を向上させるための改良に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an edge tracing method in so-called image processing, and more particularly to an edge chain which is a series of edge pixels which are pixels satisfying a specific condition from an arbitrary spatial image data group. It relates to an improvement for improving the trace performance when obtaining.

【0002】[0002]

【従来の技術】画像処理において画面上に映し出された
物体のエッジデータを抽出するために、従来、次のよう
な手順〜をとるのが一般的であり、フローチャート
で示すと図19のようになる。但し、〜がエッジト
レースに相当する。
2. Description of the Related Art Conventionally, in order to extract edge data of an object displayed on a screen in image processing, conventionally, the following steps (1) to (3) have been generally performed. Become. However, ~ corresponds to the edge trace.

【0003】 入力画像データからエッジ画像デー
タ、即ちエッジ幅が1pix の画像データを作成する。な
お、pix は1画素分の幅を表わす。エッジ画像データの
作成としては、基本的には入力画像データに微分空間フ
ィルタ等を用いて鮮鋭化処理を施すことにより物体等の
エッジ部分を強調させて作成する。また、鮮鋭化処理で
エッジ幅が1pix にならない場合は、更に細線化処理を
施すことによりエッジ幅を1pix にする。図19のステ
ップS60,S61参照。
Edge image data, that is, image data having an edge width of 1 pix is created from input image data. Note that pix represents the width of one pixel. To create the edge image data, basically, the input image data is created by performing a sharpening process using a differential spatial filter or the like to emphasize the edge portion of the object or the like. If the edge width does not reach 1 pix by the sharpening processing, the edge width is set to 1 pix by further thinning processing. See steps S60 and S61 in FIG.

【0004】 適当なしきい値を基に、エッジ画像デ
ータからエッジトレースの開始点となるエッジ画素を検
出する。図19のステップS62参照。
Based on an appropriate threshold value, the edge pixel that is the starting point of the edge trace is detected from the edge image data. See step S62 in FIG.

【0005】 検出したエッジ画素(始点)を探索中
心として、周囲1pix の範囲を右回り、もしくは左回り
に探索し、この探索範囲に次のエッジ画素が存在するか
否かを適当なしきい値を基にエッジ画像データから調べ
る。図19のステップS63参照。
With the detected edge pixel (starting point) as the search center, the range of 1 pix around is searched clockwise or counterclockwise, and an appropriate threshold value is set to determine whether or not the next edge pixel exists in this search range. Based on the edge image data, it is checked. See step S63 in FIG.

【0006】 次のエッジ画素を発見した場合は、発
見したエッジ画素に探索中心をシフトして、その周囲1
pix の範囲を右回り、または左回りに探索し、この探索
範囲に更に次のエッジ画素が存在するか否かを適当なし
きい値を基にエッジ画像データから調べる。この手順
を、エッジ画素が発見される限り繰り返す。図19のス
テップS64,S65,S63参照。
When the next edge pixel is found, the search center is shifted to the found edge pixel and the surrounding 1
The range of pix is searched clockwise or counterclockwise, and whether or not the next edge pixel is present in this search range is checked from the edge image data based on an appropriate threshold value. This procedure is repeated as long as edge pixels are found. See steps S64, S65 and S63 in FIG.

【0007】 エッジ画素が発見されない場合は、探
索を終了し、エッジの始点を含めて今までに発見したエ
ッジ画素のデータをエッジチェーン(エッジ線分データ
とも称される)とする。図19のステップS64,S6
6参照。
If no edge pixel is found, the search is terminated, and the data of the edge pixel found so far including the start point of the edge is used as an edge chain (also referred to as edge line segment data). Steps S64 and S6 of FIG.
See 6.

【0008】[0008]

【発明が解決しようとする課題】上述した如く従来のエ
ッジトレース方法では、探索中心の周囲1 pix の範囲
に次のエッジ画素を発見することができなければ、その
時点でエッジ画素の探索を終了する。そのため、たとえ
物体が比較的長いエッジを持っていたとしても、細線化
処理の際にエッジ画像データが細かく分割された場合、
あるいは画像を入力する際に生じるノイズ等のために鮮
鋭化処理された画像データが細かく分割された結果、エ
ッジ画像データも細かく分割された場合には、1回のエ
ッジトレースでは比較的短いエッジチェーンしか得られ
ない。この問題は解像度が高くなるほど顕著に現われる
傾向にある。
As described above, in the conventional edge tracing method, if the next edge pixel cannot be found within the range of 1 pix around the search center, the search for the edge pixel is terminated at that point. To do. Therefore, even if the object has relatively long edges, if the edge image data is finely divided during the thinning process,
Alternatively, if the edge image data is also finely divided as a result of finely dividing the image data that has been sharpened due to noise or the like that occurs when inputting an image, one edge trace will result in a relatively short edge chain. I can only get it. This problem tends to be more noticeable as the resolution becomes higher.

【0009】また上述した従来のエッジトレース方法で
は、図20に示すように検出すべき本来のエッジチェー
ン100の途中のエッジ画素101を始点して探索を開
始すると、図21に示すように始点101で本来のエッ
ジチェーン100が分断されてしまい、それよりも短い
エッジチェーン102しか得られないことになる。
In the conventional edge tracing method described above, when the search is started by starting the edge pixel 101 in the middle of the original edge chain 100 to be detected as shown in FIG. 20, the starting point 101 is shown as shown in FIG. Therefore, the original edge chain 100 is divided and only the edge chain 102 shorter than that is obtained.

【0010】即ち、図20に示すように左下りの斜線を
付した画素103からなるエッジ画像データ104が与
えられた場合に、途中のエッジ画素101が始点になる
と、その近傍の画素105,106のうち1つだけ、例
えば右隣りのもの106が次のエッジ画素として発見さ
れる。その結果、図21に示すように、次のエッジ画素
106から終点のエッジ画素107までのエッジチェー
ン102を検出した時点で、エッジトレースが終了す
る。
That is, when edge image data 104 consisting of a pixel 103 with a diagonal line descending to the left as shown in FIG. 20 is given, when an intermediate edge pixel 101 becomes the starting point, pixels 105 and 106 in the vicinity thereof are provided. Only one of them, for example the right neighbor 106, is found as the next edge pixel. As a result, as shown in FIG. 21, the edge trace ends when the edge chain 102 from the next edge pixel 106 to the end edge pixel 107 is detected.

【0011】分断された残りのエッジチェーン108に
ついては、別途エッジトレースを行う必要がある。
For the remaining edge chains 108 that have been divided, it is necessary to separately perform edge tracing.

【0012】このようにして検出した2つのエッジチェ
ーン102,108はともに本来のエッジチェーン10
0よりも短いので、両エッジチェーン102,108の
端点どうし101,105を繋ぎ合わせる操作を行え
ば、本来の長さのエッジチェーン100を得ることが可
能ではある。
The two edge chains 102 and 108 thus detected are both the original edge chain 10
Since the length is shorter than 0, it is possible to obtain the edge chain 100 of the original length by performing an operation of connecting the end points 101 and 105 of the both edge chains 102 and 108.

【0013】しかし、多くのエッジチェーンが存在する
場合は、それらの中から端点どうしが近傍にあるか否か
を照合する操作は煩雑であり、且つ、計算量も多いとい
う問題がある。
However, when there are many edge chains, there is a problem that the operation of checking whether or not the end points are close to each other is complicated and requires a large amount of calculation.

【0014】そこで本発明は、画像を入力する際に生じ
るノイズによる影響を受け難く、あるいは細線化処理で
生じるエッジ画像データの細分割による影響を受け難
く、比較的長いエッジチェーンを容易に得ることができ
るエッジトレース方法を提供すること、またエッジチェ
ーンの端点どうしの繋ぎ合せ操作を行うことなく、長い
エッジチェーンを得ることができるエッジトレース方法
を提供することを目的とする。
Therefore, according to the present invention, a relatively long edge chain can be easily obtained, which is hardly affected by noise generated when an image is input, or is hardly affected by subdivision of edge image data generated by thinning processing. It is an object of the present invention to provide an edge tracing method capable of achieving a long edge chain without performing a connecting operation between the end points of the edge chain.

【0015】[0015]

【課題を解決するための手段】上記目的を達成する第1
の発明のエッジトレース方法は、特定の条件を満たす画
素をエッジ画素とし、エッジ画素を探索中心としてその
周囲1pix の範囲に存在する次のエッジ画素を画像デー
タから探索する処理を、順次探索中心をシフトして繰り
返すことにより、エッジチェーンを得るエッジトレース
方法において:前記エッジ画素の探索の際に次のエッジ
画素を発見できた場合は、この発見したエッジ画素に探
索中心をシフトすること;前記エッジ画素の探索の際に
次のエッジ画素を発見できない場合は、既に求めたエッ
ジ画素の位置データから次のエッジ画素の位置を推定
し、この推定した位置の画素に探索中心をシフトするこ
と;を特徴とする方法である。この場合、第2の発明で
は、直線近似により前記次のエッジ画素位置の推定を行
うことを特徴とする。また、第3の発明では、現在のエ
ッジ画素の位置を(Xi ,Yi )とし、j個前のエッジ
画素の位置を(Xi-j,Yi-j )とし、前記次のエッジ
画素の位置を(Xi+1 ,Yi+1 )とすると、過去n個の
エッジ画素の位置データから、次式(3)により推定を
行うことを特徴とする。
[Means for Solving the Problems] First to achieve the above object
In the edge tracing method of the invention described above, a pixel satisfying a specific condition is set as an edge pixel, the edge pixel is set as a search center, and the next edge pixel existing in the range of 1 pix around the edge pixel is searched for from the image data. In an edge tracing method for obtaining an edge chain by shifting and repeating: shifting the search center to this found edge pixel if the next edge pixel can be found in the search for said edge pixel; said edge If the next edge pixel cannot be found during the pixel search, the position of the next edge pixel is estimated from the already obtained edge pixel position data, and the search center is shifted to the pixel at this estimated position. This is a characteristic method. In this case, the second invention is characterized in that the next edge pixel position is estimated by linear approximation. In the third invention, the position of the current edge pixel is set to (X i , Y i ), the position of the jth previous edge pixel is set to (X ij , Y ij ), and the position of the next edge pixel is set to (X i + 1 , Y i + 1 ) is characterized in that the position data of the past n edge pixels is estimated by the following equation (3).

【数3】 (Equation 3)

【0016】更に、第4の発明では、前記次のエッジ画
素位置の推定が所定回数継続しても画像データからエッ
ジ画素を発見できない場合にエッジ画素の探索を終了す
ることを特徴とし、第5の発明ではエッジ画素の探索を
終了した場合は、エッジチェーンの最終位置を最後に発
見したエッジ画素まで戻すことを特徴とする。
Further, the fourth invention is characterized in that the search for the edge pixel is terminated when the edge pixel cannot be found from the image data even after the estimation of the next edge pixel position is repeated a predetermined number of times. In the invention of (1), when the search for the edge pixel is completed, the final position of the edge chain is returned to the edge pixel that was found last.

【0017】一方、上記目的を達成する第6の発明のエ
ッジトレース方法は、特定の条件を満たす画素をエッジ
画素とし、エッジ画素を探索中心としてその周囲の探索
範囲で画像データから次のエッジ画素を探索する処理
を、発見したエッジ画素に順次探索中心をシフトして繰
り返すことにより、エッジチェーンを得るエッジトレー
ス方法において:同一の探索中心における探索範囲を、
次のエッジ画素が発見できるまで、周囲1pix の範囲か
ら1pix ずつ順次広げること;mを2以上の整数とし、
kをm以下の整数としたとき、周囲k pixの探索範囲で
エッジ画素を発見できた場合は、この発見したエッジ画
素と探索中心のエッジ画素との間を、k−1個の画素で
補間すること;周囲m pixの探索範囲でエッジ画素を発
見できない場合は、エッジ画素の探索を終了すること;
を特徴とする方法である。この場合、第7の発明では、
現在の探索中心であるエッジ画素の位置を(Xi
i )とし、発見したエッジ画素の位置を(Xi+k ,Y
i+k )とし、現在の探索中心からh番目に補間されるべ
き画素の位置を(Xi+ h ,Yi+h )とすると、次式
(4)によりk−1個の画素の補間を行うことを特徴と
する。
On the other hand, in the edge tracing method of the sixth aspect of the invention for achieving the above object, a pixel satisfying a specific condition is set as an edge pixel, and the edge pixel is set as a search center, and the next edge pixel is extracted from the image data in the search range around the edge pixel. In the edge trace method for obtaining the edge chain by sequentially shifting the search center to the found edge pixel and repeating the process of searching, the search range at the same search center is
Until the next edge pixel is found, sequentially expand by 1pix from the surrounding 1pix range; m is an integer of 2 or more,
When k is an integer less than or equal to m, if an edge pixel can be found in the search range of the surrounding k pix, the found edge pixel and the edge pixel at the search center are interpolated by k-1 pixels. If no edge pixel can be found within the search range of the surrounding m pix, end the edge pixel search;
Is a method characterized by. In this case, in the seventh invention,
The position of the edge pixel which is the current search center is (X i ,
Y i ), and the position of the found edge pixel is (X i + k , Y
i + k ) and the position of the pixel to be interpolated h-th from the current search center is (Xi + h , Yi + h ), the interpolation of k-1 pixels is performed by the following equation (4). It is characterized by performing.

【数4】 [Equation 4]

【0018】更に、上記目的を達成する第8の発明のエ
ッジトレース方法は、特定の条件を満たす画素をエッジ
画素とし、エッジ画素を探索中心としてその周囲の特定
範囲に存在する次のエッジ画素を画像データから探索す
る処理を、順次探索中心をシフトして繰り返すことによ
り、始点から終点までエッジチェーンを得るエッジトレ
ース方法において:終点のエッジ画素を発見した場合
は、今までに得られたエッジチェーンの始点近傍に別の
エッジチェーンのエッジ画素が存在するか否かを判定す
ること;前記別のエッジチェーンのエッジ画素が存在す
る場合は、今までに得られたエッジチェーンの始点と終
点を入れ替え、新たな終点からエッジ画素の探索を続け
ること;前記別のエッジチェーンのエッジ画素が存在し
ない場合はエッジ画素の探索を終了すること;を特徴と
する。
Further, the edge tracing method according to the eighth aspect of the invention for achieving the above-mentioned object is that a pixel satisfying a specific condition is set as an edge pixel, and the next edge pixel existing in a specific range around the edge pixel is set as a search center. In the edge trace method that obtains an edge chain from the start point to the end point by sequentially shifting the search center and repeating the process of searching from the image data: When the edge pixel at the end point is found, the edge chain obtained so far Determining whether or not there is an edge pixel of another edge chain near the start point of the above; if there is an edge pixel of the other edge chain, the start point and end point of the edge chain obtained so far are replaced. , Continuing to search for edge pixels from the new end point; if there is no edge pixel in the other edge chain, the edge image Ending the search; characterized.

【0019】第9の発明は、第8の発明を第1ないし第
5の発明に適用したものであり、前記次のエッジ画素位
置の推定が所定回数継続しても画像データからエッジ画
素を発見することができない場合は、今までに得られた
エッジチェーンの始点近傍に別のエッジチェーンのエッ
ジ画素が存在するか否かを判定すること;前記別のエッ
ジチェーンのエッジ画素が存在する場合は、今までに得
られたエッジチェーンの始点と終点を入れ替え、新たな
終点からエッジ画素の探索を続けること;前記別のエッ
ジチェーンのエッジ画素が存在しない場合はエッジ画素
の探索を終了すること;を特徴とするエッジトレース方
法である。
A ninth invention is an application of the eighth invention to the first to fifth inventions, wherein an edge pixel is found from image data even if the estimation of the next edge pixel position is continued a predetermined number of times. If not, determine whether or not there is an edge pixel of another edge chain near the start point of the edge chain obtained so far; if an edge pixel of the other edge chain exists, Replacing the start point and the end point of the edge chain obtained up to now and continuing the search for the edge pixel from the new end point; ending the search for the edge pixel if the edge pixel of the other edge chain does not exist; Is an edge tracing method.

【0020】第10の発明は、第8の発明を第6ないし
第7の発明に適用したものであり、前記周囲m pixの探
索範囲でエッジ画素を発見することができない場合は、
今までに得られたエッジチェーンの始点近傍に別のエッ
ジチェーンのエッジ画素が存在するか否かを判定するこ
と;前記別のエッジチェーンのエッジ画素が存在する場
合は、今までに得られたエッジチェーンの始点と終点を
入れ替え、新たな終点からエッジ画素の探索を続けるこ
と;前記別のエッジチェーンのエッジ画素が存在しない
場合はエッジ画素の探索を終了すること;を特徴とする
エッジトレース方法である。
A tenth invention is an application of the eighth invention to the sixth to seventh inventions. When an edge pixel cannot be found in the search range of the surrounding m pix,
Determining whether or not an edge pixel of another edge chain exists near the start point of the edge chain obtained thus far; if an edge pixel of the other edge chain exists, it is obtained so far. An edge trace method, characterized in that the start point and the end point of an edge chain are exchanged, and the search for an edge pixel is continued from a new end point; if the edge pixel of the other edge chain does not exist, the search for the edge pixel is ended. Is.

【0021】[0021]

【作用】エッジ画像データがノイズ等により細分割され
ている場合は、或る探索中心の周囲1pix の範囲に次の
エッジ画素を発見できなくても、探索中心を少しシフト
したり、あるいは探索中心は変えずに範囲を広げれば、
エッジ画素を発見できる可能性が極めて高い。
When the edge image data is subdivided due to noise or the like, even if the next edge pixel cannot be found in the range of 1 pix around the certain search center, the search center is slightly shifted or the search center is searched. If you expand the range without changing,
It is very likely that you can find edge pixels.

【0022】そこで、第1の発明では次のエッジ画素を
発見できない場合は、既に求めたエッジ画素の位置デー
タから次のエッジ画素が存在しそうな位置を推定し、こ
の推定した位置の画素に探索中心をシフトとして更に次
のエッジ画素を探索する。これにより、比較的長いエッ
ジチェーンを得ることができる。推定方法はどのように
しても良いが、前式(3)のような直線近似による方法
が簡単である。1回の推定ではエッジ画素を発見できな
ければ何回も推定を繰り返すことになるが、ノイズ等に
よりエッジ画像データが細分割されているのではなく、
本当にエッジが終っていることもあるので、このような
場合のために、所定回数継続して推定を行ってもエッジ
画素を発見できない場合は、エッジ画素の探索を終了す
る。この場合、推定した位置をエッジチェーンの最終位
置とすることも可能であるが、最後に発見したエッジ画
素まで戻す方が信頼性が高く好ましい。
Therefore, when the next edge pixel cannot be found in the first invention, the position where the next edge pixel is likely to exist is estimated from the already obtained position data of the edge pixel, and the pixel at the estimated position is searched. The center is shifted to search for the next edge pixel. This makes it possible to obtain a relatively long edge chain. The estimation method may be any method, but the method based on the linear approximation as in the above equation (3) is simple. If the edge pixel cannot be found in one estimation, the estimation is repeated many times, but the edge image data is not subdivided due to noise or the like.
Since the edge may actually end, in such a case, when the edge pixel cannot be found even after the estimation is repeated a predetermined number of times, the edge pixel search is ended. In this case, it is possible to use the estimated position as the final position of the edge chain, but it is more reliable and preferable to return to the last found edge pixel.

【0023】一方、第6の発明では次のエッジ画素を発
見できない場合は、探索中心を変えずに探索範囲を周囲
1pix の範囲から1pix ずつ周囲m pixの範囲まで順次
波絞形に広げてエッジ画素を探索し、周囲k pixの探索
範囲でエッジ画素を発見した場合は途中をk−1個の画
素で補間する。これにより比較的長いエッジチェーンを
得ることができる。周囲m pixの範囲まで広げてもエッ
ジ画素を発見できない場合は、ノイズ等によるエッジ画
素データの細分割ではなく、本当にエッジが終っている
と判断してエッジ画素の探索を終了する。補間方法はど
のようにしても良いが、前式(4)のような直線近似に
よる方法が簡単である。
On the other hand, in the sixth aspect, when the next edge pixel cannot be found, the search range is sequentially expanded from the range of 1 pix in the periphery to the range of m pix in the periphery without changing the search center, and the edge is expanded. When a pixel is searched and an edge pixel is found in the search range of the surrounding k pix, the middle is interpolated with k−1 pixels. This makes it possible to obtain a relatively long edge chain. When the edge pixel cannot be found even if it is expanded to the range of the surrounding m pix, the edge pixel search is ended by determining that the edge is really ended, not by subdivision of the edge pixel data due to noise or the like. The interpolation method may be any method, but the method of linear approximation as in the previous expression (4) is simple.

【0024】第8、第9及び第10の各発明は折り返し
式エッジトレース方法と称すべきものであり、エッジト
レースの終了条件を、エッジトレースの始点の近傍に別
のエッジチェーンの画素が存在するか否かを検査するこ
とにより、終了すべきか否かを判断する。そして、始点
近傍に別のエッジチェーンが存在すれば、今までに得た
エッジチェーンをひっくり返した後、即ち同エッジチェ
ーンの始点と終点をひっくり返した後、新たな終点から
再びエッジトレースを開始する。これにより、エッジト
レースの最初の始点位置に左右されることなく、本来画
像に存在する長いエッジチェーンを正しく求めることが
できる。
Each of the eighth, ninth and tenth inventions should be referred to as a folded edge trace method, and the edge trace end condition is that a pixel of another edge chain exists near the start point of the edge trace. By checking whether or not, it is determined whether or not to end. If another edge chain exists near the start point, the edge chain obtained up to now is turned over, that is, the start point and end point of the same edge chain are turned over, and then edge tracing is restarted from the new end point. To do. This makes it possible to correctly obtain a long edge chain that originally exists in an image, without being affected by the initial starting point position of the edge trace.

【0025】基本となる第8の発明について図22〜図
25を参照して更に説明すると、下記(1)〜(4)の
通りである。但し、これらの図中で、左上を原点、横軸
にX位置、縦軸にY位置をとり、各格子に画素1pixel
を示す。また、エッジ画像データ1は一定のしきい値を
越える画素2からなり、この画素2には左下りの斜線を
付して示す。エッジチェーンを構成するものとして発見
した画素(エッジ画素)には交差斜線を付して示す。
The eighth basic invention will be further described with reference to FIGS. 22 to 25, which are as follows (1) to (4). However, in these figures, the upper left is the origin, the horizontal axis is the X position, and the vertical axis is the Y position.
Indicates. The edge image data 1 is composed of pixels 2 that exceed a certain threshold value, and the pixels 2 are shown with a diagonal line to the left. Pixels (edge pixels) found as constituting an edge chain are shown with cross hatching.

【0026】(1)まず、画像左上からエッジチェーン
が存在るか否かを探索し、図22に示すような最初の始
点3を見つける。そして、この始点3からエッジ画素の
候補がなくなるまで、図23に交差斜線で示すように、
エッジチェーン20のトレースを行う。 (2)次に、エッジチェーン20の始点3近傍に別のエ
ッジチェーンのエッジ画素の候補が存在するか否かを検
査する。 (3)図24に示すように、別のエッジチェーン22の
エッジ画素23が存在すれば、先に得たエッジチェーン
20の始点3と終点21とをひっくり返えし、始点21
A及び終点3Aとする。これは、エッジチェーン20の
集合(X=X0,X1 ,…,Xn ,Y=Y0 ,Y1
…,Yn |chain (X,Y))を、(X=X,X,…,
X,Y=Y,Y,…,Y|chain (X,Y))へ投影す
ることである。 (4)次に、前記(2)で得られたエッジチェーン20
の新たな終点3A(chain (Xn ,Yn ))から、図2
5に示すようにエッジチェーン22の候補画素がなくな
るまで探索を行い、始点21Aから終点24までの長い
エッジチェーン25を求める。
(1) First, the upper left corner of the image is searched for the presence of an edge chain to find the first starting point 3 as shown in FIG. Then, from this start point 3 until there are no edge pixel candidates, as shown by the cross hatched lines in FIG.
The edge chain 20 is traced. (2) Next, it is checked whether or not there is a candidate for an edge pixel of another edge chain near the starting point 3 of the edge chain 20. (3) As shown in FIG. 24, if the edge pixel 23 of another edge chain 22 exists, the start point 3 and the end point 21 of the edge chain 20 obtained previously are turned over, and the start point 21
A and end point 3A. This is a set of edge chains 20 (X = X 0 , X 1 , ..., X n , Y = Y 0 , Y 1 ,
…, Y n | chain (X, Y)) is converted into (X = X, X, ...,
X, Y = Y, Y, ..., Y | chain (X, Y)). (4) Next, the edge chain 20 obtained in (2) above.
2 from the new end point 3A (chain (X n , Y n )) of FIG.
As shown in FIG. 5, a search is performed until there are no candidate pixels for the edge chain 22, and a long edge chain 25 from the start point 21A to the end point 24 is obtained.

【0027】[0027]

【実施例】以下、図1〜図11を参照して発明の第1及
び第2実施例を説明する。また、図2、図3、図4、図
12〜図18を参照して発明の第3及び第4実施例を説
明する。なお、図1、図10にはそれぞれ第1、第2実
施例に係るエッジトレース方法の処理手順のフローが示
され、図2〜図9、図11には個々の処理を説明するた
めに画面上に例示したエッジ画像データが示されてい
る。また、図12、図17には第3、第4実施例に係る
エッジトレース方法の処理手順のフローがそれぞれ示さ
れ、図13〜図16、図18には個々の処理を説明する
ために画面上に例示したエッジ画像データが示されてい
る。なお、図2〜図9、図11及び図13〜図16、図
18において、各格子は画素1pix を示し、左上角の格
子を原点として、横軸にX位置をとり、縦軸にY位置を
とっている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The first and second embodiments of the invention will be described below with reference to FIGS. The third and fourth embodiments of the invention will be described with reference to FIGS. 2, 3, 4, and 12 to 18. 1 and 10 show the flow of the processing procedure of the edge tracing method according to the first and second embodiments, respectively, and FIGS. 2 to 9 and 11 show screens for explaining the individual processing. The edge image data illustrated above is shown. 12 and 17 show the flow of the processing procedure of the edge tracing method according to the third and fourth embodiments, respectively, and FIGS. 13 to 16 and 18 show screens for explaining the individual processing. The edge image data illustrated above is shown. 2 to 9, FIG. 11 and FIGS. 13 to 16 and FIG. 18, each grid represents a pixel 1 pix, the grid at the upper left corner is the origin, the X position is on the horizontal axis, and the Y position is on the vertical axis. Is taking.

【0028】<第1実施例:直線近似を用いた推定によ
るエッジトレース方法>図1に示す処理は画像処理装置
により、自動的に行われる。今、図1のステップS1で
入力した或る物体の画像データから次のステップS2
で、図2に示すような左下り斜線を付した画素2からな
るエッジ画像データ1を作成したとする。なお、前述の
如く、入力画像データに微分空間フィルタ等の鮮鋭化処
理を施すことによりエッジを強調した画像データを作成
し、必要に応じてエッジ強調画像データに細線化処理を
施すことにより、エッジ幅が1pix のエッジ画像データ
1を作成する。
<First Embodiment: Edge Tracing Method by Estimating Using Linear Approximation> The processing shown in FIG. 1 is automatically performed by the image processing apparatus. Now, from the image data of a certain object input in step S1 of FIG.
Then, it is assumed that the edge image data 1 including the pixel 2 with the diagonal line to the left as shown in FIG. 2 is created. As described above, the image data in which the edges are emphasized is created by performing the sharpening process such as the differential spatial filter on the input image data, and the edge-enhanced image data is subjected to the thinning process as necessary to obtain the edges. Create edge image data 1 with a width of 1 pix.

【0029】まず、図1のステップS3で、適当なしき
い値を基に、図2のエッジ画像データ1からエッジトレ
ース開始の始点となるエッジ画素を検出し、保存する。
図3(a)の交差斜線を付したエッジ画素3を始点とし
て検出する例では、下記(A)〜(D)の手法例でエッ
ジの始点を検出する。 (A)画面の左上角の画素からエッジの始点を探索す
る。 (B)右横方向に沿ってエッジの始点を探索する。 (C)上記(B)でエッジの始点を発見できない場合
は、1pix 下の左端から右横方向に沿ってエッジの始点
を探索する。 (D)エッジの始点が発見できるまで、上記(C)を画
面の下端まで繰り返す。
First, in step S3 of FIG. 1, the edge pixel which is the starting point of the edge trace start is detected from the edge image data 1 of FIG. 2 based on an appropriate threshold value and stored.
In the example in FIG. 3A in which the edge pixel 3 indicated by the cross-hatched line is detected as the starting point, the starting point of the edge is detected by the following method examples (A) to (D). (A) The starting point of the edge is searched from the pixel at the upper left corner of the screen. (B) Search for the starting point of the edge along the right lateral direction. (C) If the start point of the edge cannot be found in (B) above, the start point of the edge is searched along the right lateral direction from the left end one pix lower. (D) The above (C) is repeated up to the lower edge of the screen until the start point of the edge can be found.

【0030】次に、図1のステップS4で、図3(b)
に示すようにエッジの始点3を探索中心として、その周
囲1pix の範囲を右回り4、もしくは左回りに探索し、
適当なしきい値を基にエッジの始点3に続く隣りのエッ
ジ画素を探索する。図3(b)では、交差斜線を付した
画素5がしきい値を満たした最初の画素であり、これが
エッジ画素として発見され、保存される。
Next, in step S4 of FIG.
As shown in, with the start point 3 of the edge as the search center, the range of 1 pix around the edge is searched clockwise 4 or counterclockwise,
Based on an appropriate threshold value, the adjacent edge pixel following the edge start point 3 is searched. In FIG. 3 (b), the pixel 5 with cross hatching is the first pixel that satisfies the threshold value, and this is found and saved as an edge pixel.

【0031】エッジ画素5を発見した後は、図1のステ
ップS5からステップS6及びS4に処理を進め、図3
(c)に示すように、エッジ画素5に探索中心をシフト
してからその周囲1pix の範囲を右回り4または左回り
に探索し、適当なしきい値を基にエッジ画素5に続く隣
りのエッジ画素を探索する。
After the edge pixel 5 is found, the processing proceeds from step S5 to steps S6 and S4 in FIG.
As shown in (c), after shifting the search center to the edge pixel 5, the range of 1 pix around the edge pixel 5 is searched clockwise 4 or counterclockwise, and the adjacent edge following the edge pixel 5 based on an appropriate threshold value. Search for pixels.

【0032】上述したエッジ画素探索と探索中心シフト
を繰り返すことにより、図4に示すように、交差斜線を
付したエッジ画素6までが発見でき、保存される。
By repeating the above-described edge pixel search and search center shift, as shown in FIG. 4, even the edge pixels 6 with cross hatching can be found and saved.

【0033】しかし、図4の例ではエッジ画素6に探索
中心をシフトした場合には、その周囲1pix の範囲を探
索しても、次のエッジ画素を発見することができない。
従来は、この段階でエッジトレースを終了していた。
However, in the example of FIG. 4, when the search center is shifted to the edge pixel 6, the next edge pixel cannot be found even if the range of 1 pix around it is searched.
Conventionally, the edge trace is finished at this stage.

【0034】これに対し、発明ではエッジトレースを終
了せず、図5に示す斜線の入った丸印の画素7の如く、
次のエッジ画素が存在しそうな位置を推定し、その位置
にエッジ画素を発見できたものと仮定して、エッジ画素
の探索を進める。
On the other hand, in the present invention, the edge trace is not completed, and the pixel 7 is shown as a circled circle with diagonal lines in FIG.
The position where the next edge pixel is likely to exist is estimated, and it is assumed that the edge pixel has been found at that position, and the search for the edge pixel proceeds.

【0035】つまり、次のエッジ画素を発見できない場
合は、図1のステップS5から後述するステップS7と
S8を経由してステップS9に処理を進め、図5の画素
7の位置を推定する。本実施例では、現在の探索中心で
あるエッジ画素6を含めた過去n個のエッジ画素の位置
データを直線で近似し、その直線を現在の探索中心から
1pix 進めた位置を画素7の推定位置としている。この
推定の具体例を式で表わせば、次式(5)で求められ
る。但し、式(5)中で、(Xi ,Yi )は現在のエッ
ジ画素の位置、(Xi-j ,Yi-j )はj個前のエッジ画
素の位置、(Xi+ 1 ,Yi+1 )は推定したエッジ画素7
の位置とする。nは2以上の適宜な整数であり、固定値
として設定する。
That is, if the next edge pixel cannot be found, the process proceeds from step S5 in FIG. 1 to step S9 via steps S7 and S8 described later to estimate the position of pixel 7 in FIG. In this embodiment, the position data of the past n edge pixels including the edge pixel 6 which is the current search center is approximated by a straight line, and the position obtained by advancing the straight line by 1 pix from the current search center is the estimated position of the pixel 7. I am trying. If a specific example of this estimation is expressed by an equation, it can be obtained by the following equation (5). However, in the equation (5), (X i , Y i ) is the position of the current edge pixel, (X ij , Y ij ) is the position of the jth previous edge pixel, and (X i + 1 , Y i + 1) ) Is the estimated edge pixel 7
Position. n is an appropriate integer of 2 or more and is set as a fixed value.

【数5】 (Equation 5)

【0036】エッジ画素7の位置を推定したら図1のス
テップS6及びS4に処理を進め、図6に示すように、
推定したエッジ画素7を探索中心にシフトしてその周囲
1pix の範囲を右回り4、あるいは左回りに探索し、適
当なしきい値を基に、推定したエッジ画素7に続く隣り
のエッジ画素を探索する。
When the position of the edge pixel 7 is estimated, the process proceeds to steps S6 and S4 in FIG. 1, and as shown in FIG.
The estimated edge pixel 7 is shifted to the search center, and the range of 1 pix around the edge pixel 7 is searched clockwise 4 or counterclockwise, and an adjacent edge pixel subsequent to the estimated edge pixel 7 is searched based on an appropriate threshold value. To do.

【0037】図6の例では次のエッジ画素を発見できな
い。そこで、再度図1のステップS5からステップS7
とS8を経てステップS9に処理を進め、図7に示す斜
線の入った丸印の画素8の如く、更に次のエッジ画素が
存在しそうな位置を推定する。
In the example of FIG. 6, the next edge pixel cannot be found. Therefore, again from step S5 to step S7 in FIG.
Then, the process proceeds to step S9 via S8 and S8, and a position where a next edge pixel is likely to exist, such as the pixel 8 indicated by a shaded circle shown in FIG. 7, is estimated.

【0038】この場合、前式(5)において、(Xi
i )は現在の探索中心である先に推定したエッジ画素
7の位置であり、(Xi-j ,Yi-j )は推定したエッジ
画素7よりj個前のエッジ画素の位置、(Xi+1 ,Y
i+1 )は2回目に推定したエッジ画素8の位置である。
In this case, in the above equation (5), (X i ,
Y i ) is the position of the previously estimated edge pixel 7 which is the current search center, (X ij , Y ij ) is the position of the edge pixel j number before the estimated edge pixel 7, and (X i + 1 , Y
i + 1 ) is the position of the edge pixel 8 estimated the second time.

【0039】エッジ画素8の位置を推定したら再度図1
のステップS6及びS4に処理を進め、図8に示すよう
に、2回目に推定したエッジ画素8に探索中心をシフト
としてその周囲1pix の範囲を探索し、適当なしきい値
を基に、推定したエッジ画素8に続く隣りのエッジ画素
を探索する。
Once the position of the edge pixel 8 has been estimated, FIG.
The processing proceeds to steps S6 and S4, and as shown in FIG. 8, the edge pixel 8 estimated for the second time is searched for a range of 1 pix around the search center as a shift, and is estimated based on an appropriate threshold value. The adjacent edge pixel following the edge pixel 8 is searched.

【0040】図8の例では、交差斜線を付した画素9が
エッジ画素として発見され、保存される。また、エッジ
画素9が発見できたことから、推定したエッジ画素7,
8もエッジチェーンのデータとして保存される。
In the example of FIG. 8, the cross-hatched pixel 9 is found as an edge pixel and saved. Since the edge pixel 9 is found, the estimated edge pixel 7,
8 is also stored as edge chain data.

【0041】上述したエッジ画素探索と、エッジ画素位
置推定と、探索中心シフトとを繰り返すことにより、図
9に示すように、最終的に長いエッジチェーン10を得
る。
By repeating the above-described edge pixel search, edge pixel position estimation, and search center shift, a long edge chain 10 is finally obtained as shown in FIG.

【0042】次に、図1のステップS7,S8及びS1
0について説明する。
Next, steps S7, S8 and S1 in FIG.
0 will be described.

【0043】ステップS7ではエッジ画素位置を継続し
て推定した回数をカウントし、ステップS8ではカウン
トした推定回数を予め適宜に設定した所定回数例えば3
と比較する。カウントした推定回数が所定回数以下であ
ればステップS9に処理を進めてエッジ画素の位置を推
定するが、所定回数になってもエッジ画素を発見できな
ければステップS10に処理を進めてエッジトレースを
終了する。但し、ステップS10では、最後に発見した
エッジ画素よりも後に推定したエッジ画素の位置データ
は捨て、エッジチェーンの最終位置を最後に発見したエ
ッジ画素まで戻す。前述した所定回数は変更可能にし
て、エッジトレース結果を見て適当な値に設定すると良
い。
In step S7, the number of times the edge pixel position is continuously estimated is counted, and in step S8, the estimated number of times the edge pixel position is estimated is set to a predetermined number, for example, 3
Compare with If the counted number of times of estimation is less than or equal to the predetermined number of times, the process proceeds to step S9 to estimate the position of the edge pixel, but if the edge pixel cannot be found even after the predetermined number of times, the process proceeds to step S10 to perform edge tracing. finish. However, in step S10, the position data of the edge pixel estimated after the last found edge pixel is discarded, and the final position of the edge chain is returned to the last found edge pixel. It is preferable that the above-described predetermined number of times be changeable and that the value be set to an appropriate value by looking at the edge trace result.

【0044】なお、エッジの始点を1番目とすると、エ
ッジの始点からn番目までのエッジ画素については、推
定に用いるデータ数が少ないので、エッジ画素の位置推
定を行わず、従来通り周囲1pix の範囲にエッジ画素を
発見できなければエッジトレースを終了するものとして
いる。
If the starting point of the edge is the first, since the number of data used for estimation is small for the edge pixels from the starting point of the edge to the n-th edge, the position of the edge pixel is not estimated and the surrounding 1 pix is used as usual. If no edge pixel is found in the range, the edge trace is terminated.

【0045】<第2実施例:折り返し式エッジトレース
方法の第1実施例への適用>次に、図10及び図11、
並びに図2〜図9を参照して本発明の第2実施例を説明
する。本第2実施例は折り返し式エッジトレース方法を
第1実施例に適用したものであり、図10の処理手順は
図1のものと比べるとステップS11からステップS2
4が追加された以外、同じである。なお、図10に示す
処理も画像処理装置により自動的に行われる。また、図
10のステップS1で入力した画像データから次のステ
ップS2で、図2に示したような左下り斜線を付した画
素2からなるエッジ幅が1pixel のエッジ画像データ1
が作成される。
<Second Embodiment: Application of Folding Type Edge Tracing Method to First Embodiment> Next, FIGS.
A second embodiment of the present invention will be described with reference to FIGS. The second embodiment is an application of the folded edge tracing method to the first embodiment, and the processing procedure of FIG. 10 is different from that of FIG. 1 in steps S11 to S2.
Same, except that 4 was added. The processing shown in FIG. 10 is also automatically performed by the image processing apparatus. In addition, from the image data input in step S1 of FIG. 10, in the next step S2, the edge image data 1 having an edge width of 1 pixel, which is composed of pixels 2 with diagonally left-down diagonal lines as shown in FIG.
Is created.

【0046】まず、図10のステップS3からS9では
第1実施例と全く同じ処理が行われる。そこで簡単にま
とめると、次の通りである。ステップS3では、適当な
しきい値を基に図3に示すように、エッジトレース開始
の始点3となるエッジ画素を検出する。ステップS4で
はこのエッジ画素3を探索中心として周囲1pix の範囲
で次のエッジ画素を探索する。発見できればステップS
5からステップS6に進んで探索中心をシフトし、ステ
ップS4に戻って更に次のエッジ画素を探索するという
処理を繰り返す。図3,図4の例ではエッジ画素5,6
を次々に発見することができている。周囲1pix に次の
エッジ画素を発見できない場合は、ステップS7,S8
を経てステップS9に進み、次のエッジ画素が存在しそ
うな位置を前出の式(5)で推定し、その位置に図5の
如く次のエッジ画素7が発見できたものと仮定し、ステ
ップS6にて探索中心をシフトしてステップS4に戻っ
て図6の如く次のエッジ画素を探索するという処理を繰
り返す。この推定は所定回数例えば3回まで許容され、
ステップS7で推定は所定回数をカウントし、ステップ
S8で所定回数と比較する。図5〜図8の例では、2回
目に次のエッジ画素9が発見されている。このような処
理により、前述の如く第1実施例では図9に示したよう
に、始点3から終点21までのエッジチェーン10が求
められている。
First, in steps S3 to S9 of FIG. 10, the same processing as in the first embodiment is performed. The following is a brief summary. In step S3, as shown in FIG. 3, based on an appropriate threshold value, the edge pixel which is the starting point 3 of the edge trace start is detected. In step S4, the next edge pixel is searched in the range of 1 pix around this edge pixel 3 as the search center. If found, step S
The process of going from 5 to step S6, shifting the search center, returning to step S4, and further searching for the next edge pixel is repeated. In the example of FIGS. 3 and 4, the edge pixels 5 and 6
Can be found one after another. If the next edge pixel cannot be found in the surrounding 1 pix, steps S7 and S8
After proceeding to step S9, the position where the next edge pixel is likely to exist is estimated by the above equation (5), and it is assumed that the next edge pixel 7 can be found at that position as shown in FIG. The search center is shifted in S6, the process returns to step S4, and the process of searching for the next edge pixel as shown in FIG. 6 is repeated. This estimation is allowed up to a predetermined number of times, for example 3 times
The estimation counts a predetermined number of times in step S7 and compares with the predetermined number of times in step S8. In the example of FIGS. 5 to 8, the next edge pixel 9 is found the second time. As described above, in the first embodiment, the edge chain 10 from the start point 3 to the end point 21 is obtained by such processing as shown in FIG.

【0047】つまり、第1実施例では、ステップS8で
推定回数が所定回数を越えたと判定した場合にエッジト
レースを終了していた。
That is, in the first embodiment, the edge trace is ended when it is determined in step S8 that the estimated number of times exceeds the predetermined number.

【0048】これに対して本第2実施例では、ステップ
S8からステップS11以降に進み、エッジトレースを
更に続ける。詳細は以下の通りである。
On the other hand, in the second embodiment, the process proceeds from step S8 to step S11 and thereafter, and the edge tracing is further continued. Details are as follows.

【0049】即ち、ステップS8で推定回数が所定回数
を越えたと判定した場合、ステップS11では今までに
得たエッジチェーン10の始点3に探索中心をシフト
し、次のステップS12により探索中心の周囲1pix の
範囲に存在する別のエッジチェーン22のエッジ画素を
適当なしきい値を基に探索する。次のエッジ画素を発見
できたか否かをステップS13で判定し、発見できれば
ステップS14へ進み、発見できなければステップS2
1とS22を経てステップS23へ進む。
That is, when it is determined in step S8 that the estimated number of times exceeds the predetermined number, the search center is shifted to the starting point 3 of the edge chain 10 obtained up to now in step S11, and in the next step S12, the search center is surrounded. An edge pixel of another edge chain 22 existing in the range of 1 pix is searched based on an appropriate threshold value. In step S13, it is determined whether or not the next edge pixel has been found. If found, the process proceeds to step S14. If not found, step S2.
After 1 and S22, the process proceeds to step S23.

【0050】図9の例では始点3の周囲1pix には別の
エッジチェーン22のエッジ画素が発見できないので、
ステップS21,S22を経てステップS23に進み、
前述の式(5)により次のエッジ画素が存在しそうな位
置を推定する。図11に示す画素7が推定したものであ
る。そして、この画素7にステップS24で探索中心を
シフトしてから、ステップS12に戻り再度周囲1pix
の範囲で探索を行う。図11(a)の例では、1回目の
推定で別のエッジチェーン22のエッジ画素23を発見
できている。
In the example of FIG. 9, since an edge pixel of another edge chain 22 cannot be found in 1pix around the starting point 3,
After steps S21 and S22, the process proceeds to step S23,
The position where the next edge pixel is likely to exist is estimated by the above equation (5). It is estimated by the pixel 7 shown in FIG. Then, the search center is shifted to this pixel 7 in step S24, and then the process returns to step S12 and the surrounding 1 pix is again displayed.
Search within the range. In the example of FIG. 11A, the edge pixel 23 of another edge chain 22 can be found by the first estimation.

【0051】ステップS23での推定回数は図1または
図10のステップS9と同様、所定回数例えば3回まで
許容されており、ステップS21で推定回数をカウント
し、ステップS22で所定回数と比較する。所定回数に
なっても別のエッジチェーンのエッジ画素を発見できな
ければ、ステップS10に進み、エッジトレースを終了
する。
Similar to step S9 of FIG. 1 or FIG. 10, the number of times of estimation in step S23 is allowed up to a predetermined number of times, for example, three times, and the number of times of estimation is counted in step S21 and compared with the predetermined number of times in step S22. If the edge pixel of another edge chain cannot be found even after the predetermined number of times, the process proceeds to step S10, and the edge tracing is ended.

【0052】図11(a)の例では1回目の推定で別の
エッジチェーン22のエッジ画素23を発見できている
ので、ステップS13からステップS14に進み、今ま
でに得られたエッジチェーン10をひっくり返し、これ
までの始点3を新たな終点3Aとし、また、これまでの
終点21を新たな始点21Aとする。
In the example of FIG. 11 (a), since the edge pixel 23 of another edge chain 22 can be found by the first estimation, the process proceeds from step S13 to step S14, and the edge chain 10 obtained up to now is searched. It is turned over and the starting point 3 thus far is set as a new ending point 3A, and the ending point 21 so far is set as a new starting point 21A.

【0053】そして、次のステップS15に進み、新た
な終点3Aを探索中心としてこれに続くエッジ画素の探
索を再開する。但し、図11(a)の例では既に1回目
の推定後にエッジ画素23を発見できているので、ステ
ップS16からステップS17に処理を進め、このエッ
ジ画素23に探索中心をシフトし、ステップS15に戻
って新たな探索中心の周囲1pix の範囲に存在するエッ
ジ画素を適当なしきい値に基づいて探索する。この処理
の繰り返しにより、図11の例では(b)に示すように
推定を行うことなくエッジ画素24まで発見される。
Then, the process proceeds to the next step S15, and the new end point 3A is set as the search center, and the search for the edge pixel following the search is restarted. However, in the example of FIG. 11A, since the edge pixel 23 has already been found after the first estimation, the process proceeds from step S16 to step S17, the search center is shifted to this edge pixel 23, and the process proceeds to step S15. Returning to this, the edge pixels existing in the range of 1 pix around the new search center are searched based on an appropriate threshold value. By repeating this process, in the example of FIG. 11, even the edge pixel 24 is found without performing estimation as shown in (b).

【0054】エッジ画素24に探索中心をシフトした後
は、その周囲1pix に次のエッジ画素を発見できないの
でステップS16からステップS18,S19を経てス
テップS20に進み、前述の式(5)により次のエッジ
画素が存在しそうな位置を推定し、その位置にステップ
S17で探索中心をシフトし、ステップS15に戻って
周囲1pix での探索を行う。ここでの推定回数も所定回
数例えば3回許容されており、ステップS18で推定回
数をカウントし、次のステップS19で所定回数と比較
する。所定回数になっても次のエッジ画素を発見できな
ければ、ステップS10に進み、エッジトレースを終了
し、最後に発見したエッジ画素24を終点とする。
After the search center is shifted to the edge pixel 24, the next edge pixel cannot be found in the surrounding 1 pix, so the process proceeds from step S16 to steps S18 and S19 to step S20, where the following equation (5) The position where the edge pixel is likely to exist is estimated, the search center is shifted to that position in step S17, and the process returns to step S15 to perform the search in the surrounding 1 pix. The number of times of estimation here is also allowed a predetermined number of times, for example, three times, and the number of times of estimation is counted in step S18 and compared with the predetermined number of times in step S19. If the next edge pixel cannot be found even after the predetermined number of times, the process proceeds to step S10, the edge tracing is ended, and the edge pixel 24 found last is set as the end point.

【0055】かくして、図11(b)に示すように、始
点21Aから終点24までの長いエッジチェーン25が
得られる。
Thus, as shown in FIG. 11B, a long edge chain 25 from the starting point 21A to the ending point 24 is obtained.

【0056】<第3実施例:波絞形に順次探索範囲を広
げるエッジトレース方法>図12に示す処理も画像処理
装置により、自動的に行われる。また、図12のステッ
プS30で入力した画像データから、次のステップS3
1で図2に示したような左下り斜線を付した画素2から
なるエッジ幅が1pix のエッジ画像データ1を作成した
とする。
<Third Embodiment: Edge Tracing Method for Increasing Search Range Sequentially in Waveform> The processing shown in FIG. 12 is also automatically performed by the image processing apparatus. In addition, from the image data input in step S30 of FIG.
It is assumed that the edge image data 1 having an edge width of 1 pix composed of the pixel 2 with the diagonal line to the left as shown in FIG.

【0057】まず、図12のステップS32でも、適当
なしきい値を基に、図2のエッジ画像データ1からエッ
ジの始点となるエッジ画素を検出し、保存する。図3
(a)の交差斜線を付したエッジ画素3を始点として検
出する例では、第1実施例と同様下記(A)〜(D)の
手法例でエッジの始点を検出する。 (A)画面の左上角の画素から始点を探索する。 (B)右横方向に沿ってエッジの始点を探索する。 (C)上記(B)でエッジの始点を発見できない場合
は、1pix 下の左端から右横方向に沿ってエッジの始点
を探索する。 (D)エッジの始点が発見できるまで、上記(C)を画
面の下端まで繰り返す。
First, also in step S32 of FIG. 12, the edge pixel which is the starting point of the edge is detected from the edge image data 1 of FIG. 2 based on an appropriate threshold value and stored. FIG.
In the example of (a) in which the edge pixel 3 with the cross hatching is detected as the starting point, the starting point of the edge is detected by the following method examples (A) to (D) as in the first embodiment. (A) The starting point is searched from the pixel in the upper left corner of the screen. (B) Search for the starting point of the edge along the right lateral direction. (C) If the start point of the edge cannot be found in (B) above, the start point of the edge is searched along the right lateral direction from the left end one pix lower. (D) The above (C) is repeated up to the lower edge of the screen until the start point of the edge can be found.

【0058】次に、図12のステップS33で、図3
(b)に示すようにエッジの始点3を探索中心として、
その周囲1pix の範囲を右回り4、もしくは左回りに探
索し、適当なしきい値を基にエッジの始点3に続く隣り
のエッジ画素を探索する。図3(b)では、交差斜線を
付した画素5がしきい値を満たした最初の画素であり、
これがエッジ画素として発見され、保存される。
Next, in step S33 of FIG.
As shown in (b), with the starting point 3 of the edge as the search center,
A range of 1 pix around it is searched clockwise 4 or counterclockwise, and an adjacent edge pixel following the edge start point 3 is searched based on an appropriate threshold value. In FIG. 3 (b), the pixel 5 with cross hatching is the first pixel that satisfies the threshold value,
This is found as an edge pixel and saved.

【0059】エッジ画素5を発見した後は、図12のス
テップS34からステップS35及びS33に処理を進
め、図3(c)に示すように、エッジ画素5に探索中心
をシフトしてからその周囲1pix の範囲を右回り4また
は左回りに探索し、適当なしきい値を基にエッジ画素5
に続く隣りのエッジ画素を探索する。
After the edge pixel 5 is found, the processing proceeds from step S34 to steps S35 and S33 in FIG. 12, where the search center is shifted to the edge pixel 5 and then the surrounding area as shown in FIG. 3 (c). The range of 1 pix is searched clockwise 4 or counterclockwise, and the edge pixel 5 is searched based on an appropriate threshold value.
The next edge pixel following is searched.

【0060】上述したエッジ画素探索と探索中心シフト
を繰り返すことにより、図4に示すように、交差斜線を
付したエッジ画素6までが発見でき、保存される。
By repeating the above-described edge pixel search and search center shift, as shown in FIG. 4, up to the edge pixel 6 with cross hatching can be found and saved.

【0061】しかし、図4の例ではエッジ画素6に探索
中心をシフトした場合には、その周囲1pix の範囲を探
索しても、次のエッジ画素を発見することができない。
従来は、この段階でエッジトレースを終了していた。
However, in the example of FIG. 4, when the search center is shifted to the edge pixel 6, the next edge pixel cannot be found even if the range of 1 pix around it is searched.
Conventionally, the edge trace is finished at this stage.

【0062】図13に示すようにエッジ画素6を探索中
心としたまま、探索範囲を1pix 外側の部分まで拡張
し、周囲2pix の範囲で右回り4、もしくは左回りに探
索してエッジ画素を探索する。
As shown in FIG. 13, with the edge pixel 6 as the center of search, the search range is expanded to a portion outside 1 pix, and the edge pixel is searched by rotating clockwise 4 or counterclockwise within a range of surrounding 2 pix. To do.

【0063】つまり、図12のステップS33で次のエ
ッジ画素を発見できない場合は、ステップS36で探索
範囲を1pix 外側まで拡張し、後述するステップS37
を経由してステップS38に処理を進め、周囲2pix に
拡張した探索範囲で適当なしきい値を基にエッジ画素を
探索する。
That is, when the next edge pixel cannot be found in step S33 of FIG. 12, the search range is expanded to 1 pix outside in step S36, and step S37 described later is executed.
Then, the process proceeds to step S38 via and the edge pixel is searched based on an appropriate threshold value in the search range extended to the surrounding 2pix.

【0064】図13の例では探索範囲を1pix 外側に拡
張してもエッジ画素を発見できない。そこで、図12の
ステップS39を経由してステップS36に処理を進
め、図14に示すように、エッジ画素6を探索中心とし
たまま更に1pix 外側の部分まで探索範囲を拡張する。
そして、ステップS38にて、周囲3pix に拡張した探
索範囲で次のエッジ画素を探索する。
In the example of FIG. 13, edge pixels cannot be found even if the search range is expanded to the outside of 1 pix. Therefore, the process proceeds to step S36 via step S39 in FIG. 12, and as shown in FIG. 14, the search range is further extended to the portion 1 pix outside with the edge pixel 6 as the search center.
Then, in step S38, the next edge pixel is searched in the search range expanded to the surrounding 3 pix.

【0065】図14の例では交差斜線を付したエッジ画
素9を発見することができたので、このデータを保存し
て図12のステップS39からステップS40に処理を
進め、この発見したエッジ画素9と探索中心のエッジ画
素6との間を図14に示すように2(=3−1)個の画
素11,12で補間し、これらもエッジデータとする。
本実施例では、現在の探索中心であるエッジ画素6の位
置を(Xi ,Yi )とし、発見したエッジ画素9の位置
を(Xi+k ,Yi+k )とし、探索中心からh番目に補間
されるべき画素の位置を(Xi+h ,Yi+h )とすると、
次式(6)によりk−1個の画素データの補間を行う。
In the example of FIG. 14, since the edge pixel 9 with the cross hatching can be found, this data is saved and the process proceeds from step S39 to step S40 in FIG. The edge pixel 6 at the search center is interpolated by 2 (= 3-1) pixels 11 and 12 as shown in FIG. 14, and these are also used as edge data.
In the present embodiment, the position of the edge pixel 6 that is the current search center is (X i , Y i ), the position of the found edge pixel 9 is (X i + k , Y i + k ), and If the position of the pixel to be interpolated h-th is (X i + h , Y i + h ),
Interpolation of k-1 pixel data is performed by the following equation (6).

【数6】 (Equation 6)

【0066】図15の例では、k=3であるから、1番
目に補間されるべき交差斜線を付した画素11の位置
(Xi+1 ,Yi+1 )は次式(7)で与えられ、2番目に
補間されるべき交差斜線を付した画素12の位置(X
i+2 ,Yi+2 )は次式(8)で与えられることになる。
In the example of FIG. 15, since k = 3, the position (X i + 1 , Y i + 1 ) of the cross-hatched pixel 11 to be interpolated first is expressed by the following equation (7). The position of the pixel 12 (X
i + 2 , Y i + 2 ) is given by the following equation (8).

【数7】 Xi+1 =Xi +(Xi+3 −Xi )/3 Yi+1 =Yi +(Yi+3 −Yi )/3 …式(7)X i + 1 = X i + (X i + 3 −X i ) / 3 Y i + 1 = Y i + (Y i + 3 −Y i ) / 3 Equation (7)

【数8】 Xi+2 =Xi +2(Xi+3 −Xi )/3 Yi+2 =Yi +2(Yi+3 −Yi )/3 …式(8)X i + 2 = X i +2 (X i + 3 −X i ) / 3 Y i + 2 = Y i +2 (Y i + 3 −Y i ) / 3 Equation (8)

【0067】エッジ画素9を発見したら、図12のステ
ップS35に処理を進めてこのエッジ画素9に探索中心
をシフトし、ステップS33にて周囲1pix の範囲でエ
ッジ画素の探索を行う。
When the edge pixel 9 is found, the process proceeds to step S35 in FIG. 12 to shift the search center to this edge pixel 9, and in step S33, the edge pixel is searched for in the range of 1 pix around.

【0068】上述したエッジ画素の探索と、探索範囲の
拡張と、エッジ画素の補間と、探索中心のシフトとを繰
り返すことにより、最終的に図15に示したような長い
エッジチェーン13を得る。
By repeating the above-described edge pixel search, search range expansion, edge pixel interpolation, and search center shift, a long edge chain 13 as shown in FIG. 15 is finally obtained.

【0069】次に、図12のステップS37及びS41
について説明する。
Next, steps S37 and S41 of FIG.
Will be described.

【0070】ステップS37では探索範囲をどこまで拡
張したかを調べる。周囲m pix という所定範囲内で拡
張した場合は次のステップS38に処理を進めてエッジ
画素の探索を行うが、この所定範囲まで拡張してもエッ
ジ画素を発見できなければ、ステップS41に処理を進
めてエッジトレースを終了する。なお、所定範囲を決め
るmは2以上の範囲で変更可能にして、エッジトレース
結果を見て例えば3など、適当な値に設定すると良い。
In step S37, it is checked to what extent the search range has been expanded. When the pixel is expanded within the predetermined range of the surrounding m pix, the process proceeds to the next step S38 to search for an edge pixel, but if the edge pixel cannot be found even after expanding to the predetermined range, the process proceeds to step S41. Proceed to finish the edge trace. It should be noted that m, which determines the predetermined range, may be changed in a range of 2 or more, and may be set to an appropriate value such as 3 by looking at the edge trace result.

【0071】<第4実施例:折り返し式エッジトレース
方法の第3実施例への適用>次に、図17及び図18、
並びに図2〜図4、図12〜図16を参照して本発明の
第4実施例を説明する。本第4実施例は折り返し式エッ
ジトレース方法を第3実施例に適用したものであり、図
17の処理手順は図12のものと比べるとステップS4
2からステップS55が追加された以外、同じである。
なお、図17に示す処理も画像処理装置により自動的に
行われる。また、図17のステップS30で入力した画
像データから次のステップS31で、図2に示したよう
な左下り斜線を付した画素2からなるエッジ幅が1pixe
l のエッジ画像データ1が作成される。
<Fourth Embodiment: Application of Folding Type Edge Tracing Method to Third Embodiment> Next, FIGS.
A fourth embodiment of the present invention will be described with reference to FIGS. 2 to 4 and 12 to 16. The fourth embodiment is an application of the folding type edge tracing method to the third embodiment, and the processing procedure of FIG. 17 is step S4 as compared with that of FIG.
It is the same except that step S55 is added from step 2.
The processing shown in FIG. 17 is also automatically performed by the image processing apparatus. Further, from the image data input in step S30 of FIG. 17, in the next step S31, the edge width formed by the pixel 2 with the diagonal line to the left as shown in FIG. 2 is 1 pixe.
The edge image data 1 of l is created.

【0072】まず、図17のステップS32〜S40で
は第3実施例と全く同じ処理が行われる。そこで簡単に
まとめると、次の通りである。ステップS32では、適
当なしきい値を基に図3に示すように、エッジトレース
開始の始点3となるエッジ画素を検出する。ステップS
33ではこのエッジ画素3を探索中心として周囲1pix
の範囲で次のエッジ画素を探索する。発見できればステ
ップS34からステップS35に進んで探索中心をシフ
トし、ステップS33に戻って更に次のエッジ画素を探
索するという処理を繰り返す。図3、図4の例ではエッ
ジ画素5,6を次々に発見することができている。周囲
1pix に次のエッジ画素を発見できない場合は、ステッ
プS36に進み、図13の如くエッジ画素6を探索中心
としたまま探索範囲を周囲2pix の範囲に拡張してステ
ップS37を経てステップS38にてエッジ画素を探索
し、それでも発見できない場合はステップS39を経て
ステップS36に戻り、図14の如く更に探索範囲を周
囲3pix に拡張するという処理を繰り返す。この探索範
囲の拡張は周囲m pixまで許容され、ステップS37で
はどこまで拡張したかを調べる。図13〜図14の例で
は周囲3pix の範囲でエッジ画素9が発見されている。
そこで、ステップS40にて前述の式(6),(7),
(8)を用いた補間処理を行い、図15の如く発見済み
のエッジ画素6,9間を画素11,12で補間する。こ
のような処理により、前述の如く第3実施例では図16
に示したように、始点3から終点21までのエッジチェ
ーン13が求められている。
First, in steps S32 to S40 of FIG. 17, the same processing as in the third embodiment is performed. The following is a brief summary. In step S32, an edge pixel which is the starting point 3 of the edge trace start is detected based on an appropriate threshold value as shown in FIG. Step S
In 33, the edge pixel 3 is used as the search center and the surrounding 1 pix
The next edge pixel is searched in the range. If found, the process proceeds from step S34 to step S35 to shift the search center, and returns to step S33 to repeat the process of searching for the next edge pixel. In the examples of FIGS. 3 and 4, the edge pixels 5 and 6 can be found one after another. If the next edge pixel cannot be found in the surrounding 1 pix, the process proceeds to step S36, the search range is expanded to the surrounding 2 pix with the edge pixel 6 as the search center as shown in FIG. 13, and the process proceeds to step S37 and step S38 in step S38. The edge pixel is searched, and if it is still not found, the process returns to step S36 via step S39, and the process of further expanding the search range to the surrounding 3 pix as shown in FIG. 14 is repeated. The expansion of the search range is permitted up to the surrounding m pix, and in step S37, it is checked to what extent the search range has been expanded. In the examples of FIGS. 13 to 14, the edge pixels 9 are found in the range of 3 pix around.
Therefore, in step S40, the above equations (6), (7),
Interpolation processing using (8) is performed to interpolate between the found edge pixels 6 and 9 with pixels 11 and 12 as shown in FIG. By such processing, as described above, in the third embodiment, as shown in FIG.
As shown in, the edge chain 13 from the start point 3 to the end point 21 is obtained.

【0073】つまり、第3実施例では、ステップS37
で探索範囲が所定範囲m pixを越えると判定した場合に
エッジトレースを終了していた。
That is, in the third embodiment, step S37.
If it is determined that the search range exceeds the predetermined range m pix, the edge trace is ended.

【0074】これに対して本第4実施例では、ステップ
S37からステップS42以降に進み、エッジトレース
を更に続ける。詳細は以下の通りである。
On the other hand, in the fourth embodiment, the process proceeds from step S37 to step S42 and thereafter, and the edge tracing is further continued. Details are as follows.

【0075】即ち、ステップS37で探索範囲が所定範
囲m pixを越えたと判定した場合、ステップS42では
今までに得たエッジチェーン13の始点3に探索中心を
シフトし、次のステップS43により探索中心の周囲1
pix の範囲に存在する別のエッジチェーンのエッジ画素
を適当なしきい値を基に探索する。次のエッジ画素を発
見できたか否かをステップS44で判定し、発見できれ
ばステップS45へ進み、発見できなければステップS
54へ進む。
That is, when it is determined in step S37 that the search range has exceeded the predetermined range m pix, in step S42 the search center is shifted to the starting point 3 of the edge chain 13 obtained thus far, and in step S43 the search center is shifted. Around 1
An edge pixel of another edge chain existing in the range of pix is searched based on an appropriate threshold value. In step S44, it is determined whether the next edge pixel has been found. If found, the process proceeds to step S45. If not found, the process proceeds to step S45.
Proceed to 54.

【0076】図16の例では始点3の周囲1pix には別
のエッジチェーン22のエッジ画素が発見できないの
で、ステップS53に進み図18(a)の如く始点3の
周囲2pix まで探索範囲を拡張し、ステップS55を経
てステップS44に戻る。図18(a)の例では周囲2
pix の範囲で、別のエッジチェーン22のエッジ画素2
3を発見できている。従って、その後はステップS45
に進む。
In the example of FIG. 16, since an edge pixel of another edge chain 22 cannot be found in 1 pix around the starting point 3, the process proceeds to step S53, and the search range is expanded to 2 pix around the starting point 3 as shown in FIG. 18 (a). , And returns to step S44 through step S55. In the example of FIG.
Edge pixel 2 of another edge chain 22 in the range of pix
I have discovered 3. Therefore, after that, step S45
Proceed to.

【0077】ステップS54での探索範囲の拡張は図1
2または図17のステップS36と同様、周囲m pixま
で許容されており、ステップS55で探索範囲の拡張を
調べ、周囲m pixになっても別のエッジチェーンのエッ
ジ画素を発見できなければ、ステップS41に進み、エ
ッジトレースを終了する。
The extension of the search range in step S54 is shown in FIG.
2 or similarly to step S36 of FIG. 17, up to the surrounding m pix is permitted, and if the expansion of the search range is checked in step S55 and an edge pixel of another edge chain cannot be found even when it reaches the surrounding m pix, the step Proceed to S41, and end the edge trace.

【0078】図18(a)の例ではm=3とすれば、周
囲2pix の範囲で別のエッジチェーン22のエッジ画素
23を発見できているので、ステップS44からステッ
プS45に進み、今までに得られたエッジチェーン13
をひっくり返し、このまでの始点3を新たな始点3Aと
し、また、これまでの始点21を新たな始点21Aとす
る。
In the example of FIG. 18A, if m = 3, another edge pixel 23 of the edge chain 22 can be found within the range of 2 pix around, so that the process proceeds from step S44 to step S45, until now. The obtained edge chain 13
Is turned over, the starting point 3 up to this point is set as a new starting point 3A, and the starting point 21 so far is set as a new starting point 21A.

【0079】そして、次のステップS46に進み、新た
な終点3Aを探索中心としてこれに続くエッジ画素の探
索を再開する。但し、図18(a)の例では既に周囲2
pixに拡張した範囲でエッジ画素23を発見しているの
で、ステップS49〜52を経てステップS53に進
み、2つのエッジ画素3,23間を図18(b)の如く
画素11で補間する。
Then, the process proceeds to the next step S46, and the new end point 3A is set as the search center, and the search for the edge pixel subsequent thereto is restarted. However, in the example of FIG.
Since the edge pixel 23 is found in the range extended to pix, the process proceeds to step S53 through steps S49 to 52, and the two edge pixels 3 and 23 are interpolated by the pixel 11 as shown in FIG. 18B.

【0080】次いで、ステップS48でエッジ画素23
に探索中心をシフトし、ステップS46に戻って新たな
探索中心の周囲1pix の範囲に存在するエッジ画素を適
当なしきい値に基づいて探索する。この処理の繰り返し
により、図18の例では(b)に示すようにエッジ画素
23以降は探索範囲を拡張することなくエッジ画素24
まで発見される。
Next, in step S48, the edge pixel 23
The search center is shifted to, and the process returns to step S46 to search for an edge pixel existing in the range of 1 pix around the new search center based on an appropriate threshold value. By repeating this process, in the example of FIG. 18, as shown in (b) of FIG.
Is even discovered.

【0081】エッジ画素24に探索中心をシフトした後
は、その周囲1pix に次のエッジ画素を発見できないの
で、ステップS47からステップS49に進み、探索中
心は変えずに探索範囲を周囲2pix まで、1pix 分拡張
し、ステップS50を経て適当なしきい値の基で探索を
行う。ステップS52でエッジ画素を発見できなけれ
ば、ステップS49に戻り更に探索範囲を拡張し、探索
を続ける。仮に、拡張により次のエッジ画素を発見でき
れば、図12または図17のステップS40と同様、そ
の間の画素をステップS53で補間した後、ステップS
48にで探索中心を発見したエッジ画素をシフトし、ス
テップS46に戻る。
After shifting the search center to the edge pixel 24, the next edge pixel cannot be found in the surrounding 1 pix, so the process proceeds from step S47 to step S49, and the search range is changed to 1 pix up to the surrounding 2 pix without changing the search center. It is expanded by an amount, and the search is performed based on an appropriate threshold value through step S50. If no edge pixel can be found in step S52, the process returns to step S49 to further expand the search range and continue the search. If the next edge pixel can be found by the expansion, the pixels in between are interpolated in step S53 as in step S40 of FIG. 12 or FIG.
The edge pixel in which the search center is found is shifted in step 48, and the process returns to step S46.

【0082】ステップS49での探索範囲の拡張は周囲
m pixまで許容されており、ステップS50で探索範囲
の拡張を調べ、周囲m pixになっても次の画素を発見で
きなければ、ステップS41に進みエッジトレースを終
了する。
The expansion of the search range in step S49 is permitted up to the surrounding m pix. If the expansion of the search range is checked in step S50 and the next pixel cannot be found even when the surrounding m pix is reached, the process proceeds to step S41. Advance Ends edge trace.

【0083】以上の処理により、図18(b)の例で
は、エッジ画素24が終点となる。つまり、始点21A
から終点24までの長いエッジチェーン25が求まる。
With the above processing, in the example of FIG. 18B, the edge pixel 24 becomes the end point. That is, the starting point 21A
A long edge chain 25 from the end point 24 to the end point 24 is obtained.

【0084】上記第1〜第4各実施例では、具体的な物
体のエッジを画像処理によりエッジ画像データから検出
する場合を想定している。しかし、本発明は抽象的なエ
ッジを検出する場合にも適用することが可能である。つ
まり、エッジ画素は或る限界を表わす画素であれば何で
もかまわないから、任意の空間的な画像データ群の中で
或る特定の条件を満たす画素はエッジ画素であるので、
このようなエッジ画素の連なりもエッジチェーンであ
り、本発明を適用することができる。
In each of the first to fourth embodiments described above, it is assumed that the specific edge of the object is detected from the edge image data by image processing. However, the present invention can also be applied to the case of detecting an abstract edge. That is, since the edge pixel may be any pixel as long as it represents a certain limit, a pixel satisfying a certain specific condition in an arbitrary spatial image data group is an edge pixel.
A series of such edge pixels is also an edge chain, and the present invention can be applied.

【0085】例えば、プールや湖における三次元位置に
関する水温データが得られたとする。この場合、水面で
の10〜12℃の温度部分での連なりをエッジチェーン
としてトレースする場合を考えると、水面での温度分布
が画像データとして与えられることになり、そのうち1
0〜12℃の画素をエッジ画素とするだけで、第1〜第
4実施例と同様に10〜12℃という条件を満たすエッ
ジチェーンを得ることができる。また、三次元的に拡張
すれば、水中の或る指定した温度分布をエッジチェーン
として検出することができる。
For example, it is assumed that water temperature data regarding a three-dimensional position in a pool or a lake is obtained. In this case, considering a case where a chain of 10 to 12 ° C. on the water surface is traced as an edge chain, the temperature distribution on the water surface is given as image data.
An edge chain satisfying the condition of 10 to 12 ° C. can be obtained as in the first to fourth embodiments only by using pixels of 0 to 12 ° C. as edge pixels. Further, if it is expanded three-dimensionally, a specified temperature distribution in water can be detected as an edge chain.

【0086】[0086]

【発明の効果】第1の発明ではエッジ画素を発見できな
い場合は、既に求めたエッジ画素の位置データから次の
エッジ画素が存在しそうな位置を推定し、この推定した
位置の画素に探索中心をシフトとして更に次のエッジ画
素を探索するので、比較的長いエッジチェーンを得るこ
とができる。推定方法は第2の発明のように直線近似に
よる方法が簡単でよく、例えば第3の発明における式
(1)を用いると良い。第4の発明では所定回数継続し
て推定を行ってもエッジ画素を発見できない場合にはエ
ッジ画素の探索を終了することにより、ノイズ等でエッ
ジ画像データが細分割されている場合と、エッジが終っ
ている場合とを区別することができる。第5の発明では
エッジチェーンの最終位置を最後に発見したエッジ画素
まで戻すので、エッジチェーンの信頼性が高い。
According to the first aspect of the present invention, when the edge pixel cannot be found, the position where the next edge pixel is likely to exist is estimated from the already obtained edge pixel position data, and the search center is set to the pixel at the estimated position. Since the next edge pixel is searched for as a shift, a relatively long edge chain can be obtained. As the estimation method, the method based on the linear approximation as in the second invention may be simple, and for example, the formula (1) in the third invention may be used. In the fourth invention, when the edge pixel cannot be found even if the estimation is continuously performed a predetermined number of times, the search for the edge pixel is ended, so that the edge image data is subdivided by noise and It can be distinguished from the end. In the fifth aspect of the invention, since the final position of the edge chain is returned to the edge pixel that was found last, the reliability of the edge chain is high.

【0087】一方、第6の発明ではエッジ画素を発見で
きない場合は、探索中心を変えずに探索範囲を周囲1pi
x の範囲から1pix ずつ周囲m pixの範囲まで順次波絞
形に広げてエッジ画素を探索し、周囲k pixの探索範囲
でエッジ画素を発見した場合は途中をk−1個の画素デ
ータで補間するので、比較的長いエッジチェーンを得る
ことができる。補間方法は第7の発明のように、式
(2)を用いた直線近似による補間が簡単である。
On the other hand, in the sixth invention, when the edge pixel cannot be found, the search range is kept 1 pi without changing the search center.
Edge pixels are sequentially searched from the range of x by 1 pix to a range of surrounding m pix in a corrugated form, and when an edge pixel is found in the search range of surrounding k pix, the middle is interpolated with k-1 pixel data. Therefore, a relatively long edge chain can be obtained. As for the interpolation method, as in the seventh invention, the interpolation by the linear approximation using the equation (2) is easy.

【0088】また、第8から第10の発明では、エッジ
チェーンの途中からエッジトレースを開始したとして
も、開始点で分断されることなく長いエッジチェーンを
得ることができる。
Further, in the eighth to tenth inventions, even if the edge trace is started in the middle of the edge chain, a long edge chain can be obtained without being divided at the starting point.

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

【図1】第1実施例に係るエッジトレース方法を示すフ
ローチャート。
FIG. 1 is a flowchart showing an edge tracing method according to a first embodiment.

【図2】エッジ画像データの一例を示す図。FIG. 2 is a diagram showing an example of edge image data.

【図3】周囲1 pix の範囲で次のエッジ画素を発見し
ている様子を示す図。
FIG. 3 is a diagram showing a state in which a next edge pixel is found within a range of 1 pix around the pixel.

【図4】周囲1 pix の範囲で次のエッジ画素を発見で
きない様子を示す図。
FIG. 4 is a diagram showing a state in which a next edge pixel cannot be found in a surrounding 1 pix range.

【図5】第1回目に推定したエッジ画素位置を示す図。FIG. 5 is a diagram showing edge pixel positions estimated for the first time.

【図6】第1回目に推定したエッジ画素に探索中心をシ
フトして次のエッジ画素を探索する様子を示す図。
FIG. 6 is a diagram showing how the search center is shifted to the edge pixel estimated for the first time and the next edge pixel is searched.

【図7】第2回目に推定したエッジ画素位置を示す図。FIG. 7 is a diagram showing edge pixel positions estimated for the second time.

【図8】第2回目に推定したエッジ画素に探索中心をシ
フトして次のエッジ画素を探索する様子を示す図。
FIG. 8 is a diagram showing how the search center is shifted to the edge pixel estimated for the second time and the next edge pixel is searched.

【図9】得られたエッジチェーンを示す図。FIG. 9 is a view showing the obtained edge chain.

【図10】第2実施例に係るエッジトレース方法を示す
フローチャート。
FIG. 10 is a flowchart showing an edge tracing method according to the second embodiment.

【図11】エッジチェーンを折り返して次のエッジ画素
を探索する様子を示す図。
FIG. 11 is a diagram showing how the edge chain is folded back to search for the next edge pixel.

【図12】第3実施例に係るエッジトレース方法を示す
フローチャート。
FIG. 12 is a flowchart showing an edge tracing method according to the third embodiment.

【図13】探索範囲を1pix 外側に拡張して次のエッジ
画素を探索する様子を示す図。
FIG. 13 is a diagram showing how the search range is expanded to the outside of 1 pix to search for the next edge pixel.

【図14】探索範囲を更に1pix 外側に拡張して次のエ
ッジ画素を探索する様子を示す図。
FIG. 14 is a diagram showing how the search range is further expanded to the outside of 1 pix to search for the next edge pixel.

【図15】補間したエッジ画素を示す図。FIG. 15 is a diagram showing interpolated edge pixels.

【図16】得られたエッジチェーンを示す図。FIG. 16 is a view showing the obtained edge chain.

【図17】第4実施例に係るエッジトレース方法を示す
フローチャート。
FIG. 17 is a flowchart showing an edge tracing method according to the fourth embodiment.

【図18】エッジチェーンを折り返して次のエッジ画素
を探索する様子を示す図。
FIG. 18 is a diagram showing how an edge chain is folded back to search for the next edge pixel.

【図19】従来方法を示すフローチャート。FIG. 19 is a flowchart showing a conventional method.

【図20】従来技術におけるエッジチェーン分断を示す
図。
FIG. 20 is a diagram showing edge chain division in the conventional technique.

【図21】従来技術におけるエッジチェーン分断を示す
図。
FIG. 21 is a diagram showing edge chain division in the related art.

【図22】本発明による折り返し式エッジトレース方法
の原理を示す図。
FIG. 22 is a diagram showing the principle of a folded edge tracing method according to the present invention.

【図23】本発明による折り返し式エッジトレース方法
の原理を示す図。
FIG. 23 is a diagram showing the principle of a folded edge tracing method according to the present invention.

【図24】本発明による折り返し式エッジトレース方法
の原理を示す図。
FIG. 24 is a diagram showing the principle of a folded edge tracing method according to the present invention.

【図25】本発明による折り返し式エッジトレース方法
の原理を示す図。
FIG. 25 is a diagram showing the principle of a folded edge tracing method according to the present invention.

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

1 エッジ画像データ 3 エッジの始点 3A 新たな終点 5,6,9,21,23,24 発見したエッジ画素 7,8 推定したエッジ画素 10,13,20,25 エッジチェーン 11,12 補間したエッジ画素 21A 新たな始点 22 別のエッジチェーン 1 Edge Image Data 3 Edge Start Point 3A New End Point 5,6,9,21,23,24 Discovered Edge Pixel 7,8 Estimated Edge Pixel 10,13,20,25 Edge Chain 11,12 Interpolated Edge Pixel 21A New starting point 22 Another edge chain

───────────────────────────────────────────────────── フロントページの続き (72)発明者 井倉 浩司 東京都品川区大崎二丁目1番17号 株式会 社明電舎内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Koji Ikura 2-17-1 Osaki, Shinagawa-ku, Tokyo Inside the Meidensha Co., Ltd.

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 特定の条件を満たす画素をエッジ画素と
し、エッジ画素を探索中心としてその周囲1pix の範囲
に存在する次のエッジ画素を画像データから探索する処
理を、順次探索中心をシフトして繰り返すことにより、
エッジチェーンを得るエッジトレース方法において:前
記エッジ画素の探索の際に次のエッジ画素を発見できた
場合は、この発見したエッジ画素に探索中心をシフトす
ること;前記エッジ画素の探索の際に次のエッジ画素を
発見できない場合は、既に求めたエッジ画素の位置デー
タから次のエッジ画素の位置を推定し、この推定した位
置の画素に探索中心をシフトすること;を特徴とするエ
ッジトレース方法。
1. A process for searching a next edge pixel existing in a range of 1 pix around the pixel satisfying a specific condition as an edge pixel and using the edge pixel as a search center by sequentially shifting the search center. By repeating
In an edge tracing method for obtaining an edge chain: if the next edge pixel can be found in the search for the edge pixel, shift the search center to this found edge pixel; If the edge pixel of is not found, the position of the next edge pixel is estimated from the position data of the edge pixel already obtained, and the search center is shifted to the pixel at this estimated position.
【請求項2】 請求項1において、直線近似により前記
次のエッジ画素位置の推定を行うことを特徴とするエッ
ジトレース方法。
2. The edge tracing method according to claim 1, wherein the next edge pixel position is estimated by linear approximation.
【請求項3】 請求項1において、現在のエッジ画素の
位置を(Xi ,Yi)とし、j個前のエッジ画素の位置
を(Xi-j ,Yi-j )とし、前記次のエッジ画素の位置
を(Xi+1 ,Yi+1 )とすると、過去n個のエッジ画素
の位置データから、次式(1)により推定を行うことを
特徴とするエッジトレース方法。 【数1】
3. The method according to claim 1, wherein the position of the current edge pixel is (X i , Y i ), and the position of the jth previous edge pixel is (X ij , Y ij ), and An edge tracing method characterized in that, when the position is (X i + 1 , Y i + 1 ), it is estimated from the position data of the past n edge pixels by the following expression (1). [Equation 1]
【請求項4】 請求項1から3のうちいずれか一つにお
いて、前記次のエッジ画素位置の推定が所定回数継続し
ても画像データからエッジ画素を発見できない場合にエ
ッジ画素の探索を終了することを特徴とするエッジトレ
ース方法。
4. The edge pixel search according to claim 1, wherein the edge pixel search is terminated when the edge pixel position cannot be found from the image data even if the next edge pixel position estimation is continued a predetermined number of times. An edge tracing method characterized by the above.
【請求項5】 請求項4において、エッジ画素の探索を
終了した場合は、エッジチェーンの最終位置を最後に発
見したエッジ画素まで戻すことを特徴とするエッジトレ
ース方法。
5. The edge trace method according to claim 4, wherein when the search for the edge pixel is completed, the final position of the edge chain is returned to the edge pixel that was found last.
【請求項6】 特定の条件を満たす画素をエッジ画素と
し、エッジ画素を探索中心としてその周囲の探索範囲で
画像データから次のエッジ画素を探索する処理を、発見
したエッジ画素に順次探索中心をシフトして繰り返すこ
とにより、エッジチェーンを得るエッジトレース方法に
おいて:同一の探索中心における探索範囲を、次のエッ
ジ画素が発見できるまで、周囲1pix の範囲から1pix
ずつ順次広げること;mを2以上の整数とし、kをm以
下の整数としたとき、周囲k pixの探索範囲でエッジ画
素を発見できた場合は、この発見したエッジ画素と探索
中心のエッジ画素との間を、k−1個の画素で補間する
こと;周囲m pixの探索範囲でエッジ画素を発見できな
い場合は、エッジ画素の探索を終了すること;を特徴と
するエッジトレース方法。
6. A process of searching a next edge pixel from image data in a search range around the edge pixel, which is a pixel satisfying a specific condition, is set as a search center, and the found edge pixel is sequentially searched as a search center. In the edge tracing method in which an edge chain is obtained by shifting and repeating: the search range at the same search center is 1pix from the range of 1pix around until the next edge pixel can be found.
When m is an integer of 2 or more and k is an integer of m or less, when an edge pixel can be found in the search range of the surrounding k pix, the found edge pixel and the edge pixel at the search center And k−1 pixels are interpolated between the distances between and, and when the edge pixel cannot be found in the search range of the surrounding m pix, the edge pixel search is ended.
【請求項7】 請求項6において、現在の探索中心であ
るエッジ画素の位置を(Xi ,Yi )とし、発見したエ
ッジ画素の位置を(Xi+k ,Yi+k )とし、現在の探索
中心からh番目に補間されるべき画素の位置を
(Xi+h ,Yi+h )とすると、次式(2)によりk−1
個の画素の補間を行うことを特徴とするエッジトレース
方法。 【数2】
7. The position of the edge pixel which is the current search center is (X i , Y i ) and the position of the found edge pixel is (X i + k , Y i + k ) according to claim 6. Assuming that the position of the pixel to be interpolated h-th from the current search center is (X i + h , Y i + h ), k−1 is calculated by the following equation (2).
An edge tracing method, characterized by performing interpolation of individual pixels. [Equation 2]
【請求項8】 特定の条件を満たす画素をエッジ画素と
し、エッジ画素を探索中心としてその周囲の特定範囲に
存在する次のエッジ画素を画像データから探索する処理
を、順次探索中心をシフトして繰り返すことにより、始
点から終点までエッジチェーンを得るエッジトレース方
法において:終点のエッジ画素を発見した場合は、今ま
でに得られたエッジチェーンの始点近傍に別のエッジチ
ェーンのエッジ画素が存在するか否かを判定すること;
前記別のエッジチェーンのエッジ画素が存在する場合
は、今までに得られたエッジチェーンの始点と終点を入
れ替え、新たな終点からエッジ画素の探索を続けるこ
と;前記別のエッジチェーンのエッジ画素が存在しない
場合はエッジ画素の探索を終了すること;を特徴とする
エッジトレース方法。
8. A process in which a pixel satisfying a specific condition is set as an edge pixel, the edge pixel is set as a search center, and the next edge pixel existing in a specific range around the edge pixel is searched from the image data by sequentially shifting the search center. In the edge tracing method that obtains an edge chain from the start point to the end point by repeating: If an edge pixel at the end point is found, is there an edge pixel of another edge chain near the start point of the edge chain obtained so far? Determining whether or not;
If the edge pixel of the another edge chain exists, the start point and the end point of the edge chain obtained so far are replaced, and the search for the edge pixel is continued from the new end point; Terminating the search for edge pixels if they do not exist;
【請求項9】 請求項1から5いずれか一つにおいて、
前記次のエッジ画素位置の推定が所定回数継続しても画
像データからエッジ画素を発見することができない場合
は、今までに得られたエッジチェーンの始点近傍に別の
エッジチェーンのエッジ画素が存在するか否かを判定す
ること;前記別のエッジチェーンのエッジ画素が存在す
る場合は、今までに得られたエッジチェーンの始点と終
点を入れ替え、新たな終点からエッジ画素の探索を続け
ること;前記別のエッジチェーンのエッジ画素が存在し
ない場合はエッジ画素の探索を終了すること;を特徴と
するエッジトレース方法。
9. The method according to claim 1, wherein
If the edge pixel position cannot be found from the image data even if the estimation of the next edge pixel position continues for a predetermined number of times, the edge pixel of another edge chain exists near the start point of the edge chain obtained up to now. If there is an edge pixel of the other edge chain, the start point and the end point of the edge chain obtained so far are replaced, and the search for the edge pixel is continued from the new end point; Terminating the search for an edge pixel when there is no edge pixel in the other edge chain;
【請求項10】 請求項6または7において、前記周囲
m pixの探索範囲でエッジ画素を発見することができな
い場合は、今までに得られたエッジチェーンの始点近傍
に別のエッジチェーンのエッジ画素が存在するか否かを
判定すること;前記別のエッジチェーンのエッジ画素が
存在する場合は、今までに得られたエッジチェーンの始
点と終点を入れ替え、新たな終点からエッジ画素の探索
を続けること;前記別のエッジチェーンのエッジ画素が
存在しない場合はエッジ画素の探索を終了すること;を
特徴とするエッジトレース方法。
10. The edge pixel of another edge chain according to claim 6 or 7, when an edge pixel cannot be found in the search range of the surrounding m pix, in the vicinity of the start point of the edge chain obtained so far. If there is an edge pixel of the other edge chain, the start point and the end point of the edge chain obtained up to now are exchanged, and the search for the edge pixel is continued from the new end point. An edge tracing method, wherein the edge pixel search is terminated when there is no edge pixel of the another edge chain.
JP7082434A 1994-05-31 1995-04-07 Edge trace method Pending JPH0850655A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7082434A JPH0850655A (en) 1994-05-31 1995-04-07 Edge trace method

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP11824294 1994-05-31
JP6-118242 1994-05-31
JP7082434A JPH0850655A (en) 1994-05-31 1995-04-07 Edge trace method

Publications (1)

Publication Number Publication Date
JPH0850655A true JPH0850655A (en) 1996-02-20

Family

ID=26423453

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7082434A Pending JPH0850655A (en) 1994-05-31 1995-04-07 Edge trace method

Country Status (1)

Country Link
JP (1) JPH0850655A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6654497B1 (en) 1999-01-18 2003-11-25 Canon Kabushiki Kaisha Image processing apparatus, method and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6654497B1 (en) 1999-01-18 2003-11-25 Canon Kabushiki Kaisha Image processing apparatus, method and storage medium

Similar Documents

Publication Publication Date Title
JP2018520428A (en) Image processing method and apparatus
JP6422250B2 (en) Image processing method, image processing apparatus, program, and recording medium
JP5854802B2 (en) Image processing apparatus, image processing method, and computer program
US10332291B2 (en) Content aware image editing
JP5182530B2 (en) Image interpolation method, image interpolation apparatus, and program
CN106097375B (en) A kind of the folding line detection method and device of scan image
CN111260675A (en) High-precision extraction method and system for image real boundary
JPH0850655A (en) Edge trace method
JP5566158B2 (en) Image processing method, image processing apparatus, and program
JP3564371B2 (en) Figure editing apparatus and method
CN114356201A (en) Writing beautifying method, device, equipment and readable storage medium
JP5629483B2 (en) Image processing method, image processing apparatus, and program
KR20180136810A (en) Method and apparatus for detecting edge of image
JP2021154333A (en) Mesh preparation system for high accuracy forming analysis, mesh preparation method for high accuracy forming analysis and mesh preparation program for high accuracy forming analysis
JP2000132692A (en) Method for extracting feature point of curve and recording medium recording the method
CN106611405A (en) Image interpolation method and device
JP3589956B2 (en) Inter-image density smoothing method and recording medium recording inter-image density smoothing program
JPH1153562A (en) Device and method for generating time sequential data and editing curve, and storage medium with recorded program
JP7167756B2 (en) Image generation device, image generation program, and image generation method
EP1538547B1 (en) Method and device for extracting skeletal data from image data
JP5735395B2 (en) Image processing method, image processing apparatus, and image processing program
JP3887961B2 (en) Image association method, computer-readable storage medium for causing computer to execute image association method, and information processing apparatus
JP3655814B2 (en) Enlarged image generation apparatus and method
JP2780405B2 (en) Digital image processing equipment
JP2005316985A (en) Apparatus and method for enlarging image

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20030415