Image Edge Matching Method, Device, Computer Equipment and Storage Medium

By performing pyramid compression and angle template screening on the target image, and using the target gradient information to perform edge gradient matching, the problem of large amount of image matching calculation in the prior art is solved, and matching efficiency and accuracy are improved.

CN114092725BActive Publication Date: 2025-06-03HANS LASER TECH IND GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010751229.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-30
Publication Date
2025-06-03
Estimated Expiration
2040-07-30

AI Technical Summary

Technical Problem

The prior art has a large amount of calculation in the image matching process, especially in the angle template matching process, it is difficult to meet the requirements of actual projects.

Method used

By performing pyramid compression processing on the target image, the target gradient information is obtained, and the pre-created multiple angle templates are filtered according to the search matching parameters to determine the template to be matched and its corresponding edge gradient information. Then, the target gradient information is used to match multiple edge gradient information to be matched, the edge matching degree is obtained, and the best matching position and angle are determined.

Benefits of technology

The calculation amount in the image matching process is reduced, the efficiency and accuracy of image edge matching are improved, and the target image can be matched more effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114092725B_ABST
    Figure CN114092725B_ABST
Patent Text Reader

Abstract

The present invention discloses an image edge matching method, device, computer device, and storage medium. The image edge matching method includes: obtaining an image matching request, where the image matching request includes a target image and search matching parameters; performing pyramid compression processing on the target image to obtain target gradient information corresponding to the target image; screening a plurality of pre-created angular templates according to the search matching parameters to determine a template to be matched and corresponding edge gradient information to be matched with the template to be matched; using the target gradient information to match the plurality of edge gradient information to be matched, obtaining an edge matching degree corresponding to each edge gradient information to be matched, and determining an optimal matching position and an optimal matching angle according to the edge matching degree. This technical solution determines the optimal matching position and the optimal matching angle according to the edge matching degree, improving the edge matching efficiency and matching accuracy of the target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to an image edge matching method, device, computer device and storage medium. Background Art

[0002] Existing open-source image matching algorithms are generally pixel-based template matching, which is particularly vulnerable to the influence of illumination, with relatively average matching accuracy. At the same time, the template image needs to be globally matched, resulting in a particularly large amount of calculation. In the process of requiring angular template matching, it is difficult to meet the requirements of actual projects.

[0003] Existing image matching algorithms using edge feature matching have improved accuracy, but the information possessed by the image edge features is still relatively small and is still relatively sensitive in the presence of burr interference; or in the process of edge feature matching by the image matching algorithm, the invariant moments of the template image are used for matching, and this method requires matching the entire template image, resulting in a large amount of calculation. Summary of the Invention

[0004] Embodiments of the present invention provide an image edge matching method, device, computer device and storage medium to solve the problem of large calculation amount when matching images.

[0005] An image edge matching method includes:

[0006] Obtain an image matching request, where the image matching request includes a target image and search matching parameters:

[0007] Perform pyramid compression processing on the target image to obtain target gradient information corresponding to the target image;

[0008] According to the search matching parameters, screen a plurality of pre-created angular templates to determine a template to be matched and corresponding edge gradient information to be matched with the template to be matched;

[0009] Use the target gradient information to match a plurality of the edge gradient information to be matched, obtain an edge matching degree corresponding to each edge gradient information to be matched, and determine the best matching position and the best matching angle according to the edge matching degree.

[0010] Further, before obtaining the image matching request, the image edge matching method further includes the following steps:

[0011] Obtain a template creation request, where the template creation request includes a template image and template creation parameters;

[0012] Use an edge extraction algorithm to extract the edge of the template image to obtain a template edge corresponding to the template image;

[0013] Create parameters according to the template, perform pyramid compression processing and angular rotation processing on the edge of the template, obtain the template edge gradient information corresponding to multiple angular templates, and save the template edge gradient information corresponding to the multiple angular templates as an edge array.

[0014] Further, the template creation parameters include the number of pyramid compression layers N, the starting rotation angle A1, the ending rotation angle A2, and the angular step L;

[0015] The performing pyramid compression processing and angular rotation processing on the edge of the template according to the template creation parameters to obtain the template edge gradient information corresponding to multiple angular templates includes:

[0016] According to the template creation parameters, adopt a parallel processing flow to perform pyramid compression processing and angular rotation processing on the edge of the template, and obtain the template edge gradient information corresponding to N*(A2 - A1) / L angular templates, where the template edge gradient information includes the template horizontal gradient, the template vertical gradient, and the template arc gradient.

[0017] Further, the performing pyramid compression processing on the target image to obtain the target gradient information corresponding to the target image includes:

[0018] Perform pyramid compression processing on the target image to obtain the target gradient information corresponding to the target image, where the target gradient information includes the target horizontal gradient, the target vertical gradient, and the target arc gradient.

[0019] Further, the search matching parameters include a parameter coincidence factor, a parameter gradient factor, and a parameter acceleration factor;

[0020] The screening the multiple pre-created angular templates according to the search matching parameters to determine the template to be matched and the edge gradient information to be matched corresponding to the template to be matched includes:

[0021] Determine the target edge search range of the current layer according to the parameter acceleration factor;

[0022] Select the angular template within the target edge search range of the current layer according to the parameter coincidence factor and the parameter gradient factor, determine it as the template to be matched, and obtain the edge gradient information to be matched corresponding to the template to be matched.

[0023] Further, the determining the target edge search range of the current layer according to the parameter acceleration factor includes:

[0024] If the current layer is the top layer, determine the target edge search range of the current layer as a global search;

[0025] If the current layer is not the top layer, obtain local search parameters according to the parameter acceleration factor, and determine the target edge search range of the current layer as local search according to the local search parameters.

[0026] Further, the step of using the target gradient information to match multiple pieces of the edge gradient information to be matched to obtain the edge matching degree corresponding to each piece of the edge gradient information to be matched includes:

[0027] Calculate the edge matching degree corresponding to each piece of the edge gradient information to be matched through the following formula:

[0028]

[0029] where D (u,v) is the edge matching degree corresponding to the edge gradient information to be matched, is the template horizontal gradient, is the template vertical gradient, is the template radian gradient, is the target horizontal gradient, is the target vertical gradient, is the target radian gradient.

[0030] An image edge matching device, comprising:

[0031] A matching request acquisition module, configured to acquire an image matching request, where the image matching request includes a target image and search matching parameters:

[0032] A gradient information acquisition module, configured to perform pyramid compression processing on the target image to obtain target gradient information corresponding to the target image;

[0033] A template screening module, configured to screen a plurality of pre-created angle templates according to the search matching parameters to determine a template to be matched and edge gradient information to be matched corresponding to the template to be matched;

[0034] An information matching module, configured to use the target gradient information to match multiple pieces of the edge gradient information to be matched to obtain the edge matching degree corresponding to each piece of the edge gradient information to be matched, and determine the best matching position and the best matching angle according to the edge matching degree.

[0035] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above image edge matching method is implemented.

[0036] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned image edge matching method is implemented.

[0037] For the above-mentioned image edge matching method, device, computer device and storage medium, an image matching request is obtained. The image matching request includes a target image and search matching parameters. Based on the search matching parameters in the image matching request, the image edge matching process can be optimized to improve the efficiency of image edge matching. The target image is subjected to pyramid compression processing to obtain target gradient information corresponding to the target image, and the entire target image is searched according to the target gradient information. Compared with directly searching the entire target image, the efficiency of matching the target image is improved. According to the search matching parameters, multiple pre-created angle templates are screened, and angle templates with a small contribution to the target image matching can be eliminated, reducing the calculation amount when matching the target gradient information corresponding to the target image. Finally, the edge matching degree corresponding to each edge gradient information to be matched is obtained, and the best matching position and the best matching angle are determined according to the edge matching degree, improving the efficiency and accuracy of target image edge matching. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0039] Figure 1 It is a schematic diagram of an application environment of the image edge matching method in an embodiment of the present invention;

[0040] Figure 2 It is a flowchart of the image edge matching method in an embodiment of the present invention;

[0041] Figure 3 It is another flowchart of the image edge matching method in an embodiment of the present invention;

[0042] Figure 4 It is another flowchart of the image edge matching method in an embodiment of the present invention;

[0043] Figure 5 It is another flowchart of the image edge matching method in an embodiment of the present invention;

[0044] Figure 6 It is a schematic diagram of the image edge matching device in an embodiment of the present invention;

[0045] Figure 7It is a schematic diagram of a computer device in an embodiment of the present invention. Detailed implementation manners

[0046] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0047] The image edge matching method provided by the embodiments of the present invention can be applied in the Figure 1 application environment shown as follows. Specifically, the image edge matching method is applied in an image edge matching system, and the image edge matching system includes a Figure 1 client and a server shown as follows. The client communicates with the server through a network and is used to implement image edge matching. Among them, the client is also called the user side, which refers to a program that provides local services for clients corresponding to the server. The client can be installed on but not limited to various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The server can be implemented by an independent server or a server cluster composed of multiple servers. The server obtains an image matching request, and the image matching request includes a target image and search matching parameters. Based on the search matching parameters in the image matching request, the image edge matching process can be optimized to improve the efficiency of image edge matching; perform pyramid compression processing on the target image to obtain the target gradient information corresponding to the target image, and search the entire target image according to the target gradient information. Compared with directly searching the entire target image, the efficiency of matching the target image is improved; according to the search matching parameters, multiple pre-created angle templates are screened, and the angle templates with less contribution to the target image matching can be eliminated, reducing the calculation amount when matching the target gradient information corresponding to the target image; finally, obtain the edge matching degree corresponding to each edge gradient information to be matched, and determine the best matching position and the best matching angle according to the edge matching degree, improving the efficiency and accuracy of target image edge matching.

[0048] In an embodiment, as Figure 2 shown, a kind of image edge matching method is provided. Taking the server in Figure 1 as an example for description, the method includes the following steps:

[0049] S10: Obtain an image matching request, where the image matching request includes a target image and search matching parameters.

[0050] Among them, the image matching request is a request instructing the server to perform matching on a target image. The image matching request includes the target image and search matching parameters. The target image is the image for which image edge matching is required. The search matching parameters are parameters custom-set by the user and are used to improve the efficiency of image edge matching. In this example, in order to reduce the workload during image edge matching and improve the matching speed of image edge matching, the server can optimize the image edge matching process based on the search matching parameters in the image matching request, thereby improving the efficiency of image matching.

[0051] S20: Perform pyramid compression processing on the target image to obtain the target gradient information corresponding to the target image.

[0052] Among them, pyramid compression processing is a process of performing multi-resolution compression processing on the target image. For example, performing pyramid compression processing on the target image to obtain M layers of compressed target images with different resolutions. The target gradient information is the information of the gradients with different resolutions corresponding to the target image obtained by performing pyramid compression processing on the target image.

[0053] Specifically, in response to the image matching request, the server performs pyramid compression processing on the target image to obtain the target gradient information corresponding to the target image. It can be understood that by processing the target image through pyramid compression processing and searching layer by layer when searching the M layers of compressed target images with different resolutions for the entire image of the target image, compared with directly searching the entire image of the target image, the efficiency of matching the target image is improved.

[0054] S30: Screen multiple pre-created angle templates according to the search matching parameters to determine the template to be matched and the edge gradient information to be matched corresponding to the template to be matched.

[0055] Among them, the angle template is a template pre-created by the user and is used to match the target gradient information corresponding to the target image. The template to be matched is the angle template determined after screening from multiple angle templates and is used to match the target image. The edge gradient information to be matched is the edge gradient information corresponding to the template to be matched and is used to match the target image.

[0056] As an example, K pre-created angle templates are provided, where K > 1. To improve the efficiency of edge matching for the target image, first, based on the search matching parameters, the K pre-created angle templates are screened to determine P templates to be matched and P corresponding edge gradient information to be matched for the P templates to be matched, where 1 < P < K. It can be understood that by screening the K pre-created angle templates according to the search matching parameters to select P templates to be matched, the K - P angle templates with relatively low contribution to the matching of the target image are excluded, reducing the computational amount of edge matching for the target gradient information corresponding to the target image and improving the matching efficiency.

[0057] S40: Use the target gradient information to match multiple pieces of edge gradient information to be matched, obtain the edge matching degree corresponding to each piece of edge gradient information to be matched, and determine the best matching position and the best matching angle according to the edge matching degree.

[0058] Among them, the edge matching degree is the matching degree between the target gradient information and the edge gradient information to be matched. The best matching position is the edge coordinate position with the best matching degree with the coordinate position of the edge feature of the target image. The best matching angle is the edge feature angle with the best matching degree with the edge feature angle of the target image.

[0059] As an example, there are P pieces of edge gradient information to be matched. The server uses the target gradient information to match the P pieces of edge gradient information to be matched, obtains the edge matching degrees corresponding to the P pieces of edge gradient information to be matched, selects the maximum value from the P edge matching degrees, and determines the best matching position and the best matching angle. It should be noted that when using the target gradient information to match multiple pieces of edge gradient information to be matched, through the edge points corresponding to the edge features in the edge gradient information to be matched, the edge points corresponding to each gradient (each layer after pyramid compression) of the target gradient information corresponding to the target image are determined. Therefore, only the edge matching degree between the edge points corresponding to the edge features in the edge gradient information to be matched and the edge points corresponding to the edge features of the target image determined according to the edge gradient information to be matched is required, reducing the computational amount of edge matching for the target image and improving the matching efficiency.

[0060] In the image edge matching method provided in this embodiment, an image matching request is obtained. The image matching request includes a target image and search matching parameters. Based on the search matching parameters in the image matching request, the image edge matching process can be optimized to improve the efficiency of image edge matching. The target image is subjected to pyramid compression processing to obtain the target gradient information corresponding to the target image. Searching the entire target image according to the target gradient information improves the efficiency of matching the target image compared to directly searching the entire target image. According to the search matching parameters, multiple pre-created angle templates are filtered, and angle templates with a small contribution to the target image matching can be eliminated, reducing the computational amount when matching the target gradient information corresponding to the target image. Finally, the edge matching degree corresponding to each edge gradient information to be matched is obtained, and the best matching position and the best matching angle are determined according to the edge matching degree, improving the efficiency and accuracy of target image edge matching.

[0061] In one embodiment, as Figure 3 shown, before step S10, that is, before obtaining the image matching request, it includes:

[0062] S101: Obtain a template creation request, where the template creation request includes a template image and template creation parameters.

[0063] Among them, the template creation request is a request instructing the server to create multi-angle templates. The template creation request includes a template image and template creation parameters. The template image is the image used to create the multi-angle templates. The template creation parameters are user-defined parameters used to create multi-angle templates according to user needs.

[0064] S102: Use an edge extraction algorithm to extract the edges of the template image to obtain the template edges corresponding to the template image.

[0065] Among them, the edge extraction algorithm is an algorithm for extracting image edge features. The template edges are the edge features corresponding to the template image.

[0066] As an example, the edge extraction algorithm adopted by the server can be the Canny edge detection algorithm (Canny edge detector). The server uses the Canny edge detection algorithm to extract the edge features of the template image to obtain the template edges corresponding to the template image.

[0067] S103: According to the template creation parameters, perform pyramid compression processing and angle rotation processing on the template edges to obtain the template edge gradient information corresponding to multiple angle templates, and save the template edge gradient information corresponding to the multiple angle templates as an edge array.

[0068] Among them, the multi-angle rotation process is a processing method of rotating the template edge according to a preset rotation angle. The template edge gradient information is the gradient information corresponding to the target image edge feature obtained by performing pyramid compression processing and angle rotation processing on the template edge. The edge array is an array for storing the template edge gradient information.

[0069] As an example, assume that the number of rotation angles for rotating the template edge of each layer is S. Then, the server first performs pyramid compression processing on the template edge according to the template creation parameters to obtain M layers of template edges with different resolutions. Next, the server performs multi-angle rotation processing on the template edges of different resolutions in the i-th layer (1 ≤ i ≤ M) to obtain the template edges of the j-th angle (1 ≤ j ≤ S) in the i-th layer corresponding to the template image of the j-th angle in the i-th layer. Finally, the angles of the template edges of the j-th angle in the i-th layer among the M layers of template edges are rotated to obtain the template edge gradient information corresponding to multiple angle templates, and it is saved as the edge array.

[0070] In this embodiment, the server first uses an edge extraction algorithm to extract the edges of the template image to obtain the template edges corresponding to the template image. Since the edge features of the template image have less image feature information, the server needs to perform pyramid compression processing and angle rotation processing on the template edges according to the template creation parameters to obtain the template edge gradient information corresponding to multiple angle templates. The template edge gradient information can obtain more image feature information, improving the anti-interference ability and accuracy in edge matching of the target image.

[0071] In one embodiment, in step S101, that is, the template creation parameters include the number of pyramid compression layers N, the rotation start angle A1, the rotation end angle A2, and the angle step L. In step S103, according to the template creation parameters, performing pyramid compression processing and angle rotation processing on the template edge to obtain the template edge gradient information corresponding to multiple angle templates includes: according to the template creation parameters, using a parallel processing flow to perform pyramid compression processing and angle rotation processing on the template edge to obtain the template edge gradient information corresponding to N*(A2 - A1) / L angle templates, where the template edge gradient information includes the template horizontal gradient, the template vertical gradient, and the template arc gradient.

[0072] Among them, the parallel processing process is a process that simultaneously executes multiple operation processes for pyramid compression processing and angular rotation processing on the template edge. The number of pyramid compression layers N is the number of layers for compressing and stratifying the target image according to the resolution. The rotation start angle A1 is the initial angle for angular rotation processing of the target image or the template edge. The rotation end angle A2 is the angle after angular rotation processing of the target image or the template edge. The angle step L is the angular distance for one-time angular rotation during the angular rotation processing of the target image or the template edge. The template horizontal gradient is the horizontal gradient of the template edge in the template edge gradient information. The template vertical gradient is the vertical gradient of the template edge in the template edge gradient information. The template arc gradient is the gradient determined by the template horizontal gradient and the template vertical gradient.

[0073] As an example, according to the number of pyramid compression layers N, the rotation start angle A1, the rotation end angle A2, and the angle step L, perform pyramid compression processing on the template edge to obtain N layers of template edges with different resolutions. Using the parallel processing process, perform multi-angle rotation processing on the template edges with different resolutions in the N layers. For example, perform multi-angle rotation processing on the template edge of the i-th layer in the N layers. Between A2 - A1, rotate to A1 + L, A1 + 2L, A1 + 3L... A2 in sequence, and obtain (A2 - A1) / L template edges for each layer. Finally, process all the template edges in the N layers to obtain the template edge gradient information corresponding to N*(A2 - A1) / L angle templates.

[0074] As another example, the template horizontal gradient Tx, the template vertical gradient Ty, and the template arc gradient Txy are calculated as follows:

[0075]

[0076] Among them, G x,y The gray value corresponding to the edge point of the template edge in the template image.

[0077] In this embodiment, using the parallel processing process to perform pyramid compression processing and angular rotation processing on the template edge to obtain the template edge gradient information corresponding to N*(A2 - A1) / L angle templates can optimize the image matching process and improve the efficiency of image edge matching.

[0078] In one embodiment, in step S20, that is, performing pyramid compression processing on the target image to obtain the target gradient information corresponding to the target image, including: performing pyramid compression processing on the target image to obtain the target gradient information corresponding to the target image, where the target gradient information includes the target horizontal gradient, the target vertical gradient, and the target arc gradient.

[0079] As an example, according to the number of pyramid compression layers N, pyramid compression processing is performed on the target image to obtain M target gradient information corresponding to N layers of the target image. Among them, the calculation methods of the target horizontal gradient, the target vertical gradient, and the target radian gradient are the same as those of the template horizontal gradient, the template vertical gradient, and the template radian gradient. To avoid repetition, they will not be elaborated here.

[0080] In this embodiment, searching the entire target image according to the target gradient information improves the matching efficiency of the target image compared to directly searching the entire target image.

[0081] In one embodiment, as Figure 4 shown, in step S30, the search matching parameters include a parameter coincidence factor, a parameter gradient factor, and a parameter acceleration factor. According to the search matching parameters, multiple pre-created angle templates are screened to determine the template to be matched and the edge gradient information to be matched corresponding to the template to be matched, including:

[0082] S31: Determine the target edge search range of the current layer according to the parameter acceleration factor.

[0083] Among them, the parameter acceleration factor is a parameter set by the user to determine the target edge search range of the current layer. The target edge is the edge feature corresponding to the target image, and the range of the edge feature corresponding to the target image is determined by the edge points of the edge feature in the template to be matched.

[0084] It can be understood that in order to improve the matching speed of the target image edge matching, the server can determine the search range of the target edge of a single layer, that is, the target edge search range of the current layer, according to the parameter acceleration factor, which can effectively reduce the search amount of the target edge of the current layer, and then improve the matching efficiency of the target image edge matching.

[0085] S32: Select the angle template within the target edge search range of the current layer according to the parameter coincidence factor and the parameter gradient factor, determine it as the template to be matched, and obtain the edge gradient information to be matched corresponding to the template to be matched.

[0086] Among them, the parameter coincidence factor is a parameter set by the user to screen the angle template and obtain the angle template within the target edge search range of the current layer. The parameter gradient factor is a parameter set by the user to screen the edge matching degree corresponding to the edge gradient information to be matched, and improve the matching speed of the target image edge matching.

[0087] As an example, the value range of the parameter overlap factor overlap is between 0 and 1. According to the preset angle template screening rule, the (1 / overlap)-th adjacent point in the edge array is selected as the edge point of the template edge that matches the edge point of the target edge, and the number of edge points of the determined template edge is m 0 = m * overlap, where m is the number of edge points of all template edges in the edge array. Therefore, the number of edge point matches of the target edge is reduced, and the matching speed of the target image edge matching is improved.

[0088] As another example, the value range of the parameter gradient factor grad is between 0 and 1. When the edge matching degree is reached, the matching of the edge points of the target edge is skipped, and the matching of the edge points of the next target edge is directly performed, reducing the amount of computation for matching.

[0089] In this embodiment, according to the parameter acceleration factor, the search range of the target edge of a single layer, that is, the search range of the target edge of the current layer, can be determined, which can effectively reduce the search amount for the target edge of the current layer. The parameter overlap factor and the parameter gradient factor reduce the number of edge point matches of the target edge, thereby improving the matching efficiency of the target image edge matching.

[0090] In one embodiment, as Figure 5 shown, in step S31, according to the parameter acceleration factor, the search range of the target edge of the current layer is determined, including:

[0091] S311: If the current layer is the top layer, then determine the search range of the target edge of the current layer as a global search.

[0092] Among them, the global search is to search all edge points of the target edge of the current layer.

[0093] As an example, the target image is subjected to pyramid compression processing to obtain N layers of target edges with different resolutions. Assume that the top layer of the target edge is the Nth layer. When the current layer is the Nth layer, then determine the search range of the target edge of the current layer as a global search for the Nth layer.

[0094] S312: If the current layer is not the top layer, then according to the parameter acceleration factor, obtain the local search parameters, and according to the local search parameters, determine the search range of the target edge of the current layer as a local search.

[0095] Among them, the local search is to search for some edge points of the target edge of the current layer.

[0096] As an example, the parameter acceleration factor greed determines its local search range. Let the local search range s to be determined be s = (1 - greed) * n + 1, where n represents the current pyramid level. Let P represent the position of the edge point of the target edge in the previous layer, and let A represent the angle of the target edge in the previous layer. Then the target edge search range in the current layer is from P - s to P + s, and the target image angle search range is from A - s to A + s.

[0097] In this embodiment, according to the parameter acceleration factor, the search range of the target edge of a single layer can be determined, that is, the target edge search range in the current layer, which can effectively reduce the search amount for the target edge in the current layer, and thus improve the matching efficiency of the target image edge matching.

[0098] In one embodiment, in step S40, the target gradient information is used to match multiple edge gradient information to be matched, and the edge matching degree corresponding to each edge gradient information to be matched is obtained, including:

[0099] The edge matching degree corresponding to each edge gradient information to be matched is calculated by the following formula:

[0100]

[0101] where D (u,v) is the edge matching degree corresponding to the edge gradient information to be matched, is the template horizontal gradient, is the template vertical gradient, is the template radian gradient, is the target horizontal gradient, is the target vertical gradient, is the target radian gradient.

[0102] Specifically, the template image undergoes edge extraction and pyramid compression processing. Therefore, multi-layer and multi-resolution template edges and template images can be obtained. To determine the position of the target image edge points based on the position of the edge points of the template edge, it is necessary to calculate the matching degree between the edge points of the target edges of multiple gradients and the edge points of the template edge according to the target gradient information, and obtain the edge matching degree to further match the target image edge.

[0103] In this embodiment, using the target gradient information to match multiple edge gradient information to be matched has more image feature information, which improves the anti-interference ability when matching the target image.

[0104] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0105] In one embodiment, an image edge matching device is provided, which corresponds one-to-one with the image edge matching method in the above embodiment. As Figure 6 shown, the image edge matching device includes a matching request acquisition module 10, a gradient information acquisition module 20, a template screening module 30, and an information matching module 40. The detailed description of each functional module is as follows:

[0106] The matching request acquisition module 10 is configured to acquire an image matching request, where the image matching request includes a target image and search matching parameters:

[0107] The gradient information acquisition module 20 is configured to perform edge extraction and pyramid compression processing on the target image to obtain target gradient information corresponding to the target image;

[0108] The template screening module 30 is configured to screen a plurality of pre-created angular templates according to the search matching parameters to determine a template to be matched and corresponding edge gradient information to be matched for the template to be matched;

[0109] The information matching module 40 is configured to match the target gradient information with a plurality of edge gradient information to be matched to obtain an edge matching degree corresponding to each edge gradient information to be matched, and determine the best matching position and the best matching angle according to the edge matching degree.

[0110] Furthermore, the image edge matching device further includes:

[0111] A creation request acquisition module, configured to acquire a template creation request, where the template creation request includes a template image and template creation parameters;

[0112] A template edge module, configured to perform edge extraction on the template image by using an edge extraction algorithm to obtain a template edge corresponding to the template image;

[0113] An edge array module, configured to perform pyramid compression processing and angular rotation processing on the template edge according to the template creation parameters to obtain template edge gradient information corresponding to a plurality of angular templates, and save the template edge gradient information corresponding to the plurality of angular templates as an edge array.

[0114] Furthermore, the edge array module includes:

[0115] A gradient information sub-module, configured to perform pyramid compression processing and angular rotation processing on the template edge according to the template creation parameters by using a parallel processing flow to obtain template edge gradient information corresponding to N*(A2 - A1) / L angular templates, where the template edge gradient information includes a template horizontal gradient, a template vertical gradient, and a template radian gradient.

[0116] Furthermore, the gradient information acquisition module 20 includes:

[0117] A target gradient sub-module for performing pyramid compression processing on a target image to obtain target gradient information corresponding to the target image, where the target gradient information includes a target horizontal gradient, a target vertical gradient, and a target radian gradient.

[0118] Further, the template screening module 30 includes:

[0119] A range determination sub-module for determining the target edge search range of the current layer according to a parameter acceleration factor;

[0120] A template selection sub-module for selecting an angle template within the target edge search range of the current layer according to a parameter coincidence factor and a parameter gradient factor, determining it as a template to be matched, and obtaining corresponding edge gradient information to be matched for the template to be matched.

[0121] Further, the range determination sub-module includes:

[0122] A global search unit for determining that the target edge search range of the current layer is a global search when the current layer is the top layer;

[0123] A local search unit for obtaining local search parameters according to a parameter acceleration factor and determining that the target edge search range of the current layer is a local search according to the local search parameters when the current layer is not the top layer.

[0124] Further, the information matching module 40 includes:

[0125] A matching degree calculation sub-module for calculating the edge matching degree corresponding to each piece of edge gradient information to be matched through the following formula:

[0126]

[0127] where D (u,v) is the edge matching degree corresponding to the edge gradient information to be matched, is the template horizontal gradient, is the template vertical gradient, is the template radian gradient, is the target horizontal gradient, is the target vertical gradient, is the target radian gradient.

[0128] For the specific limitations on the image edge matching device, reference can be made to the limitations on the image edge matching method in the foregoing text, which will not be elaborated herein. Each module in the above image edge matching device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to each of the above modules.

[0129] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 7 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for image edge matching. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an image edge matching method.

[0130] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the image edge matching method in the above embodiment, such as steps S10 to S40. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit of the data import device in the above embodiment, such as the functions of module 10 to module 40. To avoid repetition, it will not be elaborated herein.

[0131] In one embodiment, a computer-readable storage medium is provided. A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, it implements the image edge matching method in the above embodiment, such as steps S10 to S40. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit of the data import device in the above embodiment, such as the functions of module 10 to module 40. To avoid repetition, it will not be elaborated herein.

[0132] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0133] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0134] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. An image edge matching method, characterized in that, it includes: Obtain an image matching request, where the image matching request includes a target image and search matching parameters: Perform pyramid compression processing on the target image to obtain target gradient information corresponding to the target image; According to the search matching parameters, screen a plurality of pre-created angle templates to determine a template to be matched and corresponding edge gradient information to be matched with the template to be matched; Use the target gradient information to match a plurality of the edge gradient information to be matched, obtain an edge matching degree corresponding to each edge gradient information to be matched, and determine the best matching position and the best matching angle according to the edge matching degree; Before the step of obtaining the image matching request, the image edge matching method further includes the following steps: Obtain a template creation request, where the template creation request includes a template image and template creation parameters; Use an edge extraction algorithm to extract edges from the template image to obtain a template edge corresponding to the template image; According to the template creation parameters, perform pyramid compression processing and angle rotation processing on the template edge to obtain template edge gradient information corresponding to a plurality of angle templates, and save the template edge gradient information corresponding to the plurality of angle templates as an edge array.

2. The image edge matching method according to claim 1, characterized in that, the template creation parameters include the number of pyramid compression layers N, the starting rotation angle A1, the ending rotation angle A2, and the angle step L; The step of performing pyramid compression processing and angle rotation processing on the template edge according to the template creation parameters to obtain template edge gradient information corresponding to a plurality of angle templates includes: According to the template creation parameters, use a parallel processing flow to perform pyramid compression processing and angle rotation processing on the template edge to obtain template edge gradient information corresponding to N*(A2 - A1) / L angle templates, where the template edge gradient information includes a template horizontal gradient, a template vertical gradient, and a template arc gradient.

3. The image edge matching method according to claim 1, characterized in that, the step of performing pyramid compression processing on the target image to obtain target gradient information corresponding to the target image includes: Perform pyramid compression processing on the target image to obtain target gradient information corresponding to the target image, where the target gradient information includes a target horizontal gradient, a target vertical gradient, and a target arc gradient.

4. The image edge matching method according to claim 1, characterized in that, the search matching parameters include a parameter coincidence factor, a parameter gradient factor, and a parameter acceleration factor; The step of screening a plurality of pre-created angle templates according to the search matching parameters to determine a template to be matched and corresponding edge gradient information to be matched with the template to be matched includes: According to the parameter acceleration factor, determine the target edge search range of the current layer; According to the enclosed parameter coincidence factor and the parameter gradient factor, an angle template within the target edge search range of the current layer is selected and determined as the template to be matched, and the edge gradient information to be matched corresponding to the template to be matched is obtained.

5. The image edge matching method according to claim 4, wherein, the determining the target edge search range of the current layer according to the parameter acceleration factor includes: if the current layer is the top layer, determining the target edge search range of the current layer as a global search; if the current layer is not the top layer, obtaining local search parameters according to the parameter acceleration factor, and determining the target edge search range of the current layer as a local search according to the local search parameters.

6. The image edge matching method according to claim 1, wherein, the matching of the multiple edge gradient information to be matched by using the target gradient information to obtain the edge matching degree corresponding to each edge gradient information to be matched includes: calculating the edge matching degree corresponding to each edge gradient information to be matched through the following formula: ; Among them, is the edge matching degree corresponding to the edge gradient information to be matched, is the template horizontal gradient, is the template vertical gradient, is the template radian gradient, is the target horizontal gradient, is the target vertical gradient, is the target radian gradient.

7. An image edge matching device, wherein, it includes: a matching request acquisition module, configured to acquire an image matching request, where the image matching request includes a target image and search matching parameters; a gradient information acquisition module, configured to perform pyramid compression processing on the target image to obtain target gradient information corresponding to the target image; a template screening module, configured to screen a plurality of pre-created angle templates according to the search matching parameters to determine a template to be matched and the edge gradient information to be matched corresponding to the template to be matched; an information matching module, configured to match the multiple edge gradient information to be matched by using the target gradient information, obtain the edge matching degree corresponding to each edge gradient information to be matched, and determine the best matching position and the best matching angle according to the edge matching degree; a creation request acquisition module, configured to acquire a template creation request, where the template creation request includes a template image and template creation parameters; a template edge module, configured to perform edge extraction on the template image by using an edge extraction algorithm to obtain a template edge corresponding to the template image; an edge array module, configured to perform pyramid compression processing and angle rotation processing on the template edge according to the template creation parameters, obtain template edge gradient information corresponding to a plurality of angle templates, and save the template edge gradient information corresponding to the plurality of angle templates as an edge array.

8. A computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, when the processor executes the computer program, the image edge matching method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, where the computer-readable storage medium stores a computer program, wherein, when the computer program is executed by a processor, the image edge matching method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Matching method based on image edge vectors

    CN103679702A

  • Image matching method based on edge direction and gradient characteristics

    CN110197232A