CN111127498A - Canny edge detection method based on edge self-growth - Google Patents

Canny edge detection method based on edge self-growth Download PDF

Info

Publication number
CN111127498A
CN111127498A CN201911275163.XA CN201911275163A CN111127498A CN 111127498 A CN111127498 A CN 111127498A CN 201911275163 A CN201911275163 A CN 201911275163A CN 111127498 A CN111127498 A CN 111127498A
Authority
CN
China
Prior art keywords
edge
value
point
image
gradient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911275163.XA
Other languages
Chinese (zh)
Other versions
CN111127498B (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.)
Chongqing University of Post and Telecommunications
Original Assignee
Chongqing University of Post and Telecommunications
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 Chongqing University of Post and Telecommunications filed Critical Chongqing University of Post and Telecommunications
Priority to CN201911275163.XA priority Critical patent/CN111127498B/en
Publication of CN111127498A publication Critical patent/CN111127498A/en
Application granted granted Critical
Publication of CN111127498B publication Critical patent/CN111127498B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a Canny edge detection method based on edge self-growth, and belongs to the field of computers. The method comprises the following steps: 1) carrying out smooth filtering processing on the image, and removing noise by Gaussian filtering; 2) calculating gradient amplitudes and directions of the image in four directions by using an eight-neighborhood operator, and synthesizing the gradient amplitudes and the directions into a horizontal vertical direction by using a coordinate projection mode; 3) carrying out non-maximum suppression calculation on the edge by utilizing the gradient direction to suppress non-edge points; 4) calculating a high-low threshold value by using otsu; 5) preliminarily obtaining edges by utilizing the high and low threshold values; 6) and (5) performing fracture edge completion by using a self-growing algorithm to obtain a final edge image. The algorithm of the invention not only can obviously complement the defective edge to obtain a more complete edge, but also can be applied to other edge detection operators, and has stronger practicability.

Description

Canny edge detection method based on edge self-growth
Technical Field
The invention belongs to the field of computers, and relates to a Canny edge detection method based on edge self-growth.
Background
Edge detection is a fundamental problem in image processing and computer vision, and the purpose of edge detection is to identify points in a digital image where brightness changes are significant. The image edge detection greatly reduces the data volume, eliminates information which can be considered irrelevant, retains important structural attributes of the image, and has important influence on subsequent researches such as feature extraction, description, target identification and the like. Because the gray level on the edge changes smoothly and the gray level on both sides of the edge changes rapidly, the edge of the image generally refers to a partially discontinuous image feature, the edge is the most significant part of the change, and the change of the gray level value, the abrupt change of the color component and the abrupt change of the texture structure can form edge information. In general, the gray scale change of an image can be represented by a gradient, a first order differential operator and a second order differential operator are commonly used to describe the gradient, and then the detected gradient is cut off by a thresholding method. The operator algorithms are simple and have good real-time performance, but are easily influenced by noise and threshold value selection to generate the phenomena of false edges and edge disconnection, so that the edge positioning precision is influenced.
The conventional canny algorithm mainly has the following problems:
1) the traditional edge detection operator only detects the horizontal direction and the vertical direction, and lacks of detecting the edge in the diagonal direction;
2) the threshold value is set by experience, and the self-adaptive capacity is poor;
3) the detected edge is broken, so that the edge image is incomplete.
Disclosure of Invention
In view of the above, the present invention provides a Canny edge detection method based on edge self-growth.
In order to achieve the purpose, the invention provides the following technical scheme:
a Canny edge detection method based on edge self-growth, the method comprising the steps of:
1) carrying out smooth filtering on the image, and removing noise by Gaussian filtering;
2) calculating gradient amplitudes of gray values by using operators of 0 degrees, 45 degrees, 90 degrees and 135 degrees, synthesizing the gradient amplitudes calculated by the operators of 45 degrees and 135 degrees to 0 degrees and 90 degrees by using coordinate axis projection, and then calculating gradient directions;
3) carrying out non-maximum suppression calculation on gradient values vertical to the gradient direction, comparing the gradient values with two adjacent gradient values, if the gradient values are maximum values, considering that an image point is a possible edge, and keeping the value, otherwise, considering that the image point is not an edge, and directly taking 0;
4) solving the maximum value of the inter-class variance by using an OTSU algorithm to serve as a high threshold, and taking one half of the high threshold as a low threshold;
5) binarizing the gradient by using a high-low threshold value to obtain a primary binarized edge image;
6) and (5) performing fracture edge completion by using a self-growing algorithm to obtain a final edge image.
Optionally, the step 1) specifically includes:
filtering the original gray image by using a two-dimensional Gaussian filter, wherein the Gaussian filter function is expressed as follows
Figure BDA0002315356880000021
Obtaining a filtered image g (x, y) by convolving the original image f (x, y) with a gaussian filter, and the process is expressed as:
g(x,y)=f(x,y)*H(x,y) (2)
in the actual digital image processing, when the value of sigma is 1.4 and the Gaussian template is 5 multiplied by 5, the Gaussian kernel function is
Figure BDA0002315356880000022
Optionally, the step 2) specifically includes:
and respectively calculating gradient values of all directions by utilizing convolution kernels, wherein a specific calculation formula is as follows:
Figure BDA0002315356880000023
Figure BDA0002315356880000024
Figure BDA0002315356880000025
Figure BDA0002315356880000026
after obtaining the gradient values in 4 directions, synthesizing the gradient in two horizontal and vertical directions by using the coordinate projection principle, wherein the calculation method is as follows:
Figure BDA0002315356880000031
Figure BDA0002315356880000032
calculating the gradient amplitude G (x, y) and the gradient angle theta (x, y) of the gray value of the current pixel point as follows:
Figure BDA0002315356880000033
θ(x,y)=arctan[GY(x,y)/GX(x,y)](11)。
optionally, in step 3):
for a point (x, y) on the gradient magnitude image, a 3 × 3 matrix is formed with its surrounding pixels, and the matrix has a value of
Figure BDA0002315356880000034
The conditions for determining whether the point is a possible edge point are as follows:
Figure BDA0002315356880000035
when w (x, y) satisfies the above condition, the value is a maximum value, the value is retained, and when the condition is not satisfied, the value is directly set to zero, and the suppression of the non-maximum value is completed, so that a new gradient matrix G' is obtained.
Optionally, in step 4):
the gray value of a certain point in the gray image with the size of m × n is f (x, y), the value range is [0, L ], and the probability of the occurrence of the pixel point with the gray value of k is shown as the formula (14)
Figure BDA0002315356880000036
Setting the threshold value as T (0 < T < L-1), dividing the image into two parts, the proportion of the first part in the whole image is
Figure BDA0002315356880000041
The second portion accounts for the whole image in a proportion of
Figure BDA0002315356880000042
The mean value of the gray levels of the first part is
Figure BDA0002315356880000043
The mean value of the gray levels of the second part is
Figure BDA0002315356880000044
Average value of gray scale of the whole image
μ=ω0(T)μ0(T)+ω1(T)μ1(T) (19)
Between the two parts the between-class variance is
Figure BDA0002315356880000045
All values of T are subjected to inter-class variance calculation, so that the T value when the inter-class variance g (T) is taken as the maximum value is the optimal threshold value, namely the high threshold value T of the canny algorithm is calculatedhT, low threshold Tl=0.5T。
Optionally, in step 5):
for any point G '(x, y) in the gradient matrix G', 1 is directly taken when the value is larger than the high threshold value, and 0 is directly taken when the value is smaller than the low threshold value, namely
Figure BDA0002315356880000046
When G' (x, y) takes on values between high and low thresholds
Figure BDA0002315356880000047
Optionally, the step 6) specifically includes:
a. global scanning and scanning to judge a breaking point;
traversing the whole image of the binary edge image T by using a window w with the size of 3 multiplied by 3, wherein
Figure BDA0002315356880000051
The traversal mode is from left to right, and from top to bottom, the step is 1, the distribution of the edge breaking point pixels which may exist on the edge after the non-maximum suppression is as shown in fig. 4, and it can be known from the figure that when w (x, y) is equal to 1, it is determined whether the point is a breaking point;
when the sum of the matrices w(s) (w) is 2, the breaking point is directly determined;
when s (w) is 3, the determination conditions are:
Figure BDA0002315356880000052
wherein, S (w)2n) Is row 2, S (w) of the matrix wn1)、S(wn3) Columns 1 and 3 and S (w) of the matrix w, respectivelyn2) Is composed ofColumn 2 of matrix w and, S (w)1n)、S(w3n) Row 1 and row 3 of the matrix w, respectively; judging as a breaking point when the above conditions are satisfied;
when the w matrix satisfies the breaking point judgment condition at this time, a breaking point a (x) existsa,yb) Entering step b; otherwise, moving the window, re-valuing w, continuing to judge in the step a until the traversal of the whole window is completed, and entering the step d;
b. setting a radius to search for another breaking point;
because the traversal sequence of the window w is from top to bottom, the search for the upper part of another breaking point around the breaking point is not needed; the searching mode is similar to the step a, the window is still used for traversing to obtain a matrix w', when the searching radius is 15, the traversing line range of the window is [ x ]a,xa+15]Column range of [ ya-15,ya+15]When w' meeting the judgment condition in the step a exists in the range, namely another breaking point exists, searching all break points in the range, comparing the distances between the break points and the point a, and selecting the minimum distance b (x)b,yb) W (x ', y'), proceed to step c; otherwise, returning to the step a and moving the window if another breaking point does not exist;
c. self-growing the edges;
for both ends of the fracture, i.e. a (x)a,yb)、b(xb,yb) Connecting the two points in the shortest distance; firstly, the difference value of row and column values of a point and a point b is calculated
Figure BDA0002315356880000053
Knowing x by traversalabIs more than or equal to 0, when yabWhen the value is more than or equal to 0, the point b is positioned at the right of the point a, and then x is comparedab、yabValue of (a), if xab≥yabThen give an order
Figure BDA0002315356880000061
If xab<yabThen give an order
Figure BDA0002315356880000062
When y isabWhen < 0, point b is located to the left of point a, compare xab、yabValue of (a), if xab≥|yabI, then order
Figure BDA0002315356880000064
If xab<|yabI, then order
Figure BDA0002315356880000063
If so, returning to the step a and moving the window after the growth is finished;
d. complete growth and output
Entering this step indicates that the fracture edge has been repaired by self-growth, and the binary matrix T is the final edge image.
The invention has the beneficial effects that: the method can improve the calculation direction of the gradient, can adaptively determine the threshold value of edge binarization, can perform self-growth completion on the fracture edge, and can effectively improve the edge integrity.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Drawings
For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flowchart of the overall algorithm;
FIG. 2 is an edge detection operator; FIGS. 2(a) to (d) are convolution kernels of respective directional operators of 0 °, 45 °, 90 ° and 135 °, respectively;
FIG. 3 is a flow chart of an edge self-growing algorithm;
FIG. 4 is a possible breakpoint pixel distribution.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.
Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.
With reference to fig. 1, the present invention provides a Canny edge detection algorithm based on edge self-growth, which includes the following steps:
1) and (3) performing smooth filtering on the image, and removing noise by using Gaussian filtering:
the original gray level image is filtered by using a two-dimensional Gaussian filter, the Gaussian filter is very effective to Gaussian noise which obeys normal distribution, but the excessive Gaussian template generates a smoothing effect on the image, so that the edge boundary is gradually blurred, and the Gaussian template with a proper size needs to be selected.
The Gaussian filter function is expressed as follows
Figure BDA0002315356880000071
Obtaining a filtered image g (x, y) by convolving the original image f (x, y) with a gaussian filter, and the process is expressed as:
g(x,y)=f(x,y)*H(x,y) (2)
in the actual digital image processing, when the value of sigma is 1.4 and the Gaussian template is 5 multiplied by 5, the Gaussian kernel function is
Figure BDA0002315356880000081
2) Calculating gradient amplitudes of gray values by using operators of 0 degrees, 45 degrees, 90 degrees and 135 degrees, synthesizing the gradient amplitudes calculated by the operators of 45 degrees and 135 degrees to 0 degrees and 90 degrees by using coordinate axis projection, and then calculating gradient directions:
as shown in fig. 2(a) to (d), which are convolution kernels of 0 ° to 135 ° directional operators, gradient values in respective directions are calculated by the convolution kernels, respectively, and the specific calculation formula is as follows:
Figure BDA0002315356880000082
Figure BDA0002315356880000083
Figure BDA0002315356880000084
Figure BDA0002315356880000085
after obtaining the gradient values in 4 directions, the gradient can be synthesized in two horizontal and vertical directions by using the coordinate projection principle, and the calculation method is as follows:
Figure BDA0002315356880000086
Figure BDA0002315356880000087
therefore, the gradient amplitude G (x, y) and the gradient angle theta (x, y) of the gray value of the current pixel point can be calculated as follows:
Figure BDA0002315356880000088
Figure BDA0002315356880000089
3) and performing non-maximum suppression calculation on gradient values perpendicular to the gradient direction, comparing the value with two adjacent gradient values, if the value is a maximum value, considering the point as a possible edge, and keeping the value, otherwise, considering the value not as an edge, and directly taking 0:
for a point (x, y) on the gradient magnitude image, a 3 × 3 matrix may be formed with its surrounding pixels, and the matrix has a value of
Figure BDA0002315356880000091
The conditions for determining whether the point is a possible edge point are as follows:
Figure BDA0002315356880000092
when w (x, y) satisfies the above condition, the value is a maximum value, the value is retained, and when the condition is not satisfied, the value is directly set to zero, and the suppression of the non-maximum value is completed, so that a new gradient matrix G' is obtained.
4) And (3) solving the maximum value of the inter-class variance by using an OTSU algorithm to serve as a high threshold, wherein the low threshold is one half of the high threshold:
the gray value of a certain point in the gray image with the size of m × n is f (x, y), the value range is [0, L ], and the probability of the occurrence of the pixel point with the gray value of k is shown as the formula (14)
Figure BDA0002315356880000093
Setting the threshold value as T (0 < T < L-1), dividing the image into two parts, the proportion of the first part in the whole image is
Figure BDA0002315356880000094
The second portion accounts for the whole image in a proportion of
Figure BDA0002315356880000095
The mean value of the gray levels of the first part is
Figure BDA0002315356880000096
The mean value of the gray levels of the second part is
Figure BDA0002315356880000101
Average value of gray scale of the whole image
μ=ω0(T)μ0(T)+ω1(T)μ1(T) (19)
Between the two parts the between-class variance is
Figure BDA0002315356880000102
All values of T are subjected to inter-class variance calculation, so that the T value when the inter-class variance g (T) is taken as the maximum value is the optimal threshold value, namely the high threshold value T of the canny algorithm is calculatedhT, low threshold Tl=0.5T。
5) And (3) carrying out binarization on the gradient by using a height threshold value to obtain a preliminary binarization edge image:
for any point G '(x, y) in the gradient matrix G', 1 is directly taken when the value is larger than the high threshold value, and 0 is directly taken when the value is smaller than the low threshold value, namely
Figure BDA0002315356880000103
When G' (x, y) takes on values between high and low thresholds
Figure BDA0002315356880000104
6) And (3) utilizing a self-growing algorithm to perform fracture edge completion to obtain a final edge image:
the edge self-growing algorithm flow is shown in fig. 3, and the specific steps are as follows:
a. global scanning and scanning to judge a breaking point;
traversing the whole image of the binary edge image T by using a window w with the size of 3 multiplied by 3, wherein
Figure BDA0002315356880000105
The traversal pattern is from left to right, and from top to bottom, the step is 1, the distribution of the edge breaking point pixels which may exist in the edge after the non-maximum suppression is as shown in fig. 4, and it can be seen from the figure that when w (x, y) is equal to 1, it is determined whether the point is a breaking point.
When the sum of the matrices w(s) (w) is 2, the breaking point is directly determined;
when s (w) is 3, the determination conditions are:
Figure BDA0002315356880000111
wherein, S (w)2n) Is row 2, S (w) of the matrix wn1)、S(wn3) Columns 1 and 3 and S (w) of the matrix w, respectivelyn2) Is the 2 nd column sum, S (w) of the matrix w1n)、S(w3n) Respectively row 1 and row 3 of the matrix w. When the above condition is satisfied, the point is determined as a breaking point.
When the w matrix satisfies the breaking point judgment condition at this time, a breaking point a (x) existsa,yb) Entering step b; otherwise, moving the window, re-valuing w, continuing to judge in the step a until the traversal of the whole window is completed, and entering the step d.
b. Setting a radius to search for another breaking point;
because the window w is traversed from top to bottom, searching for another breakpoint around the breakpoint may not be performed above the breakpoint. The searching mode is similar to the step a, the window is still used for traversing to obtain a matrix w', when the searching radius is 15, the traversing line range of the window is [ x ]a,xa+15]Column range of [ ya-15,ya+15]When w' meeting the judgment condition in the step a exists in the range, namely another breaking point exists, searching all break points in the range, comparing the distances between the break points and the point a, and selecting the minimum distance b (x)b,yb) W (x ', y'), proceed to step c; otherwise, another breaking point does not exist, the step a is returned and the window is moved.
c. The edge grows itself.
For both ends of the fracture, i.e. a (x)a,yb)、b(xb,yb) The two points are connected by the shortest distance. Firstly, the difference value of row and column values of a point and a point b is calculated
Figure BDA0002315356880000112
Knowing x by traversalabIs more than or equal to 0, when yabWhen the value is more than or equal to 0, the point b is positioned at the right of the point a, and then x is comparedab、yabValue of (a), if xab≥yabThen give an order
Figure BDA0002315356880000113
If xab<yabThen give an order
Figure BDA0002315356880000114
When y isabWhen < 0, point b is located to the left of point a, compare xab、yabValue of (a), if xab≥|yabI, then order
Figure BDA0002315356880000121
If xab<|yabI, then order
Figure BDA0002315356880000122
And returning to the step a and moving the window after the growth is finished.
d. Complete growth and output
Entering this step indicates that the fracture edge has been repaired by self-growth, and the binary matrix T is the final edge image.
Examples
Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.

Claims (7)

1. A Canny edge detection method based on edge self-growth is characterized in that: the method comprises the following steps:
1) carrying out smooth filtering on the image, and removing noise by Gaussian filtering;
2) calculating gradient amplitudes of gray values by using operators of 0 degrees, 45 degrees, 90 degrees and 135 degrees, synthesizing the gradient amplitudes calculated by the operators of 45 degrees and 135 degrees to 0 degrees and 90 degrees by using coordinate axis projection, and then calculating gradient directions;
3) carrying out non-maximum suppression calculation on gradient values vertical to the gradient direction, comparing the gradient values with two adjacent gradient values, if the gradient values are maximum values, considering that an image point is a possible edge, and keeping the value, otherwise, considering that the image point is not an edge, and directly taking 0;
4) solving the maximum value of the inter-class variance by using an OTSU algorithm to serve as a high threshold, and taking one half of the high threshold as a low threshold;
5) binarizing the gradient by using a high-low threshold value to obtain a primary binarized edge image;
6) and (5) performing fracture edge completion by using a self-growing algorithm to obtain a final edge image.
2. The Canny edge detection method based on edge self-growth according to claim 1, characterized in that: the step 1) is specifically as follows:
filtering the original gray image by using a two-dimensional Gaussian filter, wherein the Gaussian filter function is expressed as follows
Figure FDA0002315356870000011
Obtaining a filtered image g (x, y) by convolving the original image f (x, y) with a gaussian filter, and the process is expressed as:
g(x,y)=f(x,y)*H(x,y) (2)
in the actual digital image processing, when the value of sigma is 1.4 and the Gaussian template is 5 multiplied by 5, the Gaussian kernel function is
Figure FDA0002315356870000012
3. The Canny edge detection method based on edge self-growth according to claim 2, characterized in that: the step 2) is specifically as follows:
and respectively calculating gradient values of all directions by utilizing convolution kernels, wherein a specific calculation formula is as follows:
Figure FDA0002315356870000013
Figure FDA0002315356870000021
Figure FDA0002315356870000022
Figure FDA0002315356870000023
after obtaining the gradient values in 4 directions, synthesizing the gradient in two horizontal and vertical directions by using the coordinate projection principle, wherein the calculation method is as follows:
Figure FDA0002315356870000024
Figure FDA0002315356870000025
calculating the gradient amplitude G (x, y) and the gradient angle theta (x, y) of the gray value of the current pixel point as follows:
Figure FDA0002315356870000026
θ(x,y)=arctan[GY(x,y)/GX(x,y)](11)。
4. the Canny edge detection method based on edge self-growth according to claim 3, wherein: in the step 3):
for a point (x, y) on the gradient magnitude image, a 3 × 3 matrix is formed with its surrounding pixels, and the matrix has a value of
Figure FDA0002315356870000027
The conditions for determining whether the point is a possible edge point are as follows:
Figure FDA0002315356870000031
when w (x, y) satisfies the above condition, the value is a maximum value, the value is retained, and when the condition is not satisfied, the value is directly set to zero, and the suppression of the non-maximum value is completed, so that a new gradient matrix G' is obtained.
5. The Canny edge detection method based on edge self-growth according to claim 4, wherein: in the step 4):
the gray value of a certain point in the gray image with the size of m × n is f (x, y), the value range is [0, L ], and the probability of the occurrence of the pixel point with the gray value of k is shown as the formula (14)
Figure FDA0002315356870000032
Setting the threshold value as T (0 < T < L-1), dividing the image into two parts, the proportion of the first part in the whole image is
Figure FDA0002315356870000033
The second portion accounts for the whole image in a proportion of
Figure FDA0002315356870000034
The mean value of the gray levels of the first part is
Figure FDA0002315356870000035
The mean value of the gray levels of the second part is
Figure FDA0002315356870000036
Average value of gray scale of the whole image
μ=ω0(T)μ0(T)+ω1(T)μ1(T) (19)
Between the two parts the between-class variance is
Figure FDA0002315356870000037
All values of T are subjected to inter-class variance calculation, so that the T value when the inter-class variance g (T) is taken as the maximum value is the optimal threshold value, namely the high threshold value T of the canny algorithm is calculatedhT, low threshold Tl=0.5T。
6. The Canny edge detection method based on edge self-growth according to claim 5, wherein: in the step 5):
for any point G '(x, y) in the gradient matrix G', 1 is directly taken when the value is larger than the high threshold value, and 0 is directly taken when the value is smaller than the low threshold value, namely
Figure FDA0002315356870000041
When G' (x, y) takes on values between high and low thresholds
Figure FDA0002315356870000042
7. The Canny edge detection method based on edge self-growth according to claim 6, wherein: the step 6) is specifically as follows:
a. global scanning and scanning to judge a breaking point;
traversing the whole image of the binary edge image T by using a window w with the size of 3 multiplied by 3, wherein
Figure FDA0002315356870000043
The traversal mode is from left to right, and from top to bottom, the step is 1, the distribution of the edge breaking point pixels which may exist on the edge after the non-maximum suppression is as shown in fig. 4, and it can be known from the figure that when w (x, y) is equal to 1, it is determined whether the point is a breaking point;
when the sum of the matrices w(s) (w) is 2, the breaking point is directly determined;
when s (w) is 3, the determination conditions are:
Figure FDA0002315356870000044
wherein, S (w)2n) Is row 2, S (w) of the matrix wn1)、S(wn3) Columns 1 and 3 and S (w) of the matrix w, respectivelyn2) Is the 2 nd column sum, S (w) of the matrix w1n)、S(w3n) Row 1 and row 3 of the matrix w, respectively; judging as a breaking point when the above conditions are satisfied;
when the w matrix satisfies the breaking point judgment condition at this time, a breaking point a (x) existsa,yb) Entering step b; otherwise, moving the window, re-valuing w, continuing to judge in the step a until the traversal of the whole window is completed, and entering the step d;
b. setting a radius to search for another breaking point;
because the traversal sequence of the window w is from top to bottom, the search for the upper part of another breaking point around the breaking point is not needed; the searching mode is similar to the step a, the window is still used for traversing to obtain a matrix w', and the searching radius is 15When the window has a traversal range of [ x ]a,xa+15]Column range of [ ya-15,ya+15]When w' meeting the judgment condition in the step a exists in the range, namely another breaking point exists, searching all break points in the range, comparing the distances between the break points and the point a, and selecting the minimum distance b (x)b,yb) W (x ', y'), proceed to step c; otherwise, returning to the step a and moving the window if another breaking point does not exist;
c. self-growing the edges;
for both ends of the fracture, i.e. a (x)a,yb)、b(xb,yb) Connecting the two points in the shortest distance; firstly, the difference value of row and column values of a point and a point b is calculated
Figure FDA0002315356870000051
Knowing x by traversalabIs more than or equal to 0, when yabWhen the value is more than or equal to 0, the point b is positioned at the right of the point a, and then x is comparedab、yabValue of (a), if xab≥yabThen give an order
Figure FDA0002315356870000052
If xab<yabThen give an order
Figure FDA0002315356870000053
When y isabWhen < 0, point b is located to the left of point a, compare xab、yabValue of (a), if xab≥|yabI, then order
Figure FDA0002315356870000054
If xab<|yabI, then order
Figure FDA0002315356870000055
If so, returning to the step a and moving the window after the growth is finished;
d. complete growth and output
Entering this step indicates that the fracture edge has been repaired by self-growth, and the binary matrix T is the final edge image.
CN201911275163.XA 2019-12-12 2019-12-12 Canny edge detection method based on edge self-growth Active CN111127498B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911275163.XA CN111127498B (en) 2019-12-12 2019-12-12 Canny edge detection method based on edge self-growth

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911275163.XA CN111127498B (en) 2019-12-12 2019-12-12 Canny edge detection method based on edge self-growth

Publications (2)

Publication Number Publication Date
CN111127498A true CN111127498A (en) 2020-05-08
CN111127498B CN111127498B (en) 2023-07-25

Family

ID=70499942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911275163.XA Active CN111127498B (en) 2019-12-12 2019-12-12 Canny edge detection method based on edge self-growth

Country Status (1)

Country Link
CN (1) CN111127498B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112070792A (en) * 2020-08-25 2020-12-11 清华大学 Edge growth connection method and device for image segmentation
CN113627445A (en) * 2021-08-05 2021-11-09 福州大学 Formation planning system and method for multi-unmanned aerial vehicle aerial media
CN113870293A (en) * 2021-09-27 2021-12-31 东莞拓斯达技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN115131387A (en) * 2022-08-25 2022-09-30 山东鼎泰新能源有限公司 Gasoline engine spray wall collision parameter automatic extraction method and system based on image processing

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286233A (en) * 2008-05-19 2008-10-15 重庆邮电大学 Fuzzy edge detection method based on object cloud
CN102270299A (en) * 2011-08-24 2011-12-07 复旦大学 Edge connection algorithm realized in parallel based on breakpoints
US20150324998A1 (en) * 2014-05-06 2015-11-12 Nant Holdings Ip, Llc Image-based feature detection using edge vectors
CN105678760A (en) * 2016-01-04 2016-06-15 国家电网公司 Method for recognizing insulator image on the basis of Canny edge detection algorithm
CN106845495A (en) * 2016-12-30 2017-06-13 浙江工业大学 Broken curve method of closing in a kind of image
CN107220988A (en) * 2017-04-30 2017-09-29 南京理工大学 Based on the parts image edge extraction method for improving canny operators
CN108022233A (en) * 2016-10-28 2018-05-11 沈阳高精数控智能技术股份有限公司 A kind of edge of work extracting method based on modified Canny operators
CN108470343A (en) * 2017-02-23 2018-08-31 南宁市富久信息技术有限公司 A kind of improved method for detecting image edge
CN109325935A (en) * 2018-07-24 2019-02-12 国网浙江省电力有限公司杭州供电公司 A kind of transmission line faultlocating method based on unmanned plane image
CN109360217A (en) * 2018-09-29 2019-02-19 国电南瑞科技股份有限公司 Power transmission and transforming equipment method for detecting image edge, apparatus and system
CN109427066A (en) * 2017-08-31 2019-03-05 中国科学院微电子研究所 Edge detection method at any angle
CN110428433A (en) * 2019-07-02 2019-11-08 西华师范大学 A kind of Canny edge detection algorithm based on local threshold

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9836824B2 (en) * 2013-04-29 2017-12-05 Koninklijke Philips N.V. De-noised reconstructed image data edge improvement
US9934578B2 (en) * 2016-08-15 2018-04-03 Macau University Of Science And Technology Method for edge detection
CN107392930B (en) * 2017-08-07 2020-09-01 重庆邮电大学 Quantum Canny edge detection method
CN108109155A (en) * 2017-11-28 2018-06-01 东北林业大学 A kind of automatic threshold edge detection method based on improvement Canny

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286233A (en) * 2008-05-19 2008-10-15 重庆邮电大学 Fuzzy edge detection method based on object cloud
CN102270299A (en) * 2011-08-24 2011-12-07 复旦大学 Edge connection algorithm realized in parallel based on breakpoints
US20150324998A1 (en) * 2014-05-06 2015-11-12 Nant Holdings Ip, Llc Image-based feature detection using edge vectors
CN105678760A (en) * 2016-01-04 2016-06-15 国家电网公司 Method for recognizing insulator image on the basis of Canny edge detection algorithm
CN108022233A (en) * 2016-10-28 2018-05-11 沈阳高精数控智能技术股份有限公司 A kind of edge of work extracting method based on modified Canny operators
CN106845495A (en) * 2016-12-30 2017-06-13 浙江工业大学 Broken curve method of closing in a kind of image
CN108470343A (en) * 2017-02-23 2018-08-31 南宁市富久信息技术有限公司 A kind of improved method for detecting image edge
CN107220988A (en) * 2017-04-30 2017-09-29 南京理工大学 Based on the parts image edge extraction method for improving canny operators
CN109427066A (en) * 2017-08-31 2019-03-05 中国科学院微电子研究所 Edge detection method at any angle
CN109325935A (en) * 2018-07-24 2019-02-12 国网浙江省电力有限公司杭州供电公司 A kind of transmission line faultlocating method based on unmanned plane image
CN109360217A (en) * 2018-09-29 2019-02-19 国电南瑞科技股份有限公司 Power transmission and transforming equipment method for detecting image edge, apparatus and system
CN110428433A (en) * 2019-07-02 2019-11-08 西华师范大学 A kind of Canny edge detection algorithm based on local threshold

Non-Patent Citations (9)

* Cited by examiner, † Cited by third party
Title
A.HAJJAR: "A NEW REAL TIME EDGE LINKING ALGORITHM AND ITS VLSI IMPLEMENTATION" *
刘丽霞;李宝文;王阳萍;杨景玉;: "改进Canny边缘检测的遥感影像分割" *
夏建芳;巢军;: "一种改进的Canny边缘检测算法" *
张彩珍;张云霞;赵丹;张晓金;: "基于肤色模型与BP神经网络的手势识别" *
张超;王志浩;杨建宇;朱德海;: "基于Canny算子的农田线状工程地物自动提取方法" *
文章;张欣;周昌顺;张良;: "一种基于Canny的边缘检测改进算法" *
许博文;唐朝;张田;李家栋;: "基于机器视觉检测钢板板形的图像处理方法研究" *
辛玉欣;王传洋;: "一种基于Canny算子的图像边缘检测方法" *
钮圣;王盛;杨晶晶;陈更生;: "完全基于边缘信息的快速图像分割算法" *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112070792A (en) * 2020-08-25 2020-12-11 清华大学 Edge growth connection method and device for image segmentation
CN112070792B (en) * 2020-08-25 2023-10-17 清华大学 Edge growth connection method and device for image segmentation
CN113627445A (en) * 2021-08-05 2021-11-09 福州大学 Formation planning system and method for multi-unmanned aerial vehicle aerial media
CN113627445B (en) * 2021-08-05 2023-08-15 福州大学 Formation planning system and method for multi-unmanned aerial vehicle aerial media
CN113870293A (en) * 2021-09-27 2021-12-31 东莞拓斯达技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN115131387A (en) * 2022-08-25 2022-09-30 山东鼎泰新能源有限公司 Gasoline engine spray wall collision parameter automatic extraction method and system based on image processing
CN115131387B (en) * 2022-08-25 2023-01-24 山东鼎泰新能源有限公司 Gasoline engine spray wall collision parameter automatic extraction method and system based on image processing

Also Published As

Publication number Publication date
CN111127498B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN111127498B (en) Canny edge detection method based on edge self-growth
CN110717489B (en) Method, device and storage medium for identifying text region of OSD (on Screen display)
CN115272346A (en) PCB production process online detection method based on edge detection
CN102156996B (en) Image edge detection method
CN110197153B (en) Automatic wall identification method in house type graph
CN108182383B (en) Vehicle window detection method and device
CN114399522A (en) High-low threshold-based Canny operator edge detection method
CN112528868B (en) Illegal line pressing judgment method based on improved Canny edge detection algorithm
CN104794721A (en) Quick optic disc positioning method based on multi-scale macula detection
CN108445009B (en) Crack detection method for solar cell panel
CN114863492B (en) Method and device for repairing low-quality fingerprint image
CN109544577B (en) Improved straight line extraction method based on edge point grouping
CN108229247A (en) A kind of mobile vehicle detection method
CN116740072A (en) Road surface defect detection method and system based on machine vision
CN107463939B (en) Image key straight line detection method
CN115439523A (en) Method and equipment for detecting pin size of semiconductor device and storage medium
CN113744142B (en) Image restoration method, electronic device and storage medium
CN113012181B (en) Novel quasi-circular detection method based on Hough transformation
CN107832732B (en) Lane line detection method based on treble traversal
CN106778766A (en) A kind of rotary digital recognition methods and system based on anchor point
CN111241911B (en) Self-adaptive lane line detection method
CN109064420B (en) Multilayer PCB section image process parameter extraction method
CN113011498B (en) Feature point extraction and matching method, system and medium based on color image
CN111178111A (en) Two-dimensional code detection method, electronic device, storage medium and system
CN111738094B (en) Automatic extraction method and device for remote sensing image road

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant