CN108629788B - Image edge detection method, device and equipment and readable storage medium - Google Patents

Image edge detection method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN108629788B
CN108629788B CN201810432571.0A CN201810432571A CN108629788B CN 108629788 B CN108629788 B CN 108629788B CN 201810432571 A CN201810432571 A CN 201810432571A CN 108629788 B CN108629788 B CN 108629788B
Authority
CN
China
Prior art keywords
edge
edge detection
image
candidate
scale
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.)
Active
Application number
CN201810432571.0A
Other languages
Chinese (zh)
Other versions
CN108629788A (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.)
Suzhou Tengshuicheng Technology Co ltd
Original Assignee
Suzhou University
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 Suzhou University filed Critical Suzhou University
Priority to CN201810432571.0A priority Critical patent/CN108629788B/en
Publication of CN108629788A publication Critical patent/CN108629788A/en
Application granted granted Critical
Publication of CN108629788B publication Critical patent/CN108629788B/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

Abstract

The invention discloses an image edge detection method, which comprises the following steps: acquiring a plurality of edge detection images with different scales corresponding to a target original image; comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image; respectively searching edge pixels corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph; and discarding the candidate edge without edge pixels in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image corresponding to the target original image and conforming to human vision through iterative calculation. The method can improve the robustness of image edge detection and effectively improve the performance of image edge detection while ensuring the edge precision. The invention also discloses an image edge detection device, equipment and a readable storage medium, and has corresponding technical effects.

Description

Image edge detection method, device and equipment and readable storage medium
Technical Field
The invention relates to the technical field of computer vision and image recognition, in particular to an image edge detection method, device and equipment and a readable storage medium.
Background
An edge refers to a set of pixels in an image where the gray level variation of the pixels around the image is discontinuous, and is a highly descriptive feature of the image. The edge detection plays an important role in many computer vision tasks, and can be widely applied to the fields of feature extraction, image recognition, image segmentation and the like. Over the past few decades, many edge detection algorithms have been proposed, including classical operators, optimal operators, multi-scale methods, adaptive smoothing filtering methods, fuzzy math based methods, neural network based methods, etc.
The performance of single scale edge detection methods is often dependent on the choice of scale parameters, but it is rather difficult to automatically determine the optimal scale for an edge detection method. If the scale is too high, the long, high-contrast and independent edges are retained, and other short-clustered and compact edges are filtered, so that the accuracy of the edge detection performance is high, but the recall rate is low; if the selected scale is too low, the detected edge is highly accurate, but false response edges are generated, which results in high recall and low accuracy.
In the human visual system, edge detection is a multi-scale process. The human visual system has the ability to extract useful information from different scales and produce optimized edge detection results. Based on this fact, many edge detection methods detect edges of different scales or use multi-scale methods, wherein the multi-scale method usually uses tracking from a high-scale edge map to a low scale, which guarantees the accuracy of the detected edge, but still has false response edges.
Therefore, how to effectively solve the problems of performing high-precision and high-noise-resistance edge detection on an image and the like is a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention aims to provide an image edge detection method, device and equipment and a readable storage medium, which are used for improving the accuracy and noise resistance of image edge detection.
In order to solve the technical problems, the invention provides the following technical scheme:
an image edge detection method, comprising:
acquiring a plurality of edge detection images with different scales corresponding to a target original image;
comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image;
respectively searching edge pixels corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph;
and discarding the candidate edge without edge pixels in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image which corresponds to the target original image and accords with human vision through iterative calculation.
Preferably, the comparing the target high-scale edge detection map with the target low-scale edge detection map to obtain a candidate edge detection map includes:
determining a first seed point set corresponding to each edge in the target high-scale edge detection graph;
searching all edge pixels in an area with a radius of a first preset parameter as a center of a circle and corresponding to the pixels respectively corresponding to the seed points in the first seed point set in the target low-scale edge detection graph;
and determining the object edge as a candidate edge, and obtaining a candidate edge detection graph.
Preferably, respectively searching for an edge pixel corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph includes:
determining a second set of seed points corresponding to each edge in the candidate edge detection graph;
and in the target high-scale edge detection graph, searching edge pixels in an area with a radius as a second preset parameter by taking pixels corresponding to the seed points in the second seed point set as the circle center.
Preferably, before the acquiring the edge detection maps of the plurality of different scales corresponding to the target original image, the method further includes:
acquiring and judging whether an original image is a gray scale image or not;
if yes, determining the original image as a target original image;
if not, converting the original image into a gray-scale image, and determining the obtained gray-scale image as a target original image.
Preferably, the acquiring edge detection maps of a plurality of different scales corresponding to the target original image includes:
the method comprises the steps of carrying out multi-scale edge detection on a target original image under a preset detection scale to obtain a plurality of edge detection maps with different scales of the target original image.
An image edge detection apparatus comprising:
the edge detection image acquisition module is used for acquiring a plurality of edge detection images with different scales corresponding to the target original image;
the candidate edge detection image acquisition module is used for comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image;
an edge pixel searching module, configured to search, in the target high-scale edge detection graph, an edge pixel corresponding to each candidate edge in the candidate edge detection graph respectively;
and the bidirectional tracking detection correction image acquisition module is used for discarding the candidate edge without the edge pixel in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image which corresponds to the target original image and accords with the vision of human eyes through iterative calculation.
Preferably, the candidate edge detection map acquisition module includes:
a first seed point set determining unit, configured to determine a first seed point set corresponding to each edge in the target high-scale edge detection map;
an object edge searching unit, configured to search, in the target low-scale edge detection map, an object edge corresponding to all edge pixels in an area in which pixels corresponding to seed points in the first seed point set are used as centers of circles and a first preset parameter is a radius;
a candidate edge detection map obtaining unit configured to determine the object edge as a candidate edge and obtain a candidate edge detection map.
Preferably, the edge pixel searching module includes:
a second seed point set determining unit, configured to determine a second seed point set corresponding to each edge in the candidate edge detection graph;
and the edge pixel searching unit is used for searching edge pixels in an area with a radius as a second preset parameter by taking the pixels corresponding to the seed points in the second seed point set as the circle center in the target high-scale edge detection graph.
An image edge detection apparatus comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the image edge detection method when executing the computer program.
A readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the above-mentioned image edge detection method.
By applying the method provided by the embodiment of the invention, a plurality of edge detection images with different scales corresponding to the target original image are obtained; comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image; respectively searching edge pixels corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph; and discarding the candidate edge without edge pixels in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image corresponding to the target original image and conforming to human vision through iterative calculation. After a plurality of edge detection maps with different scales corresponding to the target original image are obtained, the target high-scale edge detection map and the target low-scale edge detection map are compared, candidate edge detection maps can be obtained, and the accuracy of the detected edges can be improved. And after the candidate edge detection image is obtained, confirming the candidate edge detection image and the target high-scale edge detection image again, namely searching in the candidate edge detection image and discarding the candidate edge without edge pixels to obtain a bidirectional tracking detection correction image. And then, an iterative algorithm can be utilized, namely, the bidirectional tracking operation of the bidirectional tracking detection correction graph and the adjacent low-scale edge detection graph is executed in an iterative mode, the edge graph iterated to the lowest scale is determined to be the final output, and the edge graph corresponding to the target original image and conforming to the vision of human eyes can be obtained. Therefore, the robustness of image edge detection can be improved while the edge precision is ensured, and the image edge detection performance is effectively improved.
Accordingly, embodiments of the present invention further provide an image edge detection apparatus, a device and a readable storage medium, which have the above technical effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating an embodiment of a method for detecting an edge of an image according to the present invention;
FIG. 2(a) is a schematic diagram of two-way tracking steps performed by two adjacent scales of two-way tracking in an image edge detection method according to an embodiment of the present invention;
FIG. 2(b) is a schematic diagram of bidirectional tracking iteration in an image edge detection method according to an embodiment of the present invention;
fig. 3(a) is an exemplary diagram of a lower tracking correction corner in an image edge detection method according to an embodiment of the present invention;
fig. 3(b) is an effect diagram of finding a vanishing edge by lower tracking in an image edge detection method according to an embodiment of the present invention;
FIG. 4(a) is a schematic diagram illustrating false edge removal in an image edge detection method according to an embodiment of the present invention;
FIG. 4(b) is a schematic diagram illustrating an upper determination step in an image edge detection method according to an embodiment of the present invention;
FIG. 5 is a subjective visual comparison of the effect of an image edge detection method and Canny method on two images in a test chart and a BSDS500 database according to an embodiment of the present invention;
FIG. 6(a) is a schematic diagram of an image at different noise levels according to an embodiment of the present invention;
FIG. 6(b) is a schematic diagram showing the results of an image edge detection method and test charts of different noise levels of Canny, SMED, IAGks, ED, and EDPF in the embodiment of the present invention;
FIG. 7 is a schematic diagram showing objective numerical evaluation of the test chart of FIG. 6 (b);
FIG. 8 is a comparison of subjective results disclosed in several examples of the database RUG for one image edge detection method and several other edge detection methods according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of an image edge detection apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an image edge detection apparatus according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating an image edge detection method according to an embodiment of the present invention, the method including the following steps:
s101, a plurality of edge detection images with different scales corresponding to the target original image are obtained.
In this embodiment, edge detection may be performed on the target original image at different scales in advance, and then a plurality of edge detection maps of different scales corresponding to the target original image are stored in the preset storage library. That is, the edge detection maps of different scales corresponding to the target original image can be directly read from the preset storage library.
In other embodiments of the present invention, step S101 may specifically be: the method comprises the steps of carrying out multi-scale edge detection on a target original image under a preset detection scale to obtain a plurality of edge detection maps with different scales of the target original image.
Two or more detection scales may be preset, and parameters of a specific detection scale may be confirmed and adjusted according to an actual application, which is not limited in the embodiment of the present invention. The obtained target original image can be subjected to multi-scale edge detection under a preset detection scale, namely, edge detection spanning multiple scales. That is, edge detection may be performed at a plurality of different scales for a target original image. An initial edge detection map set can be obtained, where the set includes a plurality of initial edge detection maps, and each initial edge detection map has a corresponding preset detection scale, where the preset detection scale is the same as the preset detection scale. Edge detection can be performed by one or more of Canny, ED (Edge Drawing, Edge and line segment detection), EDPF (Edge Drawing Parameter Free), and the like, when performing multi-scale detection, to obtain an initial Edge detection map.
In one embodiment of the present invention, before performing step S101, the following steps may also be performed:
step one, acquiring and judging whether an original image is a gray scale image;
step two, if yes, determining the original image as a target original image;
and step three, if not, converting the original image into a gray-scale image, and determining the obtained gray-scale image as a target original image.
For convenience of description, the above three steps will be described in combination.
In order to facilitate edge detection of an image, in this embodiment, when an original image is received, the original image is further determined to determine whether the original image is a grayscale image, and if the original image is a grayscale image, the original image is directly determined to be a target original image. If the original image is not a gray image, the original image is converted into a gray image through a common image conversion technology, and a recovery image obtained through conversion is determined as a target original image. Of course, when image conversion is performed, filtering operation can also be performed, so that the performance of image edge detection is improved.
S102, comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image.
In this embodiment, a target low-scale edge detection map and a target high-scale edge detection map may be determined from a plurality of different scale edge detection maps obtained according to the scale difference, and then the target high-scale edge detection map and the target low-scale edge detection map are compared to obtain candidate edge detection maps. Wherein each edge in the candidate edge detection map may be an edge in the target high-scale edge detection map that has a difference from the target low-scale edge detection map, or an edge that is not present in the target high-scale edge detection map but is present in the target low-scale edge detection map. In particular, the candidate edge may be a candidate edge returned from a position corresponding to the target low-scale edge detection map by tracking the set of seed points of the target high-scale edge detection map.
In one embodiment of the present invention, step S102 may include the steps of:
step one, determining a first seed point set corresponding to each edge in a target high-scale edge detection graph;
searching all edge pixels in an area with the first preset parameter as the radius corresponding to the object edge by using the pixels respectively corresponding to the seed points in the first seed point set as the circle center in the target low-scale edge detection graph;
and step three, determining the object edge as a candidate edge, and obtaining a candidate edge detection graph.
For convenience of description, the above three steps will be described in combination.
A first set of seed points corresponding to each edge of the target high-scale edge detection graph is determined. Specifically, pixel points can be uniformly selected from edge pixels forming the edge according to a preset proportion, and the pixel points are used as seed points. And then finding out the pixel of the corresponding position of the seed point in the first seed point set as the center of a circle in the target low-scale edge detection image, wherein the object edges corresponding to all the edge pixels exist in the area with the radius as the first preset parameter. And determining the object edge as a candidate edge to obtain a candidate edge detection graph consisting of the candidate edges. The first preset parameter may be a parameter with a pixel as a unit, for example, the first preset parameter is 2 pixels.
In the process, the candidate edges are searched in the target low-scale edge detection graph, so that the accuracy of edge detection can be improved, and the neglected or incomplete edges in the target high-scale edge detection graph can be searched again.
S103, respectively searching edge pixels corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph.
After the candidate edge detection map is acquired, edge pixels corresponding to the candidate edges in the candidate edge detection map are searched in the target high-scale edge detection map. That is, candidate edge detection maps are determined with the target high-scale edge detection map.
In one embodiment of the present invention, step S103 may include the steps of:
step one, determining a second seed point set corresponding to each edge in the candidate edge detection graph;
and step two, in the target high-scale edge detection graph, searching edge pixels in an area with the pixels respectively corresponding to the seed points in the second seed point set as the circle center and the second preset parameter as the radius.
For convenience of description, the above two steps will be described in combination.
The second set of seed points corresponding to each candidate edge may be determined in the candidate edge detection map, with reference to the manner in which the first set of seed points is determined as mentioned above. And then searching edge pixels in an area with a second preset parameter as a radius by taking pixels respectively corresponding to the seed points in the second seed point set as the circle center in the target high-scale edge detection image. The second preset parameter may be the same as or different from the first preset parameter.
And S104, discarding the candidate edge without the edge pixel in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image which corresponds to the target original image and accords with the vision of human eyes through iterative calculation.
For each candidate edge in the candidate edge detection graph, when an edge pixel corresponding to the candidate edge exists, the candidate edge can be considered to exist indeed, and a non-false response can be kept in the candidate edge detection graph; when there are no edge pixels corresponding to the candidate edge, the candidate edge may be considered a false response and discarded in the candidate edge detection graph. And then determining the candidate edge detection image without the false response edge as a bidirectional tracking detection correction image so as to obtain an edge image corresponding to the target original image and conforming to the vision of human eyes. In the process, false response edges can be abandoned by reconfirming the target high-scale edge detection graph, so that the anti-noise capability is improved.
After the bidirectional tracking detection correction graph is obtained by executing the steps, the bidirectional tracking operation of the bidirectional tracking detection correction graph and the adjacent low-scale edge detection graph can be executed iteratively, the edge graph iterated to the lowest scale is determined as the final output, and the edge graph corresponding to the target original image and conforming to the vision of human eyes can be obtained. Wherein the bidirectional tracking comprises: down-tracking in the direction from the high scale to the low scale, which may specifically refer to step S102; specifically, step S103 and step S104 may be referred to for the low-scale to high-scale up confirmation.
By applying the method provided by the embodiment of the invention, a plurality of edge detection images with different scales corresponding to the target original image are obtained; comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image; respectively searching edge pixels corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph; and discarding the candidate edge without edge pixels in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image corresponding to the target original image and conforming to human vision through iterative calculation. After a plurality of edge detection maps with different scales corresponding to the target original image are obtained, the target high-scale edge detection map and the target low-scale edge detection map are compared, candidate edge detection maps can be obtained, and the accuracy of the detected edges can be improved. And after the candidate edge detection image is obtained, confirming the candidate edge detection image and the target high-scale edge detection image again, namely searching in the candidate edge detection image and discarding the candidate edge without edge pixels to obtain a bidirectional tracking detection correction image. And then, an iterative algorithm can be utilized, namely, the bidirectional tracking operation of the bidirectional tracking detection correction graph and the adjacent low-scale edge detection graph is executed in an iterative mode, the edge graph iterated to the lowest scale is determined to be the final output, and the edge graph corresponding to the target original image and conforming to the vision of human eyes can be obtained. Therefore, the robustness of image edge detection can be improved while the edge precision is ensured, and the image edge detection performance is effectively improved.
For convenience of understanding, the image edge detection method provided by the embodiment of the present invention is described in detail below with specific application scenarios and application examples.
The core of the image edge detection method provided by the embodiment of the invention is as follows: based on the multi-scale edge detection of the bidirectional tracking, the problem of single-scale edge detection is solved by carrying out the edge detection across a plurality of scales, and the influence on the accuracy of the edge detection when noise is suppressed is avoided, so that an ideal edge image is obtained; during cross-scale iterative computation, firstly adopting down-tracking in a direction from high scale to low scale to improve the edge positioning precision of the method, and simultaneously searching for a vanishing edge, correcting a fusion edge and the like; then, performing upper confirmation on the edge graph obtained by the lower tracking to a high scale, wherein the purpose is to correct the lower tracking and confirm the relationship (for example, whether the edge of the lower tracking is obtained by edge tracking of a position corresponding to the high scale) and the number of edges; the advantages of high accuracy edge location and good noise suppression can be combined by two-way tracking.
The tests were performed on a standard test chart and database RUG of image processing. The standard test chart is a Lena chart, and subjective visual and objective numerical performance evaluation is carried out on the test chart by adding Gaussian white noise with different standard deviations; RUG is a database of 40 gray-scale images, each of 512 x 512 pixels in size, and each of which has an artificially labeled standard edge map.
Note that, the following context tracking may refer to step S102 above, and the following context confirmation may refer to step S103 and step S104 above.
The embodiment of the invention discloses an image edge detection method, which comprises the following specific implementation steps:
step one, Canny edge detection under n specified scales is respectively carried out on an input target original image, and a plurality of initial edge detection diagrams are obtained.
The target original image is a gray-scale image, and n is a positive integer greater than or equal to 2. In addition, other edge detection techniques may be used in addition to the Canny edge detection technique.
And step two, selecting a seed point.
Specifically, if the obtained edge map under the i-scale has m edges, that is, the set of edges under the i-scale is:
Figure BDA0001653804520000101
wherein the length of the jth edge is
Figure BDA0001653804520000102
Can pass through
Figure BDA0001653804520000103
And selecting s seed points uniformly distributed on each edge.
And step three, performing down-tracking from the high scale to the low scale.
Specifically, definition E(k)For the edge map at the k-th scale, then the following trace is:
Figure BDA0001653804520000104
wherein the content of the first and second substances,
Figure BDA0001653804520000105
for candidate edge detection maps, E(k)For low-scale edge detection of objects, E(k+1)For the target high conflict edge detection graph, F represents the lower trace operation. Specifically, the following trace: and for the kth seed point of the jth edge under the i scale, (j is 1, …, m, and k is 1, …, s), recording a pixel at the same position as the seed point in an edge image under the i-1 scale, searching all edge pixels in an area with the pixel as the center of a circle and 2 as the radius, and returning all edges where the edge pixels are located.
And step four, confirming the low scale to the high scale direction.
Specifically, the upper confirmation operation is defined as:
Figure BDA0001653804520000106
wherein
Figure BDA0001653804520000107
Is bidirectionalThe edge detection correction map is tracked and,
Figure BDA0001653804520000108
for candidate edge detection maps, E(k+1)For the target high-scale edge detection graph, B represents the up-determination operation. Specifically, the following were confirmed: selecting uniformly distributed seed points for the jth edge in the edge image obtained by the lower tracking; and for the kth seed point, finding out the pixel at the same position in the adjacent high scale, namely i scale, and then searching whether an edge pixel exists in an area which takes the pixel as the center of a circle and 2 as the radius. If no edge pixel exists, the edge where the seed point is located, namely the jth edge of the edge graph tracked below is a false response edge, and the edge is discarded; otherwise the edge is retained.
Based on the above steps, it can be called as Multi-scale edge Detection (Bi-Directional tracking) based on bidirectional tracking, where the total number of given scales is n, and therefore, when performing iterative computation, bidirectional tracking is performed n-1 times iteratively. The method comprises the following specific steps:
inputting: one gray scale map and n specified scales σ ═ σ { (σ })(1),...,σ(n)},n>1。
And (3) outputting: and inputting an edge result graph of the graph.
S1: canny edge detection is respectively executed under n scales;
S2:σ(i)the lower edge map has m edges
Figure BDA0001653804520000111
The length of the jth edge is
Figure BDA0001653804520000112
(j-1, …, m), selecting s seed points evenly distributed for each edge,
Figure BDA0001653804520000113
S3:while 2<=i<=n do
while j<=m do
while k<=s do
recording the coordinates of the kth seed point;
at σ(i-1)Find the pixel in the same position as the seed point in the edge map;
searching all edge pixels in an area with the pixel as the center of a circle and 2 as the radius;
all edges where the edge pixels are located are returned.
end while
end while
for(σ(i)To sigma(i-1)Each edge of the edge map obtained by lower tracing)
for (each seed point of each edge)
Recording the coordinates of the seed point;
to sigma(i)Finding pixel points at the same positions as the seed points in the edge graph;
if (with the pixel as the center of circle and 2 as the radius, no edge pixel in the area, the edge of the lower tracking edge image is the false response edge)
else
The edge is a real edge and is reserved.
end
end
end
end while
The algorithm mainly calculates the tracking of the seed points during bidirectional tracking, so the calculation complexity of the algorithm is related to the number and the length of the edges of the original input image.
The invention discloses an image edge detection method, which provides a bidirectional tracking process for improving the performance of an algorithm by introducing the ideas of multi-scale and edge tracking, wherein the accuracy of edges can be improved by lower tracking, false response edges can be removed by upper confirmation, and the detection performance is improved.
Referring to fig. 2(a) and fig. 2(b), a multi-scale edge detection framework based on bidirectional tracking in an image detection method according to an embodiment of the present invention is described in detail below. Fig. 2(a) is a bidirectional tracing step performed at two adjacent scales, and is composed of a dual-solid-line down-trace labeled FT (down-trace) in the figure and a dual-solid-line up-confirmation labeled BC (back-confirmation) in the figure, where the down-trace in the high-scale to low-scale direction can improve the accuracy of edge location, and the up-confirmation can remove false response edges such as noise. Fig. 2(b) shows an iterative process of bi-directional tracking at multiple scales.
Please refer to fig. 3(a), fig. 3(b), fig. 4(a) and fig. 4 (b). Wherein FIGS. 3(a) and 3(b) show the effect of down tracking, wherein E(1)Indicating a low-scale Canny edge result, E(2)Representing a high-scale Canny edge, wherein the circle center of a dotted line circle represents a selected seed point, and a dotted line circular area represents a search area with the same coordinate as the seed point; FIG. 3(a) is an exemplary diagram of a lower trace correction corner point, where the input graph contains sharp corners (e.g., the lower left corner of the graph), and Canny edge detection blunts the corners of the input graph at a relatively high scale due to Gaussian blur (e.g., E in the graph)(2)Shown, at this time scale σ(2)2) for correcting the angle to the lower scale σ(1)When the edge is as sharp as 0.1, selecting a corresponding seed point at each edge under the high scale, tracking the same position of the low scale by the seed point, and returning the edges where all edge pixel points in the area with 2 pixels as the radius are located, wherein the operation of FT (forward tracking) in the figure is lower tracking; FIG. 3(b) shows the effect of finding a vanishing edge for down-tracking, where the highlighted part of the sitting corner is two adjacent edges of the input map, at the high-scale σ(2)1.5 because one edge gets shorter due to low contrast, the lower scale σ is tracked down(1)As 1, the edge becomes as long as the edge at the low scale, and the accuracy of the edge map is also improved. In the down-tracking, although the edge accuracy is improved, a false edge may still exist due to the noise effect, as shown in fig. 4 (a). At a high scale sigma(2)The corner points of the 6.5 edges become dull and a false edge still exists in the edge map after the down-tracking. To solve this problem, the upper confirmation bc (backward confirmation) is proposed, and fig. 4(b) shows the specific operation of the upper confirmation. Selecting corresponding seed points for each edge of the edge graph obtained by the lower tracking, returning to the same position with the high scale for confirmation, if the position is confirmed to be a false edge,then discarding; otherwise, the edge is confirmed as a real edge and is used as the edge of the output graph.
Referring to fig. 5, subjective visual comparison is performed on the effects of an image edge detection method and a Canny method according to an embodiment of the present invention. Wherein, the first column of FIG. 5 is an input graph, which includes a test graph and two real examples in the database BSDS 500; the edge maps of Canny detected at three different scales are shown in the second to fourth columns of fig. 5, and it can be seen that at the lower scale σ(1) Canny is sensitive to noise edges and generates more false edges, and as the scale is increased, the number of false edges is reduced, but the edge positioning precision is reduced; the fifth column of fig. 5 is the edge detection result obtained by using the image edge detection method provided by the embodiment of the present invention, and it is obvious that the effect is better than that of Canny in a single scale.
In addition to subjective evaluation, the invention also discloses objective numerical evaluation, including accuracy P, recall R, and value FαAnd a figure of merit function FOM.
Wherein FαIs defined as:
Figure BDA0001653804520000131
where α represents which index of P and R is more important, and index F is used for comparison in the present invention0.5Meaning that accuracy and recall are of equally high importance.
FOM is defined as:
Figure BDA0001653804520000132
wherein N isiNumber of edge pixels, N, of ideal edge mapdRepresenting the number of edge pixels detected, d (k) representing the euclidean distance from the k-th ideal edge pixel point to the detected edge point, and γ being a constant 1/4. FOM values range from 0 to 1, and a 1 indicates that the detected edge is coincident with the ideal edge.
Please refer to fig. 6(a) and fig. 6(b), in which fig. 6(b) is a result of several different noise level test charts corresponding to Canny, SMED (Scale Multiplication in Edge Detection), IAGKs (Isotropic and Anisotropic Gaussian kernel Edge Detection), ED (Edge draw, Edge and line segment Detection), EDPF (Edge draw Parameter Free Edge Detection) provided by the embodiment of the present invention. Fig. 6(a) shows, from left to right, the original image, the standard deviation of 0 gaussian noise mean, 0 standard deviation of 0.001 gaussian noise mean, 0 standard deviation of 0.01 gaussian noise mean, and 0 standard deviation of 0.1 gaussian noise mean; fig. 6(b) is a comparison of the edge detection effect of the method of the present invention and Canny, SMED, IAGKs, ED, EDPF (using default parameters used by algorithms in each document) involved in comparison, which are, from left to right, the original image, Canny, SMED, IAGKs, ED, EDPF, and the image edge detection method provided in the embodiments of the present invention (illustrated as our). Referring to fig. 7, fig. 7 is a schematic diagram illustrating objective value evaluation of the test chart in fig. 6 (b).
Referring to fig. 8, a comparison between subjective results disclosed in several examples of the database RUG for an image edge detection method and other edge detection methods according to an embodiment of the present invention is shown. The first column is RUG examples in the database, the second column is gt (ground route), the third column is Canny, the fourth column is SMED, the fifth column is IAGKs, the sixth column is ED, the seventh column is EDPF, and the eighth column is an image processed by the method provided by the embodiment of the present invention. It can be obviously seen that the edge graph obtained by the method provided by the embodiment of the invention detects the main edge, filters the weak edge, and has the same result with the human visual system; other methods detect the primary edge while also preserving the redundant weak edge.
Referring to table 1 below, table 1 is a comparison table of evaluation index results of an image edge detection method and Canny, SMED, IAGKs, ED, EDPF methods provided in the embodiment of the present invention:
Figure BDA0001653804520000141
TABLE 1
Table 1 gives the average P, R, F of each method over the database RUG. It can be seen that the image edge detection method provided by the embodiment of the invention has the highest accuracy and F value, and the recall rate is relatively stable. The three average indicators indicate that the present invention can detect edges with higher accuracy, i.e., the detected edges are located close to the true position, while the main edges of the input image are detected.
Through experimental results, the performance of the image edge detection method based on bidirectional tracking is obviously superior to that of related Canny, SMED, IAGks, ED and EDPF methods, and the image edge detection method provided by the embodiment of the invention has higher precision and higher noise resistance.
To sum up: the image edge detection method provided by the embodiment of the invention comprises the following steps of firstly carrying out down-tracking on an input image after obtaining edge images under a plurality of specified scales, so that the edge precision can be improved; then, the operation of the confirmation is carried out, so that the edge of the false response can be removed; and (4) iterating the bidirectional tracking process until the lowest scale is reached, and obtaining a final edge result graph. The edge obtained by bidirectional tracking has higher precision and better noise robustness than a single scale edge detection method and other multi-scale methods.
Corresponding to the above method embodiments, the embodiments of the present invention further provide an image edge detection apparatus, and the image edge detection apparatus described below and the image edge detection method described above may be referred to in correspondence with each other.
Referring to fig. 9, the apparatus includes the following modules:
an edge detection image obtaining module 901, configured to obtain a plurality of edge detection images with different scales corresponding to an original target image;
a candidate edge detection map obtaining module 902, configured to compare the target high-scale edge detection map with the target low-scale edge detection map to obtain a candidate edge detection map;
an edge pixel search module 903, configured to search, in the target high-scale edge detection graph, an edge pixel corresponding to each candidate edge in the candidate edge detection graph respectively;
a bidirectional tracking detection correction map obtaining module 904, configured to discard candidate edges without edge pixels in the candidate edge detection map to obtain a bidirectional tracking detection correction map, so as to further obtain an edge map corresponding to the target original image and conforming to human vision through iterative computation.
By applying the device provided by the embodiment of the invention, a plurality of edge detection images with different scales corresponding to the target original image are obtained; comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image; respectively searching edge pixels corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph; and discarding the candidate edge without edge pixels in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image corresponding to the target original image and conforming to human vision through iterative calculation. After a plurality of edge detection maps with different scales corresponding to the target original image are obtained, the target high-scale edge detection map and the target low-scale edge detection map are compared, candidate edge detection maps can be obtained, and the accuracy of the detected edges can be improved. And after the candidate edge detection image is obtained, confirming the candidate edge detection image and the target high-scale edge detection image again, namely searching in the candidate edge detection image and discarding the candidate edge without edge pixels to obtain a bidirectional tracking detection correction image. And then, an iterative algorithm can be utilized, namely, the bidirectional tracking operation of the bidirectional tracking detection correction graph and the adjacent low-scale edge detection graph is executed in an iterative mode, the edge graph iterated to the lowest scale is determined to be the final output, and the edge graph corresponding to the target original image and conforming to the vision of human eyes can be obtained. Therefore, the robustness of image edge detection can be improved while the edge precision is ensured, and the image edge detection performance is effectively improved.
In a specific embodiment of the present invention, the candidate edge detection map obtaining module 902 includes:
the first seed point set determining unit is used for determining a first seed point set corresponding to each edge in the target high-scale edge detection graph;
the object edge searching unit is used for searching the object edge corresponding to all edge pixels in an area with the radius as a first preset parameter, wherein the pixels respectively corresponding to the seed points in the first seed point set are used as the circle center;
a candidate edge detection map obtaining unit configured to determine an object edge as a candidate edge and obtain a candidate edge detection map.
In an embodiment of the present invention, the edge pixel search module 903 includes:
a second seed point set determining unit, configured to determine a second seed point set corresponding to each edge in the candidate edge detection graph;
and the edge pixel searching unit is used for searching edge pixels in an area with the second preset parameter as the radius by taking the pixels corresponding to the seed points in the second seed point set as the circle center in the target high-scale edge detection graph.
In one embodiment of the present invention, the method further comprises:
the target original image acquisition module is used for acquiring and judging whether the original image is a gray image or not before acquiring a plurality of edge detection images with different scales corresponding to the target original image; if yes, determining the original image as a target original image; if not, the original image is converted into a gray-scale image, and the obtained gray-scale image is determined as the target original image.
In a specific embodiment of the present invention, the edge detection map obtaining module 901 is specifically configured to perform multi-scale edge detection on a target original image at a preset detection scale to obtain a plurality of edge detection maps of different scales of the target original image.
Corresponding to the above method embodiment, an embodiment of the present invention further provides an image edge detection apparatus, and an image edge detection apparatus described below and an image edge detection method described above may be referred to in correspondence with each other.
Referring to fig. 10, the image edge detecting apparatus includes:
a memory D1 for storing computer programs;
a processor D2, configured to implement the steps of the image edge detection method of the above-mentioned method embodiment when executing the computer program.
Corresponding to the above method embodiment, an embodiment of the present invention further provides a readable storage medium, and a readable storage medium described below and an image edge detection method described above may be referred to in correspondence with each other.
A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of a method for image edge detection of the above-mentioned method embodiments.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (8)

1. An image edge detection method, comprising:
acquiring a plurality of edge detection images with different scales corresponding to a target original image;
comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image;
respectively searching edge pixels corresponding to each candidate edge in the candidate edge detection graph in the target high-scale edge detection graph;
discarding the candidate edge without edge pixels in the candidate edge detection image to obtain a bidirectional tracking detection correction image so as to further obtain an edge image which corresponds to the target original image and accords with human vision through iterative calculation;
comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image, comprising:
determining a first seed point set corresponding to each edge in the target high-scale edge detection graph;
searching all edge pixels in an area with a radius of a first preset parameter as a center of a circle and corresponding to the pixels respectively corresponding to the seed points in the first seed point set in the target low-scale edge detection graph;
determining the object edge as a candidate edge, and obtaining a candidate edge detection graph;
the discarding the candidate edge without edge pixel in the candidate edge detection map to obtain the bidirectional tracking detection correction map includes:
for each candidate edge in the candidate edge detection graph, when an edge pixel corresponding to the candidate edge exists, remaining in the candidate edge detection graph; and when no edge pixel corresponding to the candidate edge exists, discarding the candidate edge detection map, and determining the candidate edge detection map with the discarded false response edge as a bidirectional tracking detection correction map.
2. The image edge detection method according to claim 1, wherein separately searching the target high-scale edge detection map for edge pixels corresponding to each candidate edge in the candidate edge detection map comprises:
determining a second set of seed points corresponding to each edge in the candidate edge detection graph;
and in the target high-scale edge detection graph, searching edge pixels in an area with a radius as a second preset parameter by taking pixels corresponding to the seed points in the second seed point set as the circle center.
3. The image edge detection method according to claim 1, further comprising, before the obtaining a plurality of edge detection maps of different scales corresponding to the target original image:
acquiring and judging whether an original image is a gray scale image or not;
if yes, determining the original image as a target original image;
if not, converting the original image into a gray-scale image, and determining the obtained gray-scale image as a target original image.
4. The image edge detection method according to any one of claims 1 to 3, wherein the acquiring of the edge detection maps of a plurality of different scales corresponding to the target original image comprises:
the method comprises the steps of carrying out multi-scale edge detection on a target original image under a preset detection scale to obtain a plurality of edge detection maps with different scales of the target original image.
5. An image edge detection apparatus, comprising:
the edge detection image acquisition module is used for acquiring a plurality of edge detection images with different scales corresponding to the target original image;
the candidate edge detection image acquisition module is used for comparing the target high-scale edge detection image with the target low-scale edge detection image to obtain a candidate edge detection image;
an edge pixel searching module, configured to search, in the target high-scale edge detection graph, an edge pixel corresponding to each candidate edge in the candidate edge detection graph respectively;
a bidirectional tracking detection correction image obtaining module, configured to discard candidate edges without edge pixels in the candidate edge detection image to obtain a bidirectional tracking detection correction image, so as to further obtain an edge image corresponding to the target original image and conforming to human vision through iterative computation;
the candidate edge detection map acquisition module includes:
a first seed point set determining unit, configured to determine a first seed point set corresponding to each edge in the target high-scale edge detection map;
an object edge searching unit, configured to search, in the target low-scale edge detection map, an object edge corresponding to all edge pixels in an area in which pixels corresponding to seed points in the first seed point set are used as centers of circles and a first preset parameter is a radius;
a candidate edge detection map obtaining unit configured to determine the object edge as a candidate edge and obtain a candidate edge detection map;
the bidirectional tracking detection correction map acquisition module is specifically configured to:
for each candidate edge in the candidate edge detection graph, when an edge pixel corresponding to the candidate edge exists, remaining in the candidate edge detection graph; and when no edge pixel corresponding to the candidate edge exists, discarding the candidate edge detection map, and determining the candidate edge detection map with the discarded false response edge as a bidirectional tracking detection correction map.
6. The image edge detection device of claim 5, wherein the edge pixel search module comprises:
a second seed point set determining unit, configured to determine a second seed point set corresponding to each edge in the candidate edge detection graph;
and the edge pixel searching unit is used for searching edge pixels in an area with a radius as a second preset parameter by taking the pixels corresponding to the seed points in the second seed point set as the circle center in the target high-scale edge detection graph.
7. An image edge detection apparatus, characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the image edge detection method according to any one of claims 1 to 4 when executing the computer program.
8. A readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the image edge detection method according to any one of claims 1 to 4.
CN201810432571.0A 2018-05-08 2018-05-08 Image edge detection method, device and equipment and readable storage medium Active CN108629788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810432571.0A CN108629788B (en) 2018-05-08 2018-05-08 Image edge detection method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810432571.0A CN108629788B (en) 2018-05-08 2018-05-08 Image edge detection method, device and equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN108629788A CN108629788A (en) 2018-10-09
CN108629788B true CN108629788B (en) 2022-03-15

Family

ID=63695871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810432571.0A Active CN108629788B (en) 2018-05-08 2018-05-08 Image edge detection method, device and equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN108629788B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109615598A (en) * 2018-12-10 2019-04-12 武汉大学 A kind of power transmission line recognition methods based on the free algorithm of edge mapping parameter

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030298A (en) * 2007-03-29 2007-09-05 杭州电子科技大学 Method for enhancing medical image with multi-scale self-adaptive contrast change
CN102110227A (en) * 2010-11-24 2011-06-29 清华大学 Compound method for classifying multiresolution remote sensing images based on context

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7257273B2 (en) * 2001-04-09 2007-08-14 Mingjing Li Hierarchical scheme for blur detection in digital image using wavelet transform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030298A (en) * 2007-03-29 2007-09-05 杭州电子科技大学 Method for enhancing medical image with multi-scale self-adaptive contrast change
CN102110227A (en) * 2010-11-24 2011-06-29 清华大学 Compound method for classifying multiresolution remote sensing images based on context

Also Published As

Publication number Publication date
CN108629788A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
US8879847B2 (en) Image processing device, method of controlling image processing device, and program for enabling computer to execute same method
US8019164B2 (en) Apparatus, method and program product for matching with a template
CN106960449B (en) Heterogeneous registration method based on multi-feature constraint
CN110781885A (en) Text detection method, device, medium and electronic equipment based on image processing
US20140219569A1 (en) Image recognition system and method for identifying similarities in different images
CN112800964A (en) Remote sensing image target detection method and system based on multi-module fusion
CN108053416B (en) Maximum oil storage capacity extraction system based on single satellite image
CN111738045B (en) Image detection method and device, electronic equipment and storage medium
CN111524117A (en) Tunnel surface defect detection method based on characteristic pyramid network
CN110889399A (en) High-resolution remote sensing image weak and small target detection method based on deep learning
CN106340010A (en) Corner detection method based on second-order contour difference
CN111415364A (en) Method, system and storage medium for converting image segmentation samples in computer vision
CN108629788B (en) Image edge detection method, device and equipment and readable storage medium
CN108447092B (en) Method and device for visually positioning marker
CN112926695A (en) Image recognition method and system based on template matching
CN111473767B (en) Remote distance measurement method and device
EP2300990A1 (en) Image analysis system &amp; method
CN111242880B (en) Multi-depth-of-field image superposition method, equipment and medium for microscope
CN110532973B (en) Double-page text image identification and positioning segmentation method based on special anchor points
CN114743048A (en) Method and device for detecting abnormal straw picture
CN114119952A (en) Image matching method and device based on edge information
CN109815791B (en) Blood vessel-based identity recognition method and device
CN109214398B (en) Method and system for measuring rod position from continuous images
CN109215068B (en) Image magnification measuring method and device
CN112132135A (en) Power grid transmission line detection method based on image processing and storage medium

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231101

Address after: Room 4908, building 2, dongfangzhimen building, 199 Xinggang street, Suzhou Industrial Park, Suzhou, Jiangsu 215000

Patentee after: Suzhou tengshuicheng Technology Co.,Ltd.

Address before: 215104 No. 1188 Wuzhong Road, Wuzhong District, Suzhou, Jiangsu

Patentee before: SOOCHOW University