Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0778832B2 - Edge detection method - Google Patents
[go: Go Back, main page]

JPH0778832B2 - Edge detection method - Google Patents

Edge detection method

Info

Publication number
JPH0778832B2
JPH0778832B2 JP3050019A JP5001991A JPH0778832B2 JP H0778832 B2 JPH0778832 B2 JP H0778832B2 JP 3050019 A JP3050019 A JP 3050019A JP 5001991 A JP5001991 A JP 5001991A JP H0778832 B2 JPH0778832 B2 JP H0778832B2
Authority
JP
Japan
Prior art keywords
edge
line
pixels
straight line
binary 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.)
Expired - Lifetime
Application number
JP3050019A
Other languages
Japanese (ja)
Other versions
JPH04340177A (en
Inventor
倫生 大塚
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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works 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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP3050019A priority Critical patent/JPH0778832B2/en
Publication of JPH04340177A publication Critical patent/JPH04340177A/en
Publication of JPH0778832B2 publication Critical patent/JPH0778832B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Input (AREA)
  • Image Analysis (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、対象物と背景との濃度
差を利用し、所定の閾値を用いて2値化した2値画像に
基づいて対象物と背景との境界線であるエッジを検出す
るエッジ検出方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention utilizes an image density difference between an object and a background, and an edge which is a boundary line between the object and the background based on a binary image binarized using a predetermined threshold value. The present invention relates to an edge detection method for detecting the.

【0002】[0002]

【従来の技術】従来より、対象物と背景との境界線であ
るエッジを検出するエッジ検出方法としては、濃淡画像
の各画素についての微分値を求め、求めた微分値に基づ
いて2値化を行う閾値を補正する方法が特開昭64−7
9882号公報に開示されている。
2. Description of the Related Art Conventionally, as an edge detecting method for detecting an edge which is a boundary line between an object and a background, a differential value for each pixel of a grayscale image is obtained and binarized based on the obtained differential value. A method for correcting the threshold value for performing the above is disclosed in JP-A-64-7.
It is disclosed in Japanese Patent Publication No. 9882.

【0003】この方法は、対象物と背景との濃度差が小
さいときには微分値の最大値が小さくなり、濃度差が大
きいときには微分値の最大値も大きくなるという知見に
基づいている。すなわち、微分値の最大値が大きくなる
ほど2値化のための閾値を高く設定することによって、
対象物と背景との識別が容易になるような適正な2値画
像を得るようにしているのである。
This method is based on the knowledge that the maximum differential value is small when the density difference between the object and the background is small, and the maximum differential value is large when the density difference is large. That is, by setting the threshold for binarization higher as the maximum value of the differential value increases,
An appropriate binary image is obtained so that the object and the background can be easily distinguished.

【0004】[0004]

【発明が解決しようとする課題】上記方法では、対象物
と背景とのコントラストの大きさに応じて適正な閾値を
設定できるという利点がある。しかしながら、少なくと
もエッジを含む領域については、すべての画素について
微分値を求める必要があるから、各画素が多値である濃
淡画像に対して多量の演算を行う必要があり、演算量が
非常に多くなるという問題があった。
The above method has the advantage that an appropriate threshold value can be set according to the magnitude of the contrast between the object and the background. However, at least for the area including the edge, it is necessary to calculate the differential value for all pixels, and therefore it is necessary to perform a large amount of calculation on a grayscale image in which each pixel is multivalued, and the calculation amount is very large. There was a problem of becoming.

【0005】本発明は上記問題点の解決を目的とするも
のであり、2値画像に対する比較的少ない量の演算で2
値化のための適正な閾値が設定できるようにしたエッジ
検出方法を提供しようとするものである。
The present invention is intended to solve the above-mentioned problems, and requires a relatively small amount of calculation for a binary image.
It is intended to provide an edge detection method capable of setting an appropriate threshold value for binarization.

【0006】[0006]

【課題を解決するための手段】請求項1の発明では、上
記目的を達成するために、2値画像に基づいて対象物と
背景との境界線であるエッジを検出するエッジ検出方法
において、検出すべきエッジに直交する方向に並べたエ
ッジに沿う方向の複数本のライン上で白画素と黒画素と
のうちの着目した一方の画素について連接する個数を求
め、連接する個数が規定個数よりも少ない第1のライン
に隣接して規定個数以上になる第2のラインが存在し、
かつ第2のラインに対して第1のラインの反対側に規定
個数以上になる第3のラインが存在するときに第2のラ
インをエッジを含む候補になる直線として検出し、この
直線を挟んで一対のウインドウを設定し、各ウインドウ
に含まれる白画素または黒画素の画素数に基づいて上記
直線がエッジを含むかどうかを判定し、エッジを含まな
いと判定した場合には2値化を行う閾値を変化させて2
値画像を再度作成し、新たに作成された2値画像に対し
て上記処理を施すのである。また、請求項2の発明で
は、上記目的を達成するために、2値画像に基づいて対
象物と背景との境界線であるエッジを検出するエッジ検
出方法において、エッジを含む候補になる直線を検出し
た後、この直線を挟んで同個数の画素を含む同形状の一
対のウインドウを設定し、各ウインドウに含まれる白画
素または黒画素の画素数に基づいて対象物への照射光量
および対象物と背景とのコントラストを判定して照射光
量およびコントラストが十分であるときに上記直線がエ
ッジを含むと判定し、エッジを含まないと判定した場合
には2値化を行う閾値を変化させて2値画像を再度作成
し、新たに作成された2値画像に対して上記処理を施す
のである。
In [SUMMARY OF] of claim 1 the invention, in order to achieve the above object, the edge detection method for detecting an edge which is a boundary line between the object and the background based on the binary image, detecting Aligned in the direction orthogonal to the edge to be
White and black pixels on multiple lines along the edge
Find the number of concatenated one pixel of
Therefore, the first line where the number of concatenated pieces is less than the specified number
There is a second line adjacent to
And on the opposite side of the first line to the second line
When there is a third line whose number is equal to or larger than the number,
In is detected as a straight line that is a candidate including an edge, a pair of windows is set across this straight line, and whether or not the above straight line includes an edge is determined based on the number of white pixels or black pixels included in each window. If it is determined that the edge is not included, the threshold for binarization is changed to 2
A value image is created again, and the above-described processing is applied to the newly created binary image. In the invention of claim 2,
In order to achieve the above objective,
Edge detection that detects edges that are boundaries between elephants and the background
In the output method, the candidate straight line including the edge is detected.
Then, one line of the same shape containing the same number of pixels across this straight line
Set a pair of windows, and the white image included in each window
Amount of light emitted to the object based on the number of elementary or black pixels
And the irradiation light by judging the contrast between the object and the background
If the amount and contrast are sufficient, the straight line
Edge is not included and it is determined that edge is not included.
Change the threshold for binarization and recreate the binary image.
Then, the above processing is applied to the newly created binary image.
Of.

【0007】[0007]

【作用】請求項1の発明の方法によれば、検出すべきエ
ッジに直交する方向に並べたエッジに沿う方向の複数本
のライン上で白画素と黒画素とのうちの着目した一方の
画素について連接する個数を求め、連接する個数が規定
個数よりも少ない第1のラインに隣接して規定個数以上
になる第2のラインが存在し、かつ第2のラインに対し
て第1のラインの反対側に規定個数以上になる第3のラ
インが存在するときに第2のラインをエッジを含む候補
になる直線として検出することによって、微分演算を行
なうことなく白画素または黒画素の連接する個数を求め
るだけで、エッジの候補となる直線を求めることができ
るのである。すなわち、多値の濃淡画像のすべての画素
について微分演算を行なう場合に比較すると、エッジの
候補となる直線を求める処理に要する計算量が大幅に少
なくなるのである。しかも、2値画像においてエッジを
含む候補になる直線を検出した後、この直線の両側での
白画素または黒画素の分布を検出することによって、上
記直線がエッジを含むかどうかを判定しているのであっ
て、閾値が適正に設定されていて上記直線がエッジを含
む直線であれば、上記直線を挟んで白画素あるいは黒画
素の画素数に大きな差が生じることによって、上記直線
がエッジを含むかどうかが正確に判定できるのである。
また、エッジを含まないと判定された場合に、閾値を変
化させて2値画像を再度作成し、その後、上記処理を繰
り返すようにしているので、閾値が適正な値になるまで
閾値を変化させて適正な閾値に収束させることができる
のであり、2値画像に対する演算のみの比較的少ない演
算量で適正な閾値を求めることができることになる。
求項2の発明の方法によれば、エッジの候補になる直線
を挟んで同個数の画素を含む同形状の一対のウインドウ
を設定し、各ウインドウに含まれる白画素または黒画素
の画素数に基づいて対象物への照射光量および対象物と
背景とのコントラストを判定して照射光量およびコント
ラストが十分であるときに上記直線がエッジを含むと判
定することによって、エッジの候補となる直線を挟む同
形状のウインドウ内の同個数の画素のうちの着目する画
素(白画素または黒画素)の個数により、対象物への照
射光量および対象物と背景とのコントラストを判定する
ことができ、微分演算によらずに少ない演算量でエッジ
を含む直線を確定することができるのである。しかも、
エッジを含まないと判定した場合には2値化を行う閾値
を変化させて2値画像を再度作成し、新たに作成された
2値画像に対して上記処理を施すから、請求項1の発明
と同様に、適正な2値化を行なうことができる。
According to the method of the invention of claim 1 , the error to be detected
Multiple pieces along the edge arranged in the direction orthogonal to the edge
One of the white and black pixels on the line
Determine the number of concatenated pixels and specify the number of concatenated pixels
Adjacent to the first line that is less than the number
There is a second line that becomes and for the second line
On the opposite side of the first line, the
A candidate that contains an edge on the second line when the in exists
Differentiation is performed by detecting as a straight line
Find the number of connected white or black pixels without
You can obtain straight lines that are candidates for
It is. That is, every pixel in a multi-value grayscale image
Compared to the case of performing the differential operation on
Significantly less calculation is required to obtain candidate straight lines
It will disappear. Moreover, after detecting a straight line that is a candidate including an edge in a binary image, it is determined whether or not the straight line includes an edge by detecting the distribution of white pixels or black pixels on both sides of this straight line. Therefore, if the threshold value is properly set and the straight line includes an edge, the straight line includes an edge due to a large difference in the number of white pixels or black pixels across the straight line. Whether or not it can be accurately determined.
Further, when it is determined that the edge is not included, the threshold value is changed, the binary image is created again, and then the above process is repeated. Therefore, the threshold value is changed until the threshold value becomes an appropriate value. Therefore, the appropriate threshold value can be converged to an appropriate threshold value, and the appropriate threshold value can be obtained with a relatively small amount of calculation for only the binary image. Contract
According to the method of the invention of claim 2, straight lines that are candidates for edges
A pair of windows of the same shape that include the same number of pixels across
And set the white pixels or black pixels included in each window.
Based on the number of pixels of
The amount of irradiation light and
When the last is sufficient, the above straight line is determined to include an edge.
By inserting the straight line that is a candidate for the edge,
The image of interest among the same number of pixels in the shape window
Depending on the number of pixels (white pixels or black pixels), the target object is illuminated.
Determine the amount of light and the contrast between the object and the background
The edge can be calculated with a small amount of calculation without relying on the differential calculation.
It is possible to determine a straight line including. Moreover,
Threshold for binarization when it is determined that no edge is included
Is changed to create a binary image again, and a new image is created.
Since the above-mentioned processing is applied to the binary image, the invention of claim 1
In the same manner as above, proper binarization can be performed.

【0008】[0008]

【実施例】図2に示すように、対象物を含む画像は、C
CDカメラ等の画像入力装置1により撮像される。画像
入力装置1より出力されるアナログ信号である画像信号
は、A/D変換回路2を通してディジタル信号に変換さ
れた後、2値化処理部3において2値化されて2値画像
メモリ4に格納される。2値化処理部3における閾値は
閾値設定部5で設定される。
EXAMPLE As shown in FIG. 2, an image including an object is C
The image is captured by the image input device 1 such as a CD camera. An image signal which is an analog signal output from the image input device 1 is converted into a digital signal through an A / D conversion circuit 2 and then binarized by a binarization processing unit 3 and stored in a binary image memory 4. To be done. The threshold value in the binarization processing unit 3 is set by the threshold value setting unit 5.

【0009】本発明では、2値画像メモリ4に格納され
た2値画像に基づいて、2値化処理部3における適正な
閾値を設定するのであって、図1に示すように、まず対
象物と背景との境界線であるエッジを含む候補になる直
線(以下、エッジ候補と略称する)を検出する(ステッ
プ100、101)。すなわち、エッジ検出部6では、
2値画像メモリ4に格納された2値画像について、図3
に示すように、エッジを検出すべき領域としてあらかじ
めマスクMを設定しておき、マスクMの中の画素Pにつ
いてエッジ候補を検出する。たとえば、垂直方向のエッ
ジ候補を検出するには、水平方向に順次探索を行うので
あって、まず、マスクMの中の左端の垂直方向のライン
1 について上端から下向きに画素の値を順次判定す
る。ここに、白画素(白抜きの丸)の値を0、黒画素
(斜線付きの丸)の値を1とし、黒画素が3個以上連接
しているラインL1 〜L5 が2本以上連接しているとき
に(ここでは、ラインL3 、L4 が条件を満たす)、連
接しているラインL3 、L4の左端のラインL3 をエッ
ジ候補とする。水平方向のエッジ候補を検出するには、
垂直方向に順次探索を行えばよい。また、ここでは、対
象物の内側が黒画素になると考えているが、対象物の内
側が白画素になる場合には、白画素の連接によってエッ
ジ候補を検出すればよい。なお、マスクMの大きさ、画
素Pの連接個数、ラインL1 〜L5 の連接個数などは実
施例に限定されるものではない。
In the present invention, an appropriate threshold value is set in the binarization processing unit 3 based on the binary image stored in the binary image memory 4. As shown in FIG. A straight line (hereinafter, abbreviated as an edge candidate) that is a candidate including an edge that is a boundary line between the background and the background is detected (steps 100 and 101). That is, in the edge detection unit 6,
Regarding the binary image stored in the binary image memory 4, FIG.
As shown in, the mask M is set in advance as an area where an edge should be detected, and an edge candidate is detected for the pixel P in the mask M. For example, in order to detect the edge candidate in the vertical direction, a sequential search is performed in the horizontal direction. First, the pixel value of the leftmost vertical line L 1 in the mask M is sequentially determined from the upper end to the lower end. To do. Here, the value of the white pixel (open circle) is 0, the value of the black pixel (circle with diagonal lines) is 1, and there are two or more lines L 1 to L 5 connecting three or more black pixels. When connected (here, the lines L 3 and L 4 satisfy the condition), the leftmost line L 3 of the connected lines L 3 and L 4 is set as an edge candidate. To find horizontal edge candidates,
A sequential search may be performed in the vertical direction. Further, here, it is considered that the inside of the object becomes a black pixel, but when the inside of the object becomes a white pixel, the edge candidate may be detected by connecting the white pixels. The size of the mask M, the number of connected pixels P, the number of connected lines L 1 to L 5 , and the like are not limited to those in the embodiment.

【0010】以上のようにしてエッジ候補Eを検出した
後、計数部7では、図4に示すように、マスクMの中に
エッジ候補Eを挟んで一対のウインドウW1、W2 を設
定する。両ウインドウW1 、W2 は同形状であって同数
の画素Pを含むように設定され、各ウインドウW1、W
2 の中の白画素または黒画素の数がそれぞれ計数される
(図1のステップ102)。たとえば、対象物の内側が
黒画素になる場合に、各ウインドウW1 、W2 の中の黒
画素の個数を計数すれば、エッジ候補Eに対して対象物
側の黒画素の数は背景側の黒画素の数よりも大幅に多く
なるから、両ウインドウW1 、W2 の中の黒画素の個数
の差や比を求めれば、エッジ候補Eが真のエッジである
かどうかの判定が行えることになる。
After detecting the edge candidate E as described above, the counter 7 sets a pair of windows W 1 and W 2 with the edge candidate E sandwiched in the mask M, as shown in FIG. . Both windows W 1, W 2 is set to include the same number of pixels P a same shape, each window W 1, W
The number of white pixels or black pixels in the 2 are counted respectively (step 102 in FIG. 1). For example, when the number of black pixels in each of the windows W 1 and W 2 is counted when the inside of the object is a black pixel, the number of black pixels on the object side with respect to the edge candidate E is the number of black pixels on the background side. Since the number of black pixels is significantly larger than the number of black pixels, the difference or ratio of the number of black pixels in both windows W 1 and W 2 can be determined to determine whether the edge candidate E is a true edge. It will be.

【0011】すなわち、判定部8は、計数部7において
計数された各ウインドウW1 、W2 の中の黒画素または
白画素の個数の差または比を所定の基準値と比較し、基
準値との大小関係に基づいてエッジ候補Eが真のエッジ
であるかどうかの判定を行うのである。ここに、ウイン
ドウW1 、W2 の中の各黒画素の個数をw1、w2と
し、2種類の基準値α、βを設定する。図1のステップ
103、104に示すように、w2≧αであれば光量は
十分であるものと判断し、w2−w1≧βであれば、コ
ントラストも大きいから検出したエッジ候補Eは真のエ
ッジであると判定する(ステップ105)。一方、w2
<αであれば、光量が不足しているものと判断して2値
化のための閾値を下げるように閾値設定部5を制御する
ことによって(ステップ106)、2値化処理部3の閾
値を変更し、撮像を再度行って上記処理を繰り返す。ま
た、w2≧αが成立しても、w2−w1<βであれば、
光量が多すぎるものと判断して閾値を上げるように閾値
設定部5を制御し(ステップ107)、撮像を再度行っ
て上記処理を繰り返す。ここに、2値化処理部3の閾値
は所定幅で多段階に設定され、閾値の上下は1段階ずつ
行われる。
That is, the judging section 8 compares the difference or ratio of the number of black pixels or white pixels in each of the windows W 1 and W 2 counted by the counting section 7 with a predetermined reference value, and compares it with the reference value. It is determined whether or not the edge candidate E is a true edge based on the magnitude relationship. Here, the numbers of black pixels in the windows W 1 and W 2 are w1 and w2, and two types of reference values α and β are set. As shown in steps 103 and 104 of FIG. 1, if w2 ≧ α, it is determined that the light amount is sufficient, and if w2-w1 ≧ β, the detected edge candidate E is a true edge because the contrast is large. Is determined (step 105). On the other hand, w2
If <α, it is determined that the light amount is insufficient, and the threshold value setting unit 5 is controlled so as to lower the threshold value for binarization (step 106). Is changed, imaging is performed again, and the above processing is repeated. Even if w2 ≧ α holds, if w2-w1 <β,
The threshold value setting unit 5 is controlled so as to increase the threshold value when it is determined that the light amount is too large (step 107), the imaging is performed again, and the above processing is repeated. Here, the threshold value of the binarization processing unit 3 is set in multiple steps within a predetermined width, and the threshold value is raised or lowered step by step.

【0012】なお、上記実施例では閾値を変更したとき
に、画像入力装置1による撮像を再度行っているが、撮
像した画像を濃淡画像メモリに格納しておき、閾値を変
更したときに、濃淡画像メモリに格納した濃淡画像に対
して2値化を施すようにしてもよい。また、2値化処理
部3、閾値設定部5、エッジ検出部6、計数部7、判定
部8はマイクロコンピュータを用いれば容易に実現でき
るものである。
In the above embodiment, when the threshold value is changed, the image input device 1 performs image pickup again. However, the picked-up image is stored in the grayscale image memory and the grayscale value is changed when the threshold value is changed. The grayscale image stored in the image memory may be binarized. Further, the binarization processing unit 3, the threshold setting unit 5, the edge detection unit 6, the counting unit 7, and the determination unit 8 can be easily realized by using a microcomputer.

【0013】[0013]

【発明の効果】請求項1の発明は、検出すべきエッジに
直交する方向に並べたエッジに沿う方向の複数本のライ
ン上で白画素と黒画素とのうちの着目した一方の画素に
ついて連接する個数を求め、連接する個数が規定個数よ
りも少ない第1のラインに隣接して規定個数以上になる
第2のラインが存在し、かつ第2のラインに対して第1
のラインの反対側に規定個数以上になる第3のラインが
存在するときに第2のラインをエッジを含む候補になる
直線として検出するので、微分演算を行なうことなく白
画素または黒画素の連接する個数を求めるだけで、エッ
ジの候補となる直線を求めることができ、結果的に、多
値の濃淡画像のすべての画素について微分演算を行なう
場合に比較すると、エッジの候補となる直線を求める処
理に要する計算量が大幅に少なくなるという利点を有す
る。しかも、2値画像においてエッジを含む候補になる
直線を検出した後、この直線の両側での白画素または黒
画素の分布を検出することによって、上記直線がエッジ
を含むかどうかを判定しているのであって、閾値が適正
に設定されていて上記直線がエッジを含む直線であれ
ば、上記直線を挟んで白画素あるいは黒画素の画素数に
大きな差が生じることによって、上記直線がエッジを含
むかどうかが正確に判定できるのである。また、エッジ
を含まないと判定された場合に、閾値を変化させて2値
画像を再度作成し、その後、上記処理を繰り返すように
しているので、閾値が適正な値になるまで閾値を変化さ
せて適正な閾値に収束させることができるのであり、2
値画像に対する演算のみの比較的少ない演算量で適正な
閾値を求めることができるという利点を有するのであ
る。すなわち、エッジの周辺の光量を判定して、環境の
変化によるコントラストの変動に対する閾値の補正を行
うことができるのであって、適正な閾値で2値化された
2値画像に基づいてエッジを正確に検出できるという利
点がある。 請求項2の発明は、エッジの候補になる直線
を挟んで同個数の画素を含む同形状の一対のウインドウ
を設定し、各ウインドウに含まれる白画素または黒画素
の画素数に基づいて対象物への照射光量および対象物と
背景とのコントラストを判定して照射光量およびコント
ラストが十分であるときに上記直線がエッジを含む と判
定するので、エッジの候補となる直線を挟む同形状のウ
インドウ内の同個数の画素のうちの着目する画素の個数
により、対象物への照射光量および対象物と背景とのコ
ントラストを判定することができ、微分演算によらずに
少ない演算量でエッジを含む直線を確定することができ
るという利点を有する。しかも、エッジを含まないと判
定した場合には2値化を行う閾値を変化させて2値画像
を再度作成し、新たに作成された2値画像に対して上記
処理を施すから、請求項1の発明と同様に、適正な2値
化を行なうことができるのである。
According to the invention of claim 1, an edge to be detected is detected.
Multiple lines in the direction along the edges arranged in the orthogonal direction
One of the white and black pixels
Then find the number of concatenated pieces, and the number of concatenated pieces is
Adjacent to the first line, which is less
There is a second line and the first to the second line
There is a third line on the opposite side of
Second line becomes a candidate including edge when present
Since it is detected as a straight line, white
Simply find the number of contiguous pixels or black pixels
A straight line that is a candidate for
Differentiate all pixels in the grayscale image
Compared with the case, the process of finding the straight line that is a candidate for the edge
It has the advantage of significantly reducing the amount of calculation required
It Moreover, after detecting a straight line that is a candidate including an edge in a binary image, it is determined whether or not the straight line includes an edge by detecting the distribution of white pixels or black pixels on both sides of this straight line. Therefore, if the threshold value is properly set and the straight line includes an edge, the straight line includes an edge due to a large difference in the number of white pixels or black pixels across the straight line. Whether or not it can be accurately determined. Further, when it is determined that the edge is not included, the threshold value is changed, the binary image is created again, and then the above process is repeated. Therefore, the threshold value is changed until the threshold value becomes an appropriate value. Can be made to converge to an appropriate threshold value.
This has an advantage that an appropriate threshold value can be obtained with a relatively small amount of calculation of only the value image. That is, the amount of light around the edge can be determined, and the threshold value can be corrected with respect to the change in contrast due to the change in the environment. interest that can be detected
There is a point. The invention of claim 2 is a straight line which is a candidate for an edge.
A pair of windows of the same shape that include the same number of pixels across
And set the white pixels or black pixels included in each window.
Based on the number of pixels of
The amount of irradiation light and
Determine if the straight line including the edge when the last is sufficient
Since the same shape is inserted between straight lines that are candidates for edges,
Number of pixels of interest among the same number of pixels in the window
Depending on the amount of light illuminating the object and the
It is possible to determine the trust, without relying on the differential operation.
It is possible to determine straight lines including edges with a small amount of calculation.
Has the advantage of Moreover, it is determined that the edge is not included.
If it is set, the binary image is changed by changing the threshold value for binarization.
Again for the newly created binary image
Since the processing is performed, an appropriate binary value is obtained as in the first aspect of the invention.
It can be transformed.

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

【図1】実施例の動作説明図である。FIG. 1 is an explanatory diagram of an operation of an embodiment.

【図2】実施例のブロック図である。FIG. 2 is a block diagram of an embodiment.

【図3】実施例のエッジ検出部に関する動作説明図であ
る。
FIG. 3 is an operation explanatory diagram relating to the edge detection unit of the embodiment.

【図4】実施例の計数部に関する動作説明図である。FIG. 4 is an operation explanatory diagram of a counting unit according to the embodiment.

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

1 画像入力装置 2 A/D変換回路 3 2値化処理部 4 2値画像メモリ 5 閾値設定部 6 エッジ検出部 7 計数部 8 判定部 1 Image Input Device 2 A / D Conversion Circuit 3 Binarization Processing Unit 4 Binary Image Memory 5 Threshold Setting Unit 6 Edge Detection Unit 7 Counting Unit 8 Judgment Unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 2値画像に基づいて対象物と背景との境
界線であるエッジを検出するエッジ検出方法において、
検出すべきエッジに直交する方向に並べたエッジに沿う
方向の複数本のライン上で白画素と黒画素とのうちの着
目した一方の画素について連接する個数を求め、連接す
る個数が規定個数よりも少ない第1のラインに隣接して
規定個数以上になる第2のラインが存在し、かつ第2の
ラインに対して第1のラインの反対側に規定個数以上に
なる第3のラインが存在するときに第2のラインをエッ
ジを含む候補になる直線として検出し、この直線を挟ん
で一対のウインドウを設定し、各ウインドウに含まれる
白画素または黒画素の画素数に基づいて上記直線がエッ
ジを含むかどうかを判定し、エッジを含まないと判定し
た場合には2値化を行う閾値を変化させて2値画像を再
度作成し、新たに作成された2値画像に対して上記処理
を施すことを特徴とするエッジ検出方法。
1. An edge detection method for detecting an edge which is a boundary line between an object and a background based on a binary image,
Along the edges arranged in the direction orthogonal to the edge to be detected
Of white pixels and black pixels on multiple lines in the same direction
Find the number of concatenated one of the viewed pixels and connect
Adjacent to the first line where the number of
There is a second line that exceeds the specified number, and the second line
More than the specified number on the opposite side of the first line to the line
When the second line is present, the second line is detected as a straight line that is a candidate including an edge, and a pair of windows is set with the straight line sandwiched between the white line and the white pixel included in each window. Alternatively, it is determined whether or not the straight line includes an edge based on the number of black pixels, and if it is determined that the straight line does not include an edge, the threshold for binarization is changed to recreate a binary image, and a new image is created. An edge detecting method, characterized in that the above-mentioned processing is performed on the binary image created in (1).
【請求項2】 2値画像に基づいて対象物と背景との境2. A boundary between an object and a background based on a binary image.
界線であるエッジを検出するエッジ検出方法において、In the edge detection method for detecting edges that are field lines,
エッジを含む候補になる直線を検出した後、この直線をAfter detecting a straight line that is a candidate including edges,
挟んで同個数の画素を含む同形状の一対のウインドウをA pair of windows of the same shape containing the same number of pixels sandwiched between
設定し、各ウインドウに含まれる白画素または黒画素のSet the white pixel or black pixel included in each window.
画素数に基づいて対象物への照射光量および対象物と背Based on the number of pixels, the amount of light emitted to the object and the object and spine
景とのコントラストを判定して照射光量およびコントラThe contrast with the scene is determined to determine the irradiation light amount and contrast.
ストが十分であるときに上記直線がエッジを含むと判定It is determined that the above straight line includes an edge when the strike is sufficient.
し、エッジを含まないと判定した場合には2値化を行うHowever, if it is determined that the edge is not included, binarization is performed.
閾値を変化させて2値画像を再度作成し、新たに作成さCreate a new binary image by changing the threshold and creating a new one.
れた2値画像に対して上記処理を施すことを特徴とするIt is characterized in that the above-mentioned processing is applied to the extracted binary image.
エッジ検出方法。Edge detection method.
JP3050019A 1991-03-15 1991-03-15 Edge detection method Expired - Lifetime JPH0778832B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3050019A JPH0778832B2 (en) 1991-03-15 1991-03-15 Edge detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3050019A JPH0778832B2 (en) 1991-03-15 1991-03-15 Edge detection method

Publications (2)

Publication Number Publication Date
JPH04340177A JPH04340177A (en) 1992-11-26
JPH0778832B2 true JPH0778832B2 (en) 1995-08-23

Family

ID=12847287

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3050019A Expired - Lifetime JPH0778832B2 (en) 1991-03-15 1991-03-15 Edge detection method

Country Status (1)

Country Link
JP (1) JPH0778832B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113538600A (en) * 2020-04-15 2021-10-22 毫末智行科技有限公司 Method and apparatus for determining the baseline of a target, ranging method and apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS619769A (en) * 1984-06-25 1986-01-17 Matsushita Electric Works Ltd Picture image processor
JPH07120418B2 (en) * 1986-08-14 1995-12-20 東芝精機株式会社 Pattern recognition method

Also Published As

Publication number Publication date
JPH04340177A (en) 1992-11-26

Similar Documents

Publication Publication Date Title
US20030123726A1 (en) Scene change detection apparatus
US4896364A (en) Method of detecting boundary structures in a video signal
US20020044607A1 (en) Image processing apparatus and method
JP4243454B2 (en) Brightness correction method, selective defect detection method, and recording medium on which these are recorded
US6798422B2 (en) Method and filtering system for filtering edge directions
JP2003092707A (en) Sensor device that detects and corrects bad pixels
JP4230880B2 (en) Defect inspection method
US7800661B2 (en) Programmable pattern matching device
EP0499875B1 (en) Method of and apparatus for obtaining binary image
JPH0778832B2 (en) Edge detection method
US20100079629A1 (en) Apparatus and method for correcting defective pixel
JPH07107275A (en) Image data discrimination device
JP2000101924A (en) Defect detection correction device in image input device
JP2002330354A (en) Defective pixel detection and correction device, defective pixel detection and correction method, defective pixel detection and correction program, and video signal processing device
JP3453939B2 (en) Image processing device
JP2859603B2 (en) Method and apparatus for binarizing image data
JP3109237B2 (en) Line segment constituent pixel extraction method and line segment judgment method in image
JP2628863B2 (en) Visual recognition device
JPS63131281A (en) Automatic number plate recognizer
JPH05344330A (en) Picture area discriminating device
JPH05172535A (en) Peak point detection method and calibration method
JP2853141B2 (en) Image area identification device
JP3381251B2 (en) Image contour pattern detection circuit and method
JP2590463B2 (en) Number plate automatic recognition device
JPH06245149A (en) Pixel defect correction device

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19960227