Template matrix construction and template matching method and device, equipment and storage medium

By constructing forward and reverse one-dimensional template matrices based on edge angles, the problems of large computational load and slow speed in image matching in existing technologies are solved, achieving more efficient and accurate image matching.

CN116310443BActive Publication Date: 2026-01-02HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310294717.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2026-01-02
Estimated Expiration
2043-03-24

AI Technical Summary

Technical Problem

Existing image matching methods are computationally intensive, slow, and have low matching accuracy. In particular, traditional grayscale template matching and Hough space parameter methods cannot effectively solve the problem when the target image is occluded or incomplete.

Method used

Edge point sets are obtained by extracting the contours of the template image. Forward and reverse one-dimensional template matrices based on edge angles are constructed for image denoising and angle smoothing. The one-dimensional template matrix is ​​then used to match the image to be matched, and the matching result is optimized by combining the least squares method.

Benefits of technology

It reduces computational load and improves matching speed and accuracy, especially when the target image has been rotated and translated, enabling faster and more accurate image matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310443B_ABST
    Figure CN116310443B_ABST
Patent Text Reader

Abstract

The application discloses a template matrix construction and template matching method and device, equipment and a storage medium, applied to the field of image processing, comprising: extracting the contour of a template image to obtain a template edge point set; performing straight line fitting on each point in the template edge point set as a center and a preset number of points before and after the center in sequence to obtain a template edge inclination angle set corresponding to the template edge point set, constructing a to-be-processed one-dimensional template matrix according to the template edge inclination angle set, performing image denoising and angle smoothing processing to obtain a forward one-dimensional template matrix, performing reverse iteration to obtain a reverse one-dimensional template matrix, and performing template matching after performing similar processing on a to-be-matched image. The application utilizes the edge features of a template image to construct a forward one-dimensional template matrix and a reverse one-dimensional template matrix, and one-dimensional templates can be directly used for matching when subsequent template matching is performed, so that the template matrix and the to-be-matched matrix are both one-dimensional, and the calculation amount is smaller and the matching speed is faster when matching is performed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, in particular to a template matrix construction and template matching method, device and equipment and storage medium. BACKGROUND

[0002] Image matching is an important research part in the field of machine vision, and image matching technology is mainly used for online high-speed positioning matching and grabbing of products in industrial production. In the existing image matching in the field of industrial production, in the case of only translation of the target object, the traditional gray template matching is used to correspond the template image to the to-be-matched image, and the horizontal and vertical traversals are performed, and the pixel-by-pixel matching is performed once for each position movement. In the case of translation and rotation of the target image, the traditional Hough space parameter method is used to vote for the best parameter for each space parameter. In real life, there are occlusions or incomplete target images in actual image scenes, which often causes inaccurate matching for the traditional gray template matching which relies on the overall shape and gray value of the image. The more parameters of the Hough space parameter method, the more the parameter dimension space, which leads to a large amount of calculation and a very slow calculation speed.

[0003] Therefore, the image matching method in the prior art has the disadvantages of large amount of calculation, slow calculation speed and low matching accuracy. SUMMARY

[0004] Therefore, the image matching method in the prior art has the disadvantages of large amount of calculation, slow calculation speed and low matching accuracy.

[0005] To solve the above technical problems, the present application provides a template matrix construction method, comprising:

[0006] Selecting a template image, extracting the contour of the template image to obtain a template edge point set;

[0007] Performing straight line fitting on a preset number of points before and after each point in the template edge point set in sequence to obtain a template edge inclination angle set corresponding to the template edge point set;

[0008] Constructing a to-be-processed one-dimensional template matrix according to the template edge inclination angle set;

[0009] Performing image denoising and angle smoothing processing on the to-be-processed one-dimensional template matrix to obtain a forward one-dimensional template matrix, and performing traversal from the tail of the forward one-dimensional template matrix as the starting point to obtain a reverse one-dimensional template matrix; wherein the angle smoothing processing is smoothing processing on the jump of adjacent difference values greater than 180 degrees.

[0010] Optionally, the extracting the contour of the template image obtains a template edge point set, comprising:

[0011] When there is a non-actual contour line in the template contour line corresponding to the template image, the actual contour line is obtained after eliminating the non-actual contour line;

[0012] When the actual contour line is not a single pixel, the template edge point set is obtained after skeleton extraction of the actual contour line.

[0013] Optionally, the angle smoothing processing on the to-be-processed one-dimensional template matrix comprises:

[0014] The to-be-processed one-dimensional template matrix is traversed, and the last one of two template edge points with a difference greater than 180 degrees is taken as a limit, and the values of the matrix after the limit are sequentially subtracted by 360 degrees, and the processing is repeatedly performed until there is no jump with a difference greater than 180 degrees.

[0015] Optionally, the straight line fitting is performed on each point in the template edge point set as a center and a preset number of points before and after the point, comprising:

[0016] When the number of points in the template edge point set is n, the first m points and the last m points are not subjected to straight line fitting, and from the m+1th point, the straight line fitting is performed on 2*m points before and after the point as a center, and the template edge inclination angle is calculated by using an angle calculation formula, and the template edge inclination angle set is generated by using the template edge inclination angle; wherein m is less than n, and the angle calculation formula is and Wherein, Δx1 and Δy1 are the horizontal and vertical vectors of the fitting straight line when the straight line fitting is performed, Δx2 and Δy2 are the horizontal and vertical vectors between the first point and the last point when the straight line fitting is performed, and degree represents the original tangent angle.

[0017] The application also provides a template matching method based on edge angles, based on the above-mentioned forward one-dimensional template matrix and reverse one-dimensional template matrix, and the method comprises:

[0018] An image to be matched is acquired, and the contour of the image to be matched is extracted to obtain a matched edge point set;

[0019] The straight line fitting is performed on each point in the matched edge point set as a center and a preset number of points before and after the point, and the matched edge inclination angle set corresponding to the matched edge point set is obtained;

[0020] A to-be-processed one-dimensional matrix is constructed according to the matched edge inclination angle set.

[0021] copying a section of the same length as the forward one-dimensional template matrix or the reverse one-dimensional template matrix from the front end of the to-be-processed one-dimensional matrix to the tail end to obtain a spliced one-dimensional matrix; meanwhile, copying the same number of points in the template edge point set from the front end of the to-be-matched edge point set to the tail end to obtain a spliced to-be-matched edge point set corresponding to the spliced one-dimensional matrix;

[0022] performing image denoising and angle smoothing processing on the spliced one-dimensional matrix to obtain a to-be-matched one-dimensional image matrix;

[0023] performing image matching calculation on the to-be-matched one-dimensional image matrix and the forward one-dimensional template matrix and the reverse one-dimensional template matrix respectively to obtain a forward matching result matrix and a reverse matching result matrix composed of matching rates, selecting the matrix with the largest overall matching rate as a matching template matrix, and selecting the point corresponding to the maximum matching rate as a matching starting point;

[0024] calculating the corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix according to the matching starting point to obtain an image matching result.

[0025] Optionally, the calculating the corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix according to the matching starting point to obtain an image matching result comprises:

[0026] calculating a first mapping relationship between the matching template matrix and the to-be-matched one-dimensional image matrix according to a matching formula; wherein the matching formula is the to-be-matched edge point set is (x, y), the template edge point set corresponding to the matching template matrix is (x', y'), tx is a horizontal translation amount calculated according to the corresponding edge points of the matching template matrix and the to-be-matched one-dimensional image matrix, ty is a vertical translation amount calculated according to the corresponding edge points of the matching template matrix and the to-be-matched one-dimensional image matrix, and the first mapping relationship is any θ is a rotation vector calculated according to the corresponding edge points of the matching template matrix and the to-be-matched one-dimensional image matrix;

[0027] obtaining the image matching result according to any of the calculated first mapping relationships, the spliced to-be-matched edge point set and the template edge point set.

[0028] Optionally, the obtaining the image matching result according to any of the calculated first mapping relationships, the to-be-matched edge point set and the template edge point set comprises:

[0029] Calculate a plurality of first mapping relationship formulas corresponding to the to-be-matched edge point set and the template edge point set, and obtain a second mapping relationship formula by combining a least square method, wherein the second mapping relationship formula is

[0030] Obtain the image matching result according to the second mapping relationship formula, the spliced to-be-matched edge point set and the template edge point set.

[0031] The application further provides an edge-angle-based template matching device, comprising:

[0032] A to-be-matched edge point set calculation module is configured to acquire a to-be-matched image, extract the contour of the to-be-matched image and obtain a to-be-matched edge point set.

[0033] A to-be-matched edge inclination angle set calculation module is configured to sequentially perform linear fitting on a preset number of points before and after each point in the to-be-matched edge point set to obtain a to-be-matched edge inclination angle set corresponding to the to-be-matched edge point set.

[0034] A to-be-processed one-dimensional matrix calculation module is configured to construct a to-be-processed one-dimensional matrix according to the to-be-matched edge inclination angle set.

[0035] A spliced matrix calculation module is configured to copy a segment of matrix with the same length as the forward one-dimensional template matrix or the reverse one-dimensional template matrix from the front end of the to-be-processed one-dimensional matrix to the tail to obtain a spliced one-dimensional matrix, and copy the same number of points in the template edge point set from the front end of the to-be-matched edge point set to the tail to obtain a spliced to-be-matched edge point set corresponding to the spliced one-dimensional matrix.

[0036] A to-be-matched one-dimensional image matrix calculation module is configured to perform image denoising and angle smoothing processing on the spliced one-dimensional matrix to obtain a to-be-matched one-dimensional image matrix.

[0037] A matching result matrix calculation module is configured to perform image matching calculation on the to-be-matched one-dimensional image matrix and the forward one-dimensional template matrix and the reverse one-dimensional template matrix respectively to obtain a forward matching result matrix and a reverse matching result matrix composed of matching rates, select the matrix with the largest overall matching rate as a matching result matrix, and select the point corresponding to the maximum matching rate as a matching starting point.

[0038] An image matching result calculation module is configured to calculate the corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix according to the matching starting point to obtain an image matching result.

[0039] The application further provides an edge-angle-based template matching device, comprising:

[0040] A memory for storing a computer program;

[0041] A processor for implementing the above method when executing the computer program.

[0042] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the above method.

[0043] The application selects a template image, extracts the contour of the template image to obtain a template edge point set, sequentially performs straight line fitting on a preset number of points before and after each point in the template edge point set to obtain a template edge inclination angle set corresponding to the template edge point set, constructs a to-be-processed one-dimensional template matrix according to the template edge inclination angle set, performs image denoising and angle smoothing processing on the to-be-processed one-dimensional template matrix to obtain a forward one-dimensional template matrix, and performs traversal on the tail part of the forward one-dimensional template matrix as a starting point to obtain a reverse one-dimensional template matrix, wherein the angle smoothing processing is smoothing processing on a jump of an adjacent difference value greater than 180 degrees. It can be seen that, compared with a multi-feature voting matching method, the application utilizes the edge features of the template image to construct the forward one-dimensional template matrix and the reverse one-dimensional template matrix, and since the one-dimensional to-be-processed image obtained by processing can be directly matched according to the forward one-dimensional template matrix and the reverse one-dimensional template matrix during subsequent template matching, since the template matrix and the to-be-processed image are both one-dimensional, the calculation amount during matching is smaller, and the matching speed is faster.

[0044] In addition, the application further provides a template matching method, device, equipment and storage medium, which also have the above beneficial effects. BRIEF DESCRIPTION OF DRAWINGS

[0045] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute the embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.

[0046] Figure 1 A flow chart of a specific template matrix construction method based on edge angles provided by the embodiments of the application;

[0047] Figure 2 A flow chart of a specific template matrix construction method based on edge angles provided by the embodiments of the application;

[0048] Figure 3 An angle jump schematic diagram provided by the embodiments of the application;

[0049] Figure 4 A flow chart of an edge angle based template matching method provided by an embodiment of the present application is shown in FIG. 1.

[0050] Figure 5 A flow chart of a specific edge angle based template matching method provided by an embodiment of the present application is shown in FIG. 2.

[0051] Figure 6 A structural schematic diagram of an edge angle based template matching device provided by an embodiment of the present application is shown in FIG. 3.

[0052] Figure 7 A structural schematic diagram of an edge angle based template matching device provided by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION

[0053] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort fall within the scope of protection of the present application.

[0054] Reference is made to Figure 1 , Figure 1 A flow chart of an edge angle based template matrix construction method provided by an embodiment of the present application is shown in FIG. 4. The method can include:

[0055] S100, a template image is selected, and a contour of the template image is extracted to obtain a template edge point set.

[0056] The embodiment is not limited to a specific template image. As long as the template image is a part of object image with obvious features, or an object image including all features, the template image can also be used. For example, the template image can be a mobile phone; or the template image can also be a walkie-talkie; or the template image can also be a watch. It should be noted that when the contour of the template image is extracted to obtain the template edge point set, if the template image is not fully captured, the intersection line of the template image and the image boundary is not the actual contour line of the object, and the intersection line needs to be removed before the template edge point set is calculated; and if the contour edge line is not a single pixel, a skeleton extraction morphological operation needs to be performed. And the edge contour line after the removal and skeleton extraction is traversed in a clockwise or counterclockwise order to obtain the template edge point set.

[0057] Further, in order to obtain the template edge point set corresponding to the actual contour line of the template image, the above extraction of the contour of the template image to obtain the template edge point set can include:

[0058] When the template contour line corresponding to the template image contains non-actual contour lines, the non-actual contour lines are removed to obtain the actual contour line.

[0059] When the actual contour line is not a single pixel, skeleton extraction is performed on the actual contour line to obtain the template edge point set.

[0060] The embodiment is to obtain the template edge point corresponding to the actual contour line of the template image, and further improve the matching accuracy of the image matching model. When the template contour line corresponding to the template image contains non-actual contour lines, the non-actual contour lines are removed to obtain the actual contour line. When the actual contour line is not a single pixel, skeleton extraction is performed on the actual contour line to obtain the template edge point set. The non-actual contour line in the embodiment refers to a contour that is not corresponding to the object in the template image.

[0061] S101, straight line fitting is performed on each point in the template edge point set and the preset number of points before and after the point as the center to obtain the template edge inclination angle set corresponding to the template edge point set.

[0062] The template edge inclination angle set in the embodiment is determined by the template edge point set and the preset number of points before and after. The embodiment does not limit the specific number of the preset number, as long as it is less than the number of points in the template edge point set. For example, when the number of points in the template edge point set is 100, the number of the preset number of points before and after can be 5. Or when the number of points in the template edge point set is 200, the number of the preset number of points before and after can be 6.

[0063] Further, the above straight line fitting performed on each point in the template edge point set and the preset number of points before and after the point as the center can include:

[0064] When the number of points in the template edge point set is n, the first m points and the last m points are not subjected to straight line fitting. Starting from the m+1th point, the template edge inclination angle is calculated by using an angle calculation formula with the point as the center and 2*m points before and after the point. The template edge inclination angle set is generated by using the template edge inclination angle; wherein m is less than n, and the angle calculation formula is and Wherein, Δx1 and Δy1 are the horizontal and vertical vectors of the fitting straight line when the straight line fitting is performed, Δx2 and Δy2 are the horizontal and vertical vectors between the first point and the last point when the straight line fitting is performed, and degree represents the original tangent inclination angle.

[0065] The number of points in the template edge point set is n in this embodiment, but the first m points and the last m points are not calculated by angle fitting (m is less than n, and the value of m is generally set to 4 to 7), and a plurality of template inclination angles are obtained by linear fitting of 2*m points before and after the m+1th point as the center. It can be understood that because each point in the template edge point set needs to be taken as the center, the first m points and the last m points cannot be the center point, for example, there is no point before the first point and no point after the last point, so the first m points and the last m points are not calculated by angle fitting.

[0066] S102, constructing a one-dimensional template matrix to be processed according to the template edge inclination angle set.

[0067] This embodiment can construct a one-dimensional template matrix to be processed according to the template edge inclination angle set. It can be understood that the one-dimensional template matrix to be processed is a matrix composed of the template edge inclination angles.

[0068] S103, performing image denoising and angle smoothing processing on the one-dimensional template matrix to be processed to obtain a forward one-dimensional template matrix, and obtaining a reverse one-dimensional template matrix by traversing the tail of the forward one-dimensional template matrix as the starting point; wherein the angle smoothing processing is to perform smoothing processing on the jump of the adjacent difference value greater than 180 degrees.

[0069] This embodiment does not limit the specific method of image denoising. For example, the median filtering method can be used to denoise the one-dimensional template matrix to be processed, or the mean filtering method can also be used to denoise the one-dimensional template matrix to be processed. It can be understood that when the inclination angle between two adjacent points in the one-dimensional template matrix to be processed is greater than 180 degrees, it is considered that there is an angle jump.

[0070] Further, in order to process the points with angle jumps in the one-dimensional template matrix to be processed, the angle smoothing processing on the one-dimensional template matrix to be processed can include:

[0071] Traverse the one-dimensional template matrix to be processed, take the last one of the two template edge points with an adjacent point difference greater than 180 degrees as the limit, and subtract 360 degrees from the values of the matrix after the limit in turn, and repeatedly process until there is no jump with a difference greater than 180 degrees.

[0072] In this embodiment, when the adjacent point difference of the one-dimensional template matrix to be processed is greater than 180 degrees, the last one of the two template edge points is taken as the limit, and 360 degrees is subtracted from the values of the matrix after the limit in turn, and repeatedly processed until there is no jump with a difference greater than 180 degrees.

[0073] Based on the above implementation method, the application extracts a template edge point set by selecting a template image and extracting the contour of the template image; performs straight line fitting on each point in the template edge point set in turn to obtain a template edge inclination angle set corresponding to the template edge point set; constructs a one-dimensional template matrix to be processed according to the template edge inclination angle set; performs image denoising and angle smoothing processing on the one-dimensional template matrix to be processed to obtain a forward one-dimensional template matrix; and traverses the tail of the forward one-dimensional template matrix as a starting point to obtain a reverse one-dimensional template matrix. The angle smoothing processing is smoothing processing on a jump with an adjacent difference greater than 180 degrees. It can be seen that, compared with a multi-feature voting matching method based on generalized Hough transformation, the application reduces the template matrix used in the matching process to one dimension based on edge angles, has rotation invariance and certain anti-interference ability, and greatly improves the matching speed and matching accuracy. Moreover, the non-actual contour line of the template image is removed, and skeleton extraction is performed, so that the template edge point set corresponding to the actual contour line of the template image can be obtained; and after angle smoothing, there is no angle jump in the one-dimensional template matrix to be processed.

[0074] In order to make the application more convenient to understand, please refer to the specific embodiments of the application Figure 2 , Figure 2 A specific edge angle-based template matrix construction method provided by the embodiment of the application is shown in a flowchart, which can specifically include the following steps:

[0075] S200, selecting a template image, when there is a non-actual contour line in the template contour line corresponding to the template image, removing the non-actual contour line to obtain an actual contour line.

[0076] S201, the actual contour line is not a single pixel, and after skeleton extraction is performed on the actual contour line, a template edge point set is obtained; when the number of points in the template edge point set is 100.

[0077] S202, the first 5 points and the last 5 points in the template edge point set are not subjected to straight line fitting, and from the 6th point, 10 points before and after the point are used to calculate 90 template edge inclination angles by using an angle calculation formula, and the 90 template edge inclination angles form a template edge inclination angle set.

[0078] The angle calculation formula in this embodiment is and Wherein, Δx1 and Δy1 are the horizontal and vertical vectors of the fitting straight line when the straight line fitting is performed, Δx2 and Δy2 are the horizontal and vertical vectors between the first point and the last point when the straight line fitting is performed, and degree represents the original tangent inclination angle.

[0079] S203, constructing a one-dimensional template matrix to be processed according to the template edge inclination angle set.

[0080] S204, image denoising and angle smoothing processing are performed on the one-dimensional template matrix to be processed to obtain a forward one-dimensional template matrix, and a reverse one-dimensional template matrix is obtained by traversing the tail of the forward one-dimensional template matrix as a starting point; wherein the angle smoothing processing is to perform smoothing processing on a jump of an adjacent difference value greater than 180 degrees. The jump of the adjacent difference value greater than 180 degrees in the embodiment is 1 degree and 359 degrees. For the convenience of understanding, please refer to Figure 3 , Figure 3 for a schematic diagram of angle jump provided by an embodiment of the application.

[0081] The flowchart of the template matching method based on the edge angle provided by an embodiment of the application is described below. The flowchart of the template matching method based on the edge angle described below can be correspondingly referred to the template matrix construction method based on the edge angle described above. The method is based on the forward one-dimensional template matrix and the reverse one-dimensional template matrix described above. For details, please refer to Figure 4 , the method can include:

[0082] S400, obtaining a to-be-matched image, and extracting the contour of the to-be-matched image to obtain a to-be-matched edge point set.

[0083] The embodiment does not limit the to-be-matched object in the to-be-matched image, as long as the to-be-matched image and the template image are the same kind of object photographed by the same camera. For example, the to-be-matched object in the to-be-matched image can be a mobile phone; or the to-be-matched object in the to-be-matched image can be a stapler; or the to-be-matched object in the to-be-matched image can also be a intercom. The embodiment can extract the contour of the to-be-matched image to obtain a to-be-matched edge point set.

[0084] S401, sequentially performing straight line fitting on a preset number of points before and after each point in the to-be-matched edge point set with the point as a center to obtain a to-be-matched edge inclination angle set corresponding to the to-be-matched edge point set.

[0085] The to-be-matched edge inclination angle set in the embodiment is determined by the to-be-matched edge point set and the preset number of points before and after. It can be understood that when the number of points in the to-be-matched edge point set in the embodiment is n, but the first m points and the last m points do not perform angle fitting calculation (m is less than n, and the value of m is generally set to 4 to 7), starting from the m+1th point, the straight line fitting is performed on the 2*m points before and after the point to obtain a plurality of to-be-matched inclination angles. It can be understood that because each point in the to-be-matched edge point set needs to be taken as a center, the first m points and the last m points cannot be center points, so the first m points and the last m points do not perform angle fitting calculation.

[0086] S402, constructing a to-be-processed one-dimensional matrix according to the set of edge inclination angles to be matched.

[0087] The to-be-processed one-dimensional matrix in this embodiment is composed of the edge inclination angles to be matched. It can be understood that the length of the to-be-processed one-dimensional matrix is consistent with the number of the edge inclination angles to be matched in the set of edge inclination angles to be matched.

[0088] S403, copying a section of the matrix with the same length as the forward one-dimensional template matrix or the reverse one-dimensional template matrix from the front end of the to-be-processed one-dimensional matrix to the tail end to obtain a spliced one-dimensional matrix; and copying the same number of points from the front end of the set of edge points to be matched to the tail end to obtain a spliced set of edge points to be matched corresponding to the spliced one-dimensional matrix.

[0089] This embodiment takes into account that when the set of edge points to be matched is extracted, the first point extracted may just correspond to a point in the set of template edge points, which will cause the set of edge points to be matched to be truncated, and finally the to-be-processed one-dimensional matrix only has the head end or the tail end matched with the forward one-dimensional template matrix or the reverse one-dimensional template matrix, and the maximum matching value is not necessarily very high. Therefore, in the matching result matrix obtained in the template matching stage, the maximum value is not necessarily the actual best matching value. Therefore, a section of the matrix with the size of the template is copied from the head of the to-be-processed one-dimensional matrix to the tail end, and the corresponding points in the set of image edge points are also copied to the tail end.

[0090] S404, performing image denoising and angle smoothing processing on the spliced one-dimensional matrix to obtain a to-be-matched one-dimensional image matrix.

[0091] This embodiment takes into account that the spliced one-dimensional matrix after splicing will have angle mutations, and therefore performs angle smoothing processing on the angle mutations in the spliced one-dimensional matrix after splicing. This embodiment does not limit the specific denoising method. For example, median filtering method can be used for denoising, or mean filtering method can also be used for denoising.

[0092] S405, performing image matching calculation on the to-be-matched one-dimensional image matrix and the forward one-dimensional template matrix and the reverse one-dimensional template matrix respectively to obtain a forward matching result matrix and a reverse matching result matrix composed of matching rates, selecting the matrix with the maximum overall matching rate as the matching template matrix, and selecting the point corresponding to the maximum matching rate as the matching starting point.

[0093] It can be understood that the forward one-dimensional template matrix and the reverse one-dimensional template matrix can obtain the matrix with the maximum overall matching rate, that is, the matching template matrix is one of the forward one-dimensional template matrix and the reverse one-dimensional template matrix. The point with the maximum matching rate and the position index of the point with the maximum matching rate are recorded, and the position index is the first matching point of the matching edge point set and the template edge point set, that is, the matching starting point.

[0094] In S406, a corresponding relationship between the matching template matrix and the one-dimensional image matrix to be matched is calculated according to the matching starting point, and an image matching result is obtained.

[0095] In this embodiment, the corresponding relationship between the matching template matrix and the one-dimensional image matrix to be matched can be calculated according to the matching starting point, and the image matching result is obtained.

[0096] Further, the corresponding relationship between the matching template matrix and the one-dimensional image matrix to be matched can be calculated according to the matching starting point, and the image matching result is obtained, which can include:

[0097] A first mapping relationship between the matching template matrix and the one-dimensional image matrix to be matched is calculated according to a matching formula, wherein the matching formula is The edge point set to be matched is (x, y), the template edge point set corresponding to the matching template matrix is (x', y'), tx is a horizontal translation amount calculated according to the corresponding edge points of the matching template matrix and the one-dimensional image matrix to be matched, ty is a vertical translation amount calculated according to the corresponding edge points of the matching template matrix and the one-dimensional image matrix to be matched, and the first mapping relationship is any θ is a rotation vector calculated according to the corresponding edge points of the matching template matrix and the one-dimensional image matrix to be matched;

[0098] The image matching result is obtained according to any first mapping relationship calculated, the spliced edge point set to be matched and the template edge point set.

[0099] In this embodiment, the first mapping relationship is calculated by using the matching formula, and then the image matching result is obtained according to the first mapping relationship, the spliced edge point set to be matched and the template edge point set.

[0100] Further, in order to reduce errors, the image matching result can be obtained according to any first mapping relationship calculated, the spliced edge point set to be matched and the template edge point set, which can include:

[0101] A plurality of first mapping relationships corresponding to the edge point set to be matched and the template edge point set are calculated, and a second mapping relationship is obtained by combining the least square method, wherein the second mapping relationship is

[0102] According to the second mapping relationship, the spliced edge point set to be matched and the template edge point set, an image matching result is obtained.

[0103] This embodiment is to improve the matching accuracy. A plurality of first mapping relationships corresponding to the edge point set to be matched and the template edge point set are calculated, and a second mapping relationship is obtained by combining the least square method. The second mapping relationship is is the relationship finally solved from the plurality of first mapping relationships, tx 终 is the finally obtained horizontal translation, ty 终 is the finally obtained vertical translation, and θ 终 is the finally obtained rotation vector. It can be understood that the first mapping relationship calculated from any two corresponding matching points is not representative, and the least square method is used for processing to reduce the error.

[0104] By using the template matching method based on edge angle provided by the embodiment of the present application, the image to be matched is obtained, and the contour of the image to be matched is extracted to obtain the edge point set to be matched. Each point in the edge point set to be matched is taken as the center, and a straight line fitting is performed on a preset number of points before and after the center point to obtain the edge inclination angle set corresponding to the edge point set to be matched. A to-be-processed one-dimensional matrix is constructed according to the edge inclination angle set to be matched. A section of matrix with the same length as the positive one-dimensional template matrix or the reverse one-dimensional template matrix is copied from the front end of the to-be-processed one-dimensional matrix and spliced to the tail to obtain a spliced one-dimensional matrix. Meanwhile, the same number of points as the number of points in the template edge point set are copied from the front end of the edge point set to be matched and spliced to the tail to obtain a spliced edge point set to be matched corresponding to the spliced one-dimensional matrix. The spliced one-dimensional matrix is subjected to image denoising and angle smoothing processing to obtain a to-be-matched one-dimensional image matrix. The to-be-matched one-dimensional image matrix is subjected to image matching calculation with the positive one-dimensional template matrix and the reverse one-dimensional template matrix respectively to obtain a positive matching result matrix and a reverse matching result matrix composed of matching rates. The matrix with the maximum overall matching rate is selected as the matching template matrix, and the point corresponding to the maximum matching rate is selected as the matching starting point. The corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix is calculated according to the matching starting point to obtain an image matching result. It can be seen that, compared with the traditional Hough space parameter matching method using three-dimensional parameters of horizontal displacement, vertical displacement and angle rotation for matching, the present application directly obtains the matching relationship by calling the positive one-dimensional template matrix and the reverse one-dimensional template matrix to match the to-be-matched one-dimensional image matrix corresponding to the to-be-matched image. Since the positive one-dimensional template matrix and the reverse one-dimensional template matrix and the to-be-matched one-dimensional image matrix are all one-dimensional, the matching accuracy is higher, the calculation amount is smaller and the matching speed is faster. Furthermore, the present application combines the least square method to reduce the error, so that the obtained matching result is more accurate.

[0105] In order to make the present application more convenient to understand, please refer toFigure 5 , Figure 5 A specific edge angle-based template matching method provided by an embodiment of the present application can include the following steps, which can specifically include:

[0106] The template matching method mainly includes three steps, which are the construction of a forward one-dimensional template matrix and a reverse one-dimensional template matrix, the construction of a to-be-matched one-dimensional image matrix, and a matching process.

[0107] The construction of the forward one-dimensional template matrix and the reverse one-dimensional template matrix includes the following steps: first, a template picture is selected, and the contour of the template image is extracted to obtain a template edge point set. Second, a straight line fitting is performed on a preset number of points before and after each point in the template edge point set, to obtain a template edge inclination angle set corresponding to the template edge point set. Third, a to-be-processed one-dimensional template matrix is constructed according to the template edge inclination angle set. Fourth, image denoising and angle smoothing processing are performed on the to-be-processed one-dimensional template matrix, to obtain a forward one-dimensional template matrix. The tail of the forward one-dimensional template matrix is taken as a starting point to obtain a reverse one-dimensional template matrix.

[0108] The construction of the to-be-matched one-dimensional image matrix includes the following steps: first, a to-be-matched image is obtained, and the contour of the to-be-matched image is extracted to obtain a to-be-matched edge point set. Second, a straight line fitting is performed on a preset number of points before and after each point in the to-be-matched edge point set, to obtain a to-be-matched edge inclination angle set corresponding to the to-be-matched edge point set. Third, a to-be-processed one-dimensional matrix is constructed according to the to-be-matched edge inclination angle set. Fourth, a section of matrix and points with the same length and number of points as the forward one-dimensional template matrix are copied from the front end of the to-be-processed one-dimensional matrix and the corresponding point set and spliced to the tail, to obtain a spliced one-dimensional matrix and a spliced to-be-matched edge point set. The same number of points as the number of points in the template edge point set are copied from the front end of the to-be-matched edge point set and spliced to the tail, to obtain a spliced to-be-matched edge point set corresponding to the spliced one-dimensional matrix. Fifth, image denoising and angle smoothing processing are performed on the spliced one-dimensional matrix, to obtain a to-be-matched one-dimensional image matrix.

[0109] The matching process specifically includes the following steps: first, the to-be-matched one-dimensional image matrix is matched with the forward one-dimensional template matrix and the reverse one-dimensional template matrix respectively, to obtain a one-dimensional template matrix with the maximum matching rate as a matching template matrix, and a point corresponding to the maximum matching rate as a matching starting point. When the image matching calculation is performed, a forward matching result matrix and a reverse matching result matrix composed of matching rates can be obtained, and the matrix with the maximum overall matching rate is selected as the matching template matrix. Second, the corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix is calculated according to the matching starting point, to obtain an image matching result.

[0110] The one-dimensional template matrix with the maximum matching rate in the embodiment can be a forward one-dimensional template matrix or a reverse one-dimensional template matrix.

[0111] A template matching device based on edge angles provided by the embodiment of the application is introduced below, and the template matching device based on edge angles described below can be correspondingly referred to the template matching method based on edge angles described above.

[0112] For details, please refer to Figure 6 , Figure 6 The structural schematic diagram of the template matching device based on edge angles provided by the embodiment of the application can include:

[0113] The to-be-matched edge point set calculation module 100 is configured to acquire a to-be-matched image, and extract a contour of the to-be-matched image to obtain a to-be-matched edge point set.

[0114] The to-be-matched edge inclination angle set calculation module 200 is configured to sequentially perform straight line fitting on a preset number of points before and after each point in the to-be-matched edge point set to obtain a to-be-matched edge inclination angle set corresponding to the to-be-matched edge point set.

[0115] The to-be-processed one-dimensional matrix calculation module 300 is configured to construct a to-be-processed one-dimensional matrix according to the to-be-matched edge inclination angle set.

[0116] The spliced matrix calculation module 400 is configured to copy a segment of a matrix with the same length as the forward one-dimensional template matrix or the reverse one-dimensional template matrix from the front end of the to-be-processed one-dimensional matrix to the tail to obtain a spliced one-dimensional matrix, and copy the same number of points as the number of points in the template edge point set from the front end of the to-be-matched edge point set to the tail to obtain a spliced to-be-matched edge point set corresponding to the spliced one-dimensional matrix.

[0117] The to-be-matched one-dimensional image matrix calculation module 500 is configured to perform image denoising and angle smoothing processing on the spliced one-dimensional matrix to obtain a to-be-matched one-dimensional image matrix.

[0118] The matching result matrix calculation module 600 is configured to perform image matching calculation on the to-be-matched one-dimensional image matrix and the forward one-dimensional template matrix and the reverse one-dimensional template matrix respectively to obtain a forward matching result matrix and a reverse matching result matrix composed of matching rates, select a matrix with the maximum overall matching rate as a matching result matrix, and select a point corresponding to the maximum matching rate as a matching starting point.

[0119] The image matching result calculation module 700 is configured to calculate a corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix according to the matching starting point to obtain an image matching result.

[0120] Based on the above embodiment, the image matching result calculation module 700 can include:

[0121] a first mapping relationship formula calculation unit, configured to calculate a first mapping relationship formula between the matching template matrix and the to-be-matched one-dimensional image matrix according to a matching formula, wherein the matching formula is The to-be-matched edge point set is (x, y), the template edge point set corresponding to the matching template matrix is (x', y'), tx is a horizontal translation amount calculated according to corresponding edge points of the matching template matrix and the to-be-matched one-dimensional image matrix, ty is a vertical translation amount calculated according to corresponding edge points of the matching template matrix and the to-be-matched one-dimensional image matrix, and the first mapping relationship formula is any θ is a rotation vector calculated according to corresponding edge points of the matching template matrix and the to-be-matched one-dimensional image matrix;

[0122] an image matching unit, configured to obtain the image matching result according to any calculated first mapping relationship formula, the spliced to-be-matched edge point set, and the template edge point set.

[0123] Based on the above embodiment, the image matching unit can include:

[0124] a second mapping relationship formula calculation subunit, configured to calculate a plurality of first mapping relationship formulas corresponding to the to-be-matched edge point set and the template edge point set, and obtain a second mapping relationship formula by combining the least square method, wherein the second mapping relationship formula is

[0125] an image matching subunit, configured to obtain the image matching result according to the second mapping relationship formula, the spliced to-be-matched edge point set, and the template edge point set.

[0126] The edge angle-based template matching device provided by the embodiment of the application comprises: a to-be-matched edge point set calculation module 100, configured to obtain a to-be-matched image, extract a contour of the to-be-matched image, and obtain a to-be-matched edge point set; a to-be-matched edge inclination angle set calculation module 200, configured to sequentially perform straight line fitting on a preset number of points before and after each point in the to-be-matched edge point set to obtain a to-be-matched edge inclination angle set corresponding to the to-be-matched edge point set; a to-be-processed one-dimensional matrix calculation module 300, configured to construct a to-be-processed one-dimensional matrix according to the to-be-matched edge inclination angle set; an already-spliced matrix calculation module 400, configured to copy a section of a matrix with the same length as the forward one-dimensional template matrix or the reverse one-dimensional template matrix from the front end of the to-be-processed one-dimensional matrix to the tail end to obtain an already-spliced one-dimensional matrix; and simultaneously copy a same number of points in the to-be-matched edge point set from the front end to the tail end to obtain an already-spliced to-be-matched edge point set corresponding to the already-spliced one-dimensional matrix; a to-be-matched one-dimensional image matrix calculation module 500, configured to perform image denoising and angle smoothing processing on the already-spliced one-dimensional matrix to obtain a to-be-matched one-dimensional image matrix; a matching result matrix calculation module 600, configured to respectively perform image matching calculation on the to-be-matched one-dimensional image matrix and the forward one-dimensional template matrix and the reverse one-dimensional template matrix to obtain a forward matching result matrix and a reverse matching result matrix composed of matching rates, select a matrix with the largest overall matching rate as a matching result matrix, and select a point corresponding to the largest matching rate as a matching starting point; and an image matching result calculation module 700, configured to calculate a corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix according to the matching starting point to obtain an image matching result. It can be seen that, compared with the traditional Hough space parameter matching using three-dimensional parameters of horizontal displacement, vertical displacement and angle rotation for matching, the application directly obtains a matching relationship by calling the forward one-dimensional template matrix and the reverse one-dimensional template matrix to match the to-be-matched one-dimensional image matrix corresponding to the to-be-matched image, and the forward one-dimensional template matrix and the reverse one-dimensional template matrix and the to-be-matched one-dimensional image matrix are all one-dimensional, so that the matching accuracy is higher, the calculation amount is smaller, and the matching speed is faster. Moreover, the application combines the least square method to reduce errors, so that the obtained matching result is more accurate.

[0127] The edge angle-based template matching device provided by the embodiment of the application will be described below. The edge angle-based template matching device described below can be referred to in combination with the edge angle-based template matching method described above.

[0128] Please refer to Figure 7 , Figure 7 The structure diagram of the edge angle-based template matching device provided by the embodiment of the application can comprise:

[0129] a memory 10 for storing a computer program;

[0130] a processor 20 for executing the computer program to implement the method described above.

[0131] The memory 10, the processor 20 and the communication interface 31 can communicate with each other through a communication bus 32.

[0132] In the embodiment of the present application, the memory 10 stores one or more programs, and the program can include program codes, and the program codes include computer operation instructions.

[0133] In a possible implementation, the memory 10 can include a program storage area and a data storage area, wherein the program storage area can store an operating system, and at least one application required by a function, etc.; and the data storage area can store data created in the use process.

[0134] In addition, the memory 10 can include a read-only memory and a random access memory, and provide instructions and data for the processor. A part of the memory can also include an NVRAM. The memory stores an operating system and operation instructions, executable modules or data structures, or a subset of them, or an extended set of them, wherein the operation instructions can include various operation instructions for implementing various operations. The operating system can include various system programs for implementing various basic tasks and processing hardware-based tasks.

[0135] The processor 20 can be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic device. The processor 20 can be a microprocessor or any conventional processor, etc. The processor 20 can call the program stored in the memory 10.

[0136] The communication interface 31 can be an interface of a communication module, and is used for connecting with other devices or systems.

[0137] Of course, it should be noted that, Figure 7 The structures shown do not constitute a limitation on the template matching device based on the edge angle in the embodiments of the present application. In actual applications, the template matching device based on the edge angle can include more or fewer components than those shown, or combine some components. Figure 7 The structures shown do not constitute a limitation on the template matching device based on the edge angle in the embodiments of the present application. In actual applications, the template matching device based on the edge angle can include more or fewer components than those shown, or combine some components.

[0138] The computer readable storage medium provided by the embodiment of the present application is described below. The computer readable storage medium described below can be referred to each other with the method described above.

[0139] The application further provides a storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method.

[0140] The storage medium can include a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0141] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. For the device disclosed by the embodiments, since it corresponds to the method disclosed by the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

[0142] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly show the interchangeability of hardware and software, the components and steps of each example have been described in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0143] Finally, it should be noted that in this document, relationships such as first and second are only used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variant are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device.

[0144] The template matrix construction and template matching method, device, equipment and storage medium provided by the application are described in detail above, and the principle and implementation mode of the application are described by using specific examples in this document. The above description of the embodiments is only used to help understand the method and core idea of the application; at the same time, for those skilled in the art, according to the idea of the application, the specific implementation mode and application range will be changed; in view of the above, the content of the specification should not be understood as a limitation of the application.

Claims

1. A method of edge-angle-based template matching, characterized by, The method comprises the following steps: selecting a template image, when there is a non-actual contour line in the template contour line corresponding to the template image, obtaining an actual contour line after removing the non-actual contour line; when the actual contour line is not a single pixel, obtaining a template edge point set after skeleton extraction of the actual contour line; when the number of points in the template edge point set is n, the first m points and the last m points are not subjected to straight line fitting, the template edge inclination angle is calculated by using an angle calculation formula from the m+1 point, the template edge inclination angle set is generated by using the template edge inclination angle; a to-be-processed one-dimensional template matrix is constructed according to the template edge inclination angle set; image denoising and angle smoothing processing are performed on the to-be-processed one-dimensional template matrix to obtain a forward one-dimensional template matrix, and a reverse one-dimensional template matrix is obtained by traversing the tail of the forward one-dimensional template matrix as a starting point; wherein the angle smoothing processing is smoothing processing on a jump with an adjacent difference value greater than 180 degrees; an image to be matched is obtained, and an outline of the image to be matched is extracted to obtain a to-be-matched edge point set; each point in the to-be-matched edge point set is taken as a center, and a preset number of points before and after the center are subjected to straight line fitting in sequence to obtain a to-be-matched edge inclination angle set corresponding to the to-be-matched edge point set; a to-be-processed one-dimensional matrix is constructed according to the to-be-matched edge inclination angle set; a segment of the to-be-processed one-dimensional matrix with the same length as the forward one-dimensional template matrix or the reverse one-dimensional template matrix is copied from the front end and spliced to the tail to obtain a spliced one-dimensional matrix; meanwhile, a same number of points in the to-be-matched edge point set as the number of points in the template edge point set are copied from the front end and spliced to the tail to obtain a spliced to-be-matched edge point set corresponding to the spliced one-dimensional matrix; image denoising and angle smoothing processing are performed on the spliced one-dimensional matrix to obtain a to-be-matched one-dimensional image matrix; the to-be-matched one-dimensional image matrix is subjected to image matching calculation with the forward one-dimensional template matrix and the reverse one-dimensional template matrix respectively to obtain a forward matching result matrix and a reverse matching result matrix composed of matching rates, and a matrix with the maximum overall matching rate is selected as a matching template matrix, and a point corresponding to the maximum matching rate is selected as a matching starting point; a corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix is calculated according to the matching starting point to obtain an image matching result.

2. The edge-angle-based template matching method according to claim 1, wherein, The image denoising and angle smoothing processing on the to-be-processed one-dimensional template matrix comprises the following steps: traversing the to-be-processed one-dimensional template matrix, taking the last one of two template edge points with an adjacent point difference value greater than 180 degrees as a limit, and subtracting 360 degrees from the values of the matrix after the limit in sequence, and repeatedly processing until there is no jump with a difference value greater than 180 degrees.

3. The edge-angle-based template matching method of claim 1, wherein, m is less than n, the angle calculation formula is and ; wherein, and are a transverse vector and a longitudinal vector of a fitted straight line when a straight line is fitted, is a transverse vector between the first point and the last point when a straight line is fitted, denotes the original tangent angle.

4. The edge-angle-based template matching method of claim 1, wherein, The corresponding relationship between the matching template matrix and the to-be-matched one-dimensional image matrix is calculated according to the matching starting point to obtain an image matching result, which comprises the following steps: According to the matching formula, a first mapping relationship between the matching template matrix and the one-dimensional image matrix to be matched is calculated; wherein the matching formula is , the edge point set to be matched is , the template edge point set corresponding to the matching template matrix is , , the horizontal translation amount calculated according to the corresponding edge points of the matching template matrix and the one-dimensional image matrix to be matched is , the vertical translation amount calculated according to the corresponding edge points of the matching template matrix and the one-dimensional image matrix to be matched is, and the first mapping relationship is any ; θ is a rotation vector calculated according to the corresponding edge points of the matching template matrix and the one-dimensional image matrix to be matched. the image matching result is obtained according to any one of the first mapping relationship formula, the spliced to-be-matched edge point set and the template edge point set.

5. The edge-angle-based template matching method according to claim 4, wherein, The step of obtaining the image matching result based on any of the calculated first mapping relationships, the set of edge points to be matched, and the template edge point set includes: Calculate multiple first edge points corresponding to the set of edge points to be matched and the set of edge points of the template. The mapping relationship formula, combined with the least square method, obtains a second mapping relationship formula; wherein the second mapping relationship formula is ; The image matching result is obtained based on the second mapping relationship, the pre-matched edge point set, and the template edge point set.

6. An edge-angle-based template matching device, characterized by comprising: The template matching method based on edge angle according to any one of claims 1 to 5 includes: The edge point set calculation module is used to acquire the image to be matched and extract the contour of the image to be matched to obtain the edge point set to be matched. The module for calculating the tilt angle set of the edge to be matched is used to perform line fitting sequentially with each point in the set of edge points to be matched as the center and a preset number of points before and after, to obtain the set of tilt angles of the edge to be matched corresponding to the set of edge points to be matched. The module for calculating the one-dimensional matrix to be processed is used to construct the one-dimensional matrix to be processed based on the set of tilt angles of the edges to be matched. The pre-stitched matrix calculation module is used to copy a segment of the matrix with the same length as the forward one-dimensional template matrix or the reverse one-dimensional template matrix from the front end of the one-dimensional matrix to be processed and stitch it to the tail end to obtain a pre-stitched one-dimensional matrix; at the same time, it copies points with the same number of points as the points in the template edge point set from the front end of the edge point set to be matched and stitches them to the tail end to obtain a pre-stitched edge point set to be matched corresponding to the pre-stitched one-dimensional matrix; The module for calculating the one-dimensional image matrix to be matched is used to perform image denoising and angle smoothing on the spliced ​​one-dimensional matrix to obtain the one-dimensional image matrix to be matched. The matching result matrix calculation module is used to perform image matching calculations on the one-dimensional image matrix to be matched, the forward one-dimensional template matrix, and the reverse one-dimensional template matrix respectively, to obtain a forward matching result matrix and a reverse matching result matrix composed of matching rates. The matrix with the largest overall matching rate is selected as the matching result matrix, and the point corresponding to the maximum matching rate is taken as the matching starting point. The image matching result calculation module is used to calculate the correspondence between the matching template matrix and the one-dimensional image matrix to be matched based on the matching starting point, so as to obtain the image matching result.

7. An edge-angle-based template matching device, characterized by comprising: include: Memory, used to store computer programs; A processor, configured to implement the edge angle-based template matching method as described in any one of claims 1 to 5 when executing the computer program.

8. A storage medium, characterized by The storage medium stores a computer program that, when executed by a processor, implements the template matching method based on edge angle as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Template matching algorithm based on edge and gradient features

    CN110472674A

  • Detection method and detection system

    CN114612371A