Ellipse feature rapid detection method and device
By constructing arc segment relationship matrix and clustering technology, elliptical features are quickly acquired, which solves the problem of low elliptical feature detection efficiency in the existing technology, and realizes efficient elliptical feature detection.
Patent Information
- Application Number
- CN202110078307.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-20
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-01-20
AI Technical Summary
The existing elliptical feature detection methods have complex image features and large number of edge segments, and the efficiency of edge segment combination is low, resulting in a long detection time and it is difficult to meet the real-time requirements.
By extracting the edge points of the image, constructing an arc segment relationship matrix, performing arc segment clustering based on the matrix, quickly obtaining arc segment groups matching the same ellipse characteristics, and calculating and verifying the ellipse feature parameters.
The efficiency of elliptical feature detection is significantly improved, detection time is saved, and it is compatible with the existing elliptical feature detection methods based on edge connection, optimizing the detection efficiency.
Smart Images

Figure CN114862742B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital image processing and pattern recognition, and in particular to a method and device for rapid detection of ellipse features. Background Art
[0002] Ellipse feature detection is a classic problem in the field of target detection and is widely used in industrial precision optical measuring instruments such as laser trackers, industrial total stations, and visual measuring instruments. Domestic and foreign scholars have conducted a lot of research on this issue. At present, ellipse detection methods are mainly divided into two categories: ellipse detection methods based on Hough transform (HT) and ellipse detection methods based on edge segment links.
[0003] Hough transform is a general method for detecting various function curve features in images. The main problem of this method in ellipse feature detection is that the ellipse equation contains five parameters, and the corresponding five-dimensional parameter space needs to be constructed for calculation, which leads to low algorithm efficiency and makes it difficult to meet the real-time requirements of practical applications.
[0004] Ellipse feature detection technology based on edge connection has developed rapidly in recent years. This type of method obtains edge combinations belonging to the same ellipse feature by screening and reorganizing image edge fragments, and then uses fitting methods to obtain ellipse feature parameters. Since the geometric information of the image is fully utilized, a set of data points belonging to the same ellipse is obtained by combining edge fragments, thereby excluding a large amount of irrelevant data. The detection efficiency of this type of method is generally better than that of the Hough transform detection method. The main problem of the existing methods is that the edge fragment combination link usually adopts an inefficient traversal implementation method. When the image features are complex and the number of edge fragments is large, it takes a long time to construct a combination of edge arc segments that match the same ellipse feature, which makes this link the main shortcoming that affects the further improvement of the overall detection efficiency, restricting the promotion of this type of detection method in practical applications. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] In view of this, the main purpose of the present disclosure is to provide a method for quickly detecting ellipse features and a device for quickly detecting ellipse features to solve the above technical problems.
[0007] (II) Technical solution
[0008] The present disclosure provides a method for rapid detection of ellipse features, the method comprising: extracting edge points of an image, processing the edge points of the image, obtaining n arc segment sets, wherein n is a positive integer greater than 1; obtaining an ellipse matching relationship between each arc segment in two adjacent arc segment sets in the n arc segment sets; wherein the ellipse matching relationship is used to indicate whether each arc segment in two adjacent arc segment sets matches the same ellipse feature; based on the ellipse matching relationship between each arc segment in two adjacent arc segment sets, establishing a two-adjacent arc segment relationship matrix, clustering arc segments belonging to the same ellipse based on the two-adjacent arc segment relationship matrix, obtaining a plurality of arc segment groups, wherein arc segments in each arc segment group match the same ellipse feature; the arc segment relationship matrix is a matrix used to describe the binary relationship of ellipse matching between two arc segment sets; for each arc segment group, calculating ellipse feature parameters using the edge point information of its corresponding image, and verifying and de-false the ellipse feature parameters.
[0009] Optionally, based on the ellipse matching relationship between arcs in two adjacent arc sets, a two-adjacent arc relationship matrix is established, arcs belonging to the same ellipse are clustered based on the two-adjacent arc relationship matrix, and multiple arc groups are obtained, wherein arcs in each arc group match the same ellipse feature, including:
[0010] For two adjacent arc segments According to the arc segment collection To the arc segment set Ellipse matching relationship between arc segments in the , establish arc segment set To the arc set Ellipse matching binary relation R A,B ,satisfy:
[0011]
[0012] Based on arc set To the arc set Ellipse matching binary relation R A,B , construct the two adjacent arc segment relationship matrix M A,B ,satisfy:
[0013] M A,B =(r ij ) m×l ,
[0014] Among them, r ij is the relationship matrix M between two adjacent arc segments A,B The value of each element in r ij satisfy:
[0015]
[0016] Among them, the arc segment set Yang arc segment collection are any two adjacent arc sets in the n arc set, and m is the arc set The number of arcs in, l is the arc set The number of arcs in ; Represents a collection of arcs The i-th arc segment in Represents a collection of arcs The jth arc segment in ; Represents the arc segment set and segment collection Take one arc segment from each of the two arc segments to form an arc pair;
[0017] For a set of n arc segments, construct n two-adjacent arc segment relationship matrices M 1,2 , , M 2,3 , …, M n-1,n 、M n,1 According to the binary relation compound operation rule, find the three-adjacent arc segment relationship matrix M of n sets of three adjacent arc segments 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 , which satisfies:
[0018]
[0019] Among them, the symbol Represents the Boolean multiplication operator; M 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 They represent the three-adjacent arc relationship matrix containing three adjacent arc sets respectively; n is the number of arc sets;
[0020] By analogy, construct n α-adjacent arc segment relationship matrices containing any number of adjacent arc segment sets, where α represents the number of adjacent arc segment sets corresponding to each arc segment relationship matrix; obtain the α-adjacent arc segment relationship matrix to obtain n arc segment group sets, where each arc segment group set corresponds to α specific adjacent arc segment sets, each element in each arc segment group set is an arc segment from an adjacent arc segment set in the n arc segment sets, and the arc segments match the same elliptical feature.
[0021] Optionally, the ellipse matching relationship between each arc segment in two adjacent arc segment sets in n arc segment sets is obtained, including: taking one arc segment from each of the two adjacent arc segment sets, and determining the ellipse matching relationship between the two arc segments; executing the above steps, traversing all arc segments in the two adjacent arc segment sets, and obtaining the ellipse matching relationship between each arc segment in the two adjacent arc segment sets.
[0022] Optionally, one or more of a criterion based on area constraints, a criterion based on endpoint continuity, a criterion based on arc segment geometric properties, or a criterion based on Pascal's theorem is used to determine the ellipse matching relationship between two arc segments.
[0023] Optionally, edge points of the image are extracted, and the edge points of the image are processed to obtain n arc segment sets, including: extracting edge points of the image, connecting the edge points after denoising into edge segments using an edge tracking method; eliminating invalid edge segments according to the geometric features of the edge segments, and dividing the arc segments obtained after elimination into n arc segment sets.
[0024] Optionally, the method of extracting edge points of an image includes a Canny operator, a Laplacian operator, and a LOG operator.
[0025] Optionally, the edge tracking method includes a 4-neighborhood edge tracking method, an 8-neighborhood edge tracking method, and a region growing-based edge tracking method.
[0026] Optionally, one or more of a straight line segment exclusion method, a broken line segment exclusion method or a short segment exclusion method is used to eliminate invalid edge segments.
[0027] Optionally, the n arc segment sets are divided based on at least one of the quadrants to which the arc segments belong, convexity or concavity, length, coordinate position, curvature, slope, and connectivity of edge points.
[0028] Another aspect of the present disclosure provides an ellipse feature rapid detection device, which includes: an ellipse arc segment acquisition module, which is used to extract edge points of an image, process the edge points of the image, and obtain n arc segment sets, wherein n is a positive integer greater than 1; an ellipse arc segment matching module, which is used to obtain the ellipse matching relationship between each arc segment in two adjacent arc segment sets in the n arc segment sets; wherein the ellipse matching relationship is used to indicate whether each arc segment in two adjacent arc segment sets matches the same ellipse feature; arc segment grouping and feature determination, which is used to establish a two-adjacent arc segment relationship matrix based on the ellipse matching relationship between each arc segment in two adjacent arc segment sets, cluster arc segments belonging to the same ellipse based on the two-adjacent arc segment relationship matrix, and obtain multiple arc segment groups, wherein the arc segments in each arc segment group match the same ellipse feature; the arc segment relationship matrix is a matrix used to describe the binary relationship of ellipse matching between two arc segment sets; an ellipse feature determination module, which is used to calculate the ellipse feature parameters for each arc segment group using the edge point information of its corresponding image, and verify and remove the ellipse feature parameters.
[0029] Another aspect of the present disclosure provides an electronic device, which includes a processor and a memory, wherein at least one instruction is stored in the memory, and when the instruction is executed by the processor, the method described above is implemented.
[0030] Another aspect of the present disclosure provides a computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and when the instruction is executed by a processor, the method described above is implemented.
[0031] (III) Beneficial effects
[0032] Compared with the prior art, the method and device for rapid detection of elliptical features proposed in the present disclosure have the following beneficial effects:
[0033] (1) The ellipse feature rapid detection method disclosed in the present invention constructs an arc segment relationship matrix based on the geometric properties of the image edge arc segments, and uses the arc segment relationship matrix to complete the clustering of arc segments matching the same ellipse feature, thereby quickly obtaining an ellipse fitting data set containing multiple edge arc segments, which can significantly improve the overall efficiency of the ellipse feature detection process and save the time of ellipse feature detection.
[0034] (2) The ellipse feature rapid detection method and device disclosed in the present invention are compatible with most existing edge connection-based ellipse feature detection methods in terms of the overall detection process. Therefore, the idea of the ellipse feature rapid detection method disclosed in the present invention can be used to optimize the ellipse feature detection efficiency of the above-mentioned existing methods, thereby improving their detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 The flowchart of the method for rapid detection of ellipse features in the embodiment of the present disclosure is schematically shown.
[0036] Figure 2 A flowchart of a method for rapid detection of ellipse features in another embodiment of the present disclosure is schematically shown.
[0037] Figure 3 A flowchart of a method for rapid detection of ellipse features in another embodiment of the present disclosure is schematically shown.
[0038] Figure 4 A flowchart of a method for rapid detection of ellipse features in another embodiment of the present disclosure is schematically shown.
[0039] Figure 5A A block diagram of a device for rapid detection of elliptical features in an embodiment of the present disclosure is schematically shown.
[0040] Figure 5B A block diagram of a device for rapid detection of elliptical features in another embodiment of the present disclosure is schematically shown.
[0041] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0042] In order to make the technical problems solved by the present disclosure, the technical solutions adopted and the technical effects achieved more clearly, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are only used to explain the present disclosure, rather than to limit the present disclosure. In addition, it should be noted that, for the convenience of description, only the parts related to the present disclosure are shown in the accompanying drawings, rather than all the contents.
[0043] The circle is the basic curve primitive in the geometric pattern and the basic geometric shape of objects, such as the positioning holes on various workpieces and parts. Circular features are widely used in the field of machine vision, such as camera calibration based on circular hole targets, robot automatic guidance based on circular features, object spatial position and posture measurement, visual navigation, and target object recognition. The perspective projection of a circle often appears as an elliptical feature, so it is of great significance to study the detection method of elliptical features in images.
[0044] However, as introduced in the background technology, the existing technology still has some problems in ellipse feature detection technology. For example, the edge segment combination link usually adopts an inefficient traversal implementation method. When the image features are complex and the number of edge segments is large, it takes a long time to construct a combination of edge arc segments that match the same ellipse feature, which makes this link the main shortcoming that affects the further improvement of the overall detection efficiency. Based on this, the present disclosure proposes a method and device for rapid detection of ellipse features.
[0045] Figure 1 The flowchart of the method for rapid detection of ellipse features in the embodiment of the present disclosure is schematically shown. Figure 1 As shown, the method includes steps S110 to S140.
[0046] In step S110, edge points of the image are extracted and processed to obtain n arc segment sets, where n is a positive integer greater than 1.
[0047] In step S120, the ellipse matching relationship between the arc segments in two adjacent arc segment sets in the n arc segment sets is obtained; wherein the ellipse matching relationship is used to indicate whether the arc segments in two adjacent arc segment sets match the same ellipse feature.
[0048] In step S130, based on the ellipse matching relationship between the arc segments in two adjacent arc segment sets, two adjacent arc segment relationship matrices are established, and arc segments belonging to the same ellipse are clustered based on the two adjacent arc segment relationship matrices to obtain multiple arc segment groups, wherein the arc segments in each arc segment group match the same ellipse feature; the arc segment relationship matrix is a matrix used to describe the binary relationship of ellipse matching between two arc segment sets.
[0049] In step S140, for each arc segment group, the edge point information of the corresponding image is used to calculate the ellipse feature parameters, and the ellipse feature parameters are verified and de-falsified.
[0050] According to the embodiments of the present disclosure, an arc segment relationship matrix is constructed based on the geometric properties of image edge arc segments, and the arc segment relationship matrix is used to complete the clustering of arc segments matching the same ellipse feature, so as to quickly obtain an ellipse fitting data set containing multiple edge arc segments, which can significantly improve the overall efficiency of the ellipse feature detection process and save the time of ellipse feature detection.
[0051] Figure 2 A flowchart of a method for rapid detection of ellipse features in another embodiment of the present disclosure is schematically shown.
[0052] like Figure 2 As shown, the above step S110 also includes steps S111 to S112.
[0053] In step S111, edge points of the image are extracted, and the edge points after denoising are connected into edge segments using an edge tracking method.
[0054] Specifically, after acquiring the image of the target object, it is necessary to first extract the edge points of the image and denoise the extracted edge points, so that some interfering edge points can be filtered out, and then the edge point information effective for ellipse feature detection can be obtained. Subsequently, the denoised edge points are connected into edge segments using the edge tracking method.
[0055] According to the embodiment of the present disclosure, the method of extracting edge points of an image includes but is not limited to the Canny operator, the Laplacian operator, the LOG operator, etc. In the embodiment of the present disclosure, one or more of the above methods, or other methods for extracting edge points of an image in the prior art, may be used to extract edge points, which are not limited here.
[0056] In addition, according to the embodiment of the present disclosure, the edge tracking method includes but is not limited to a 4-neighborhood edge tracking method, an 8-neighborhood edge tracking method, an edge tracking method based on region growth, etc. In the embodiment of the present disclosure, one or more of the above edge tracking methods, or other commonly used edge tracking methods in the prior art, may be used to process the edge points after denoising to obtain continuous edge segments, which is not limited here.
[0057] In step S112, invalid edge segments are eliminated according to the geometric features of the edge segments, and the arc segments obtained after the elimination are divided into n arc segment sets.
[0058] In ellipse feature detection, an ellipse can be understood as a geometric shape composed of multiple continuous arc segments. The edge segments obtained after denoising in step S111 may contain some invalid edge segments (such as straight line segments, short line segments, etc.), so these edge segments need to be further processed to obtain the arc segments required for ellipse feature detection.
[0059] Specifically, according to the embodiment of the present disclosure, for the invalid edge segments such as straight line segments, broken line segments, short line segments, etc. in the edge segments, one or more of the straight line segment exclusion method, broken line segment exclusion method, or short segment exclusion method can be used to eliminate them, and then multiple arc segments are obtained. Subsequently, the multiple arc segments are divided into n (where n is a positive integer greater than 1) arc segment sets using the geometric features of the arc segments. Each arc segment set includes several arc segments. According to the embodiment of the present disclosure, the arc segment set can be divided based on the quadrant to which the arc segment belongs, convexity, length, coordinate position, curvature, slope, connectivity of edge points, etc. For example, if the convexity of two arc segments is consistent, the two arc segments can be used as candidate arcs of the same arc segment set, and then judged in combination with the geometric features of other arc segments.
[0060] Figure 3 A flowchart of a method for rapid detection of ellipse features in another embodiment of the present disclosure is schematically shown.
[0061] like Figure 3 As shown, the above step S120 also includes steps S121 to S122.
[0062] In step S121, one arc segment is selected from each of the two adjacent arc segment sets to determine the ellipse matching relationship between the two arc segments. Specifically, in the disclosed embodiment, one or more of the criteria based on region constraints, the criteria based on endpoint continuity, the criteria based on arc segment geometric properties, or the criteria based on Pascal's theorem can be used to determine the ellipse matching relationship between the two arc segments.
[0063] In step S122, the above step S121 is executed to traverse all arc segments in the set of two adjacent arc segments, and obtain the ellipse matching relationship between the arc segments in the set of two adjacent arc segments.
[0064] According to the embodiments of the present disclosure, based on the judgment of the ellipse matching relationship between two arc segments, the ellipse matching relationship between each arc segment in two adjacent arc segment sets in n arc segment sets can be obtained, that is, based on the judgment of the ellipse matching relationship between two arc segments, it can be known whether each arc segment in two adjacent arc segment sets in n arc segment sets matches the same ellipse feature.
[0065] Figure 4 A flowchart of a method for rapid detection of ellipse features in another embodiment of the present disclosure is schematically shown.
[0066] like Figure 4 As shown, in the above step S130, steps S131 to S133 are also included.
[0067] In step S131, for two adjacent arc segments, According to the arc segment collection To the arc set Ellipse matching relationship between arc segments in the , establish arc segment set To the arc set Ellipse matching binary relation R A,B , where R A,B satisfy:
[0068]
[0069] Based on arc set To the arc set Ellipse matching binary relation R A,B , construct the two adjacent arc segment relationship matrix M A,B , which satisfies:
[0070] M A,B =(r ij ) m×l ,
[0071] Among them, r ij is the relationship matrix M between two adjacent arc segments A,B The value of each element in r ij satisfy:
[0072]
[0073] Among them, the arc segment set and segment collection There are n arc segments respectively Any two adjacent arc sets in , m is the arc set The number of arcs in the sum, l is the arc set The number of arcs in ; Represents a collection of arcs The i-th arc segment in Represents a collection of arcs The jth arc segment in ; Represents the arc segment set Yang arc segment collection Take one arc segment from each arc segment to form an arc pair.
[0074] Specifically, the relationship matrix M of two adjacent arc segments is A,B The element r ij Represents arc pair The ellipse matching relationship between the two arc segments in the ij =1, it means the arc segment is The two arc segments in the equation match the same ellipse feature (referred to as “ellipse matching”), that is, the two arc segments can belong to the same ellipse; if r ij = 0, it means the arc segment is The two arc segments in do not match the same ellipse feature (recorded as “ellipse mismatch”), that is, the two arc segments do not belong to the same ellipse.
[0075] According to an embodiment of the present disclosure, based on the above two adjacent arc segment relationship matrices, arc segments in two adjacent arc segment sets among n arc segment sets that match the same elliptical feature can be obtained.
[0076] According to the above method, in step S132, arcs belonging to the same ellipse in three adjacent arc sets in the n arc sets are clustered, and arcs matching the same ellipse features in three adjacent arc sets in the n arc sets are obtained.
[0077] In step S132, for the n arc segments, the method of step S131 is referred to to construct n two-adjacent arc segment relationship matrices M 1,2 , , M 2,3 , …, M n-1,n 、M n,1 According to the binary relation compound operation rule, find the three-adjacent arc segment relationship matrix M of n sets of three adjacent arc segments 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 , which satisfies:
[0078]
[0079] Among them, the symbol Represents the Boolean multiplication operator; M 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 They respectively represent the three-adjacent arc relationship matrix containing three adjacent arc sets; n is the number of arc sets.
[0080] In step S133, according to the above steps, and by analogy, n α-adjacent arc segment relationship matrices containing any number of adjacent arc segment sets are constructed, where α represents the number of adjacent arc segment sets corresponding to each arc segment relationship matrix. By obtaining the α-adjacent arc segment relationship matrix, n arc segment group sets G can be obtained. 1 (α) , G 2 (α) , G3 (α) , …, G n (α) , where each arc segment group set G k (α) Corresponding to a specific set of adjacent arcs Among them, each arc group set G k (α) Each element is an arc segment from an adjacent arc segment set in the n arc segment sets, and these arc segments match the same ellipse feature.
[0081] From the meaning of the arc relationship matrix above, we can know that each "1" value element in the α-adjacent arc relationship matrix indicates that there is an arc group with an ellipse matching relationship consisting of α adjacent arc sets, for example, M 1,2,3 (i, j) = 1 means there is a three-arc segment group With ellipse matching relationship, three arc segments Belong to three different arc sets respectively i, x, and j represent the serial numbers of the three arcs in the three-arc group in their respective arc sets, where i and j are the same as the matrix subscript values, and x can be obtained in the Boolean operation process of obtaining the three-adjacent arc relationship matrix. For example, each "1" value element in the four-adjacent arc relationship matrix indicates that there is a four-arc group with an ellipse matching relationship. Four of the arcs Belong to four different arc sets respectively And i, x 1 、x 2 The meaning and calculation method of j are similar to those of the three-adjacent arc segment relationship matrix and will not be repeated here.
[0082] By obtaining the α-adjacent arc segment relationship matrix, we can obtain the n arc segment group set G 1 (α) , G 2 (α) , G 3 (α) , …, G n (α) , where each arc segment set G k (α) Corresponding to a specific set of adjacent arcs Each arc segment group set G k (α) Each element in is an arc segment from the adjacent arc segment set in the above n arc segment sets, and these arc segments match the same ellipse feature. Therefore, by taking the union Φ of all n arc segment sets, the data points used to obtain the ellipse parameters can be obtained.
[0083] According to an embodiment of the present disclosure, in the above step S130, arc segment clustering matching the same ellipse feature in a set of n arc segments can be completed based on a two-adjacent arc segment relationship matrix, thereby quickly obtaining an ellipse fitting data set containing multiple arc segments. This not only significantly improves the overall efficiency of the ellipse feature detection process and saves the time for ellipse feature detection, but also makes the ellipse determined based on the ellipse fitting data set of multiple arc segments more accurate.
[0084] According to an embodiment of the present disclosure, in the above step S140, for each arc segment group, the edge point information of the corresponding image is used to calculate the ellipse feature parameters, and the ellipse feature parameters are verified and de-falsified.
[0085] Specifically, for each arc segment group element in the above set Φ, a series of corresponding image edge point information (such as coordinate information) can be obtained, and then the five parameters of the ellipse feature can be calculated by commonly used ellipse parameter calculation methods, such as least squares fitting, chord midpoint connection, etc. Then, the ellipse parameter verification and false removal are performed using geometric features such as the center point position, the major and minor axis ratio, and the data point error value corresponding to the ellipse feature parameters, so as to obtain the final detection result.
[0086] In the disclosed embodiment, for each arc segment group, the edge point information of the corresponding image is used to calculate the ellipse feature parameters, and the process of verifying and de-counterfeiting the ellipse feature parameters is not limited to the above description. The processing of the above process can also adopt the same method as the prior art, which will not be repeated here.
[0087] In addition, the ellipse feature rapid detection method disclosed in the present invention is compatible with most existing edge connection-based ellipse feature detection methods in terms of the overall detection process. Therefore, the idea of the ellipse feature rapid detection method disclosed in the present invention can be used to optimize the ellipse feature detection efficiency of the existing methods, thereby improving their detection efficiency.
[0088] Figure 5A and Figure 5B A block diagram of a device for rapid detection of elliptical features in an embodiment of the present disclosure is schematically shown.
[0089] like Figure 5A As shown, the ellipse feature rapid detection device 500 includes an ellipse arc segment acquisition module 510, an ellipse arc segment matching module 520, an arc segment grouping feature determination module 530, and an ellipse feature determination module 540.
[0090] The elliptical arc segment acquisition module 510 is used to extract edge points of the image, process the edge points of the image, and obtain a set of n arc segments, where n is a positive integer greater than 1.
[0091] The ellipse arc segment matching module 520 is used to obtain the ellipse matching relationship between the arc segments in two adjacent arc segment sets in the n arc segment sets; wherein the ellipse matching relationship is used to indicate whether the arc segments in two adjacent arc segment sets match the same ellipse feature.
[0092] The arc segment grouping determination feature 530 is used to establish a two-adjacent arc segment relationship matrix based on the ellipse matching relationship between each arc segment in two adjacent arc segment sets, cluster the arc segments belonging to the same ellipse based on the two-adjacent arc segment relationship matrix, and obtain multiple arc segment groups, wherein the arc segments in each arc segment group match the same ellipse feature; wherein the arc segment relationship matrix is a matrix used to describe the binary relationship of ellipse matching between two arc segment sets.
[0093] The ellipse feature determination module 540 is used to calculate the ellipse feature parameters for each arc segment group using the edge point information of the corresponding image, and to verify and remove false information from the ellipse feature parameters.
[0094] like Figure 5B As shown, the ellipse feature rapid detection device 500 also includes a storage module 550.
[0095] The storage module 550 is used to store data input and output in the elliptical arc segment acquisition module 510, the elliptical arc segment matching module 520, the arc segment grouping determination feature 530 and the elliptical feature determination module 540 during the elliptical feature detection process. The data includes, for example, edge point information of the image acquired by the elliptical arc segment acquisition module 510 and n arc segment sets acquired after processing by the elliptical arc segment acquisition module 510, the elliptical matching relationship between each arc segment in two adjacent arc segment sets in the n arc segment sets output by the elliptical arc segment matching module 520, multiple arc segment groups matching the same elliptical feature output by the arc segment grouping determination feature 530, and the like.
[0096] According to an embodiment of the present disclosure, any multiple of modules, submodules, units, subunits, or at least part of the functions of any multiple of them can be implemented in one module. According to any one or more of the modules, submodules, units, and subunits of the embodiments of the present disclosure, they can be split into multiple modules for implementation. According to any one or more of the modules, submodules, units, and subunits of the embodiments of the present disclosure, they can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to one or more of the modules, submodules, units, and subunits of the embodiments of the present disclosure, they can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0097] For example, any multiple of the elliptical arc segment acquisition module 510, the elliptical arc segment matching module 520, the arc segment grouping determination feature 530, the elliptical feature determination module 540, and the storage module 550 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the elliptical arc segment acquisition module 510, the elliptical arc segment matching module 520, the arc segment grouping determination feature 530, the elliptical feature determination module 540, and the storage module 550 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in an appropriate combination of any of them. Alternatively, at least one of the elliptical arc segment acquisition module 510, the elliptical arc segment matching module 520, the arc segment grouping determination feature 530, the elliptical feature determination module 540, and the storage module 550 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be executed.
[0098] Figure 6 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0099] like Figure 6 As shown, the electronic device 600 includes a processor 610 and a computer-readable storage medium 620. The electronic device 600 can execute the method according to the embodiment of the present disclosure.
[0100] Specifically, the processor 610 may include, for example, a general-purpose microprocessor, an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 610 may also include an onboard memory for cache purposes. The processor 610 may be a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0101] The computer-readable storage medium 620 may be, for example, a non-volatile computer-readable storage medium, and specific examples include but are not limited to: a magnetic storage device, such as a magnetic tape or a hard disk (HDD); an optical storage device, such as a compact disk (CD-ROM); a memory, such as a random access memory (RAM) or flash memory; and the like.
[0102] The computer-readable storage medium 620 may include a computer program 621 , which may include code / computer-executable instructions that, when executed by the processor 610 , cause the processor 610 to perform a method according to an embodiment of the present disclosure or any variation thereof.
[0103] The computer program 621 may be configured to have, for example, a computer program code including a computer program module. For example, in an example embodiment, the code in the computer program 621 may include one or more program modules, for example, including a module 621A, a module 621B, ... It should be noted that the division method and number of modules are not fixed, and those skilled in the art may use appropriate program modules or program module combinations according to actual conditions, and when these program module combinations are executed by the processor 610, the processor 610 may execute the method according to the embodiment of the present disclosure or any variation thereof.
[0104] According to an embodiment of the present invention, at least one of the ellipse arc segment acquisition module 510, the ellipse arc segment matching module 520, the arc segment grouping determination feature 530, the ellipse feature determination module 540, and the storage module 550 can be implemented as a reference Figure 6 The computer program modules described herein, when executed by the processor 610, can implement the corresponding operations described above.
[0105] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0106] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0107] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0109] Although the present disclosure has been shown and described with reference to specific exemplary embodiments of the present disclosure, it should be understood by those skilled in the art that various changes in form and details may be made to the present disclosure without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents. Therefore, the scope of the present disclosure should not be limited to the above-mentioned embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.
Claims
1. A method for rapid detection of ellipse features, characterized in that: include: Extract edge points of the image, process the edge points of the image, and obtain n arc segment sets, where n is a positive integer greater than 1; Obtaining an ellipse matching relationship between arc segments in two adjacent arc segment sets in the n arc segment sets; wherein the ellipse matching relationship is used to indicate whether the arc segments in the two adjacent arc segment sets match the same ellipse feature; Based on the ellipse matching relationship between the arc segments in the two adjacent arc segment sets, a two-adjacent arc segment relationship matrix is established, arc segments belonging to the same ellipse are clustered based on the two-adjacent arc segment relationship matrix to obtain multiple arc segment groups, wherein the arc segments in each arc segment group are matched with the same ellipse feature; the arc segment relationship matrix is a matrix used to describe the binary relationship of ellipse matching between the two arc segment sets; For each of the arc segment groups, the edge point information of the corresponding image is used to calculate the ellipse feature parameters, and the ellipse feature parameters are verified and de-falsified. The step of establishing a two-adjacent arc segment relationship matrix based on the ellipse matching relationship between the arc segments in the two adjacent arc segment sets, clustering the arc segments belonging to the same ellipse based on the two adjacent arc segment relationship matrix, and obtaining a plurality of arc segment groups, wherein the arc segments in each of the arc segment groups match the same ellipse feature, includes: For two adjacent arc segments , , according to the arc segment set To the arc set The ellipse matching relationship between the arc segments in the example is used to establish the arc segment set. To the arc segment set Ellipse matching binary relation ,satisfy: , Based on the arc segment set To the arc segment set Ellipse matching binary relation , construct the two adjacent arc segment relationship matrix M A,B ,satisfy: , in, is the relationship matrix M between the two adjacent arc segments A,B The value of each element in satisfy: , Among them, the arc segment set and the arc segment set are any two adjacent arc sets in the n arc set, and m is the arc set The number of arcs in, l is the arc set The number of arcs in ; Represents the arc segment set The i-th arc segment in Represents the arc segment set The jth arc segment in ; Represents the set of arcs and the arc segment set Take one arc segment from each of the two arc segments to form an arc pair; For a set of n arc segments, construct n two-adjacent arc segment relationship matrices M 1,2 、M 2,3 , …, M n-1,n 、M n,1 According to the binary relation compound operation rule, find the three-adjacent arc segment relationship matrix M of n sets of three adjacent arc segments 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 , which satisfies: , Among them, the symbol " " represents the Boolean multiplication operator; M 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 They represent the three-adjacent arc relationship matrix containing three adjacent arc sets respectively; n is the number of arc sets; By analogy, n α-adjacent arc segment relationship matrices containing any number of adjacent arc segment sets are constructed, wherein α represents the number of adjacent arc segment sets corresponding to each arc segment relationship matrix; the α-adjacent arc segment relationship matrix is obtained to obtain n arc segment group sets, wherein each arc segment group set corresponds to α specific adjacent arc segment sets, each element in each arc segment group set is an arc segment from an adjacent arc segment set in the n arc segment sets, and the arc segments match the same elliptical feature.
2. The method according to claim 1, characterized in that: The obtaining of the ellipse matching relationship between arc segments in two adjacent arc segment sets in the n arc segment sets includes: Take one arc segment from each of the two adjacent arc segment sets and determine the ellipse matching relationship between the two arc segments; Execute the above steps, traverse all arc segments in the set of two adjacent arc segments, and obtain the ellipse matching relationship between the arc segments in the set of two adjacent arc segments.
3. The method according to claim 2, characterized in that The ellipse matching relationship between two arc segments is determined by using one or more of the criteria based on region constraints, the criteria based on endpoint continuity, the criteria based on arc segment geometry properties, or the criteria based on Pascal's theorem.
4. The method according to claim 1, characterized in that: The step of extracting edge points of an image and processing the edge points of the image to obtain a set of n arc segments includes: Extract the edge points of the image, and connect the denoised edge points into edge segments using the edge tracking method; Invalid edge segments are eliminated according to the geometric features of the edge segments, and the arc segments obtained after the elimination are divided into n arc segment sets.
5. The method according to claim 4, characterized in that The method for extracting edge points of an image includes a Canny operator, a Laplacian operator, and a LOG operator.
6. The method according to claim 4, characterized in that The edge tracking method includes a 4-neighborhood edge tracking method, an 8-neighborhood edge tracking method, and an edge tracking method based on region growth.
7. The method according to claim 4, characterized in that One or more of a straight line segment exclusion method, a broken line segment exclusion method or a short segment exclusion method is used to eliminate the invalid edge segments.
8. The method according to claim 4, characterized in that The n arc segment sets are divided based on at least one of the quadrants to which the arc segments belong, convexity or concavity, length, coordinate position, curvature, slope, and connectivity of edge points.
9. An ellipse feature rapid detection device, characterized in that: The device comprises: An ellipse arc segment acquisition module, used to extract edge points of an image, process the edge points of the image, and acquire a set of n arc segments, where n is a positive integer greater than 1; An ellipse arc segment matching module, used for obtaining an ellipse matching relationship between arc segments in two adjacent arc segment sets in the n arc segment sets; wherein the ellipse matching relationship is used for indicating whether the arc segments in two adjacent arc segment sets match the same ellipse feature; The arc segment grouping determines the feature, which is used to establish two adjacent arc segment relationship matrices based on the ellipse matching relationship between the arc segments in the two adjacent arc segment sets, cluster the arc segments belonging to the same ellipse based on the two adjacent arc segment relationship matrix, and obtain multiple arc segment groups, wherein the arc segments in each of the arc segment groups match the same ellipse feature; the arc segment relationship matrix is a matrix used to describe the binary relationship of ellipse matching between two arc segment sets; The ellipse feature determination module is used to calculate the ellipse feature parameters for each of the arc segment groups using the edge point information of the corresponding image, and to verify and remove the ellipse feature parameters. The step of establishing a two-adjacent arc segment relationship matrix based on the ellipse matching relationship between the arc segments in the two adjacent arc segment sets, clustering the arc segments belonging to the same ellipse based on the two adjacent arc segment relationship matrix, and obtaining a plurality of arc segment groups, wherein the arc segments in each of the arc segment groups match the same ellipse feature, includes: For two adjacent arc segments , , according to the arc segment set To the arc set The ellipse matching relationship between the arc segments in the example is used to establish the arc segment set. To the arc segment set Ellipse matching binary relation ,satisfy: , Based on the arc segment set To the arc segment set Ellipse matching binary relation , construct the two adjacent arc segment relationship matrix M A,B ,satisfy: , in, is the relationship matrix M between the two adjacent arc segments A,B The value of each element in satisfy: , Among them, the arc segment set and the arc segment set are any two adjacent arc sets in the n arc set, and m is the arc set The number of arcs in, l is the arc set The number of arcs in ; Represents the arc segment set The i-th arc segment in Represents the arc segment set The jth arc segment in ; Represents the set of arcs and the arc segment set Take an arc pair from each arc segment; for n arc sets, construct n two-adjacent arc relationship matrices M 1,2 、M 2,3 , …, M n-1,n 、M n,1 According to the binary relation compound operation rule, find the three-adjacent arc segment relationship matrix M of n sets of three adjacent arc segments 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 , which satisfies: , Among them, the symbol " " represents the Boolean multiplication operator; M 1,2,3 、M 2,3,4 , …, M n-2,n-1,n 、M n-1,n,1 、M n,1,2 They represent the three-adjacent arc relationship matrix containing three adjacent arc sets respectively; n is the number of arc sets; By analogy, n α-adjacent arc segment relationship matrices containing any number of adjacent arc segment sets are constructed, wherein α represents the number of adjacent arc segment sets corresponding to each arc segment relationship matrix; the α-adjacent arc segment relationship matrix is obtained to obtain n arc segment group sets, wherein each arc segment group set corresponds to α specific adjacent arc segment sets, each element in each arc segment group set is an arc segment from an adjacent arc segment set in the n arc segment sets, and the arc segments match the same elliptical feature.
