Image Angle Calculation Method and System Based on Multiple Candidate Matching Points

By employing a multi-candidate matching point method and angle difference clustering, the problem of numerous incorrect matching points in traditional feature point matching algorithms on geometrically symmetrical objects is solved, thus achieving accurate angle measurement for wheel hub detection.

CN118261960BActive Publication Date: 2025-10-31SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410441063.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2025-10-31
Estimated Expiration
2044-04-12

AI Technical Summary

Technical Problem

Traditional feature point matching algorithms are prone to producing many incorrect matching points on geometrically symmetrical objects, leading to inaccurate angle measurements in wheel hub detection.

Method used

A multi-candidate matching point method is adopted, which extracts feature points with small feature distances and satisfying the center distance constraint as candidate matching points, and removes erroneous matching points by angle difference clustering, and calculates the correct image rotation angle.

Benefits of technology

It increases the number of correct matching points, quickly filters out the correct image rotation angle, and ensures the accuracy of wheel hub detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118261960B_ABST
    Figure CN118261960B_ABST
Patent Text Reader

Abstract

This invention discloses an image angle calculation method and system based on multiple candidate matching points. The method includes: placing a wheel hub of the same model as the one to be tested on a conveyor belt, aligning the center line of one spoke of the wheel hub with the horizontal line; taking a picture of the wheel hub to obtain a standard wheel hub image; placing the wheel hub to be tested on the conveyor belt and taking a picture of the wheel hub to be tested to obtain an image of the wheel hub to be tested; extracting feature point sets M and N from the background-removed standard wheel hub image and the image of the wheel hub to be tested, respectively; and obtaining any feature point M from M based on M and N. i Candidate matching point set P i M i With P i The feature points in the data form candidate matching point pairs; the feature point M is calculated. i The angle difference of candidate matching point pairs is used; the angle differences of candidate matching point pairs of all feature points in the feature point set M are clustered, and the mean of all angle differences in the class containing the most angle differences is calculated as the rotation angle. This invention can obtain more correct matching point pairs and obtain the correct image rotation angle through clustering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image feature matching technology, and in particular to an image angle calculation method, system, terminal device, and computer-readable storage medium based on multiple candidate matching points. Background Technology

[0002] Motor vehicle wheel hubs are typical planar symmetrical casting products. Because each wheel hub must be inspected for potential internal defects using X-ray equipment, the hub needs to be placed directly under the X-ray detector for inspection. For wheel hubs with a diameter typically between 24 and 30 inches, the size of the X-ray detector limits the inspection area to one or two spokes per workstation. Due to the equally spaced spoke angles, after the first spoke is photographed from a reference position, the hub is rotated by a set angle to move to the next workstation for inspection, completing one full rotation to inspect all spokes. However, it's difficult to guarantee that the spokes are perfectly aligned with the reference line when the hub is placed on the line. The hub must be rotated to align the spokes with the reference line, ensuring that the inspection after each rotation focuses on the spoke area, not the hollow space between the spokes. Therefore, measuring and adjusting the spoke angles are essential technical steps in wheel hub inspection.

[0003] Feature point matching algorithms are often used for measuring the angles of objects because they have good rotation and scale invariance. However, when the object being measured has many similar features and is geometrically symmetrical, traditional feature point matching algorithms obtain a large number of incorrect matching points, often resulting in too few correct matching points to obtain the correct angle. Summary of the Invention

[0004] To address the shortcomings of the prior art, this invention provides an image angle calculation method, system, terminal device, and computer-readable storage medium based on multiple candidate matching points. By using all feature points with sufficiently small feature distances that satisfy the center distance constraint as candidate matching points, the invention retains as many correct matching point pairs as possible. Furthermore, by clustering the angle differences between matching point pairs to remove incorrect matching points, the correct image rotation angle is obtained.

[0005] The first objective of this invention is to provide an image angle calculation method based on multiple candidate matching points.

[0006] The second objective of this invention is to provide an image angle calculation system based on multiple candidate matching points.

[0007] The third objective of this invention is to provide a terminal device.

[0008] A fourth objective of this invention is to provide a computer-readable storage medium.

[0009] The first objective of this invention can be achieved by adopting the following technical solution:

[0010] A method for calculating image angles based on multiple candidate matching points, the method comprising:

[0011] Place a wheel hub of the same model as the one to be tested on the conveyor belt, and align the center line of one spoke of the wheel hub with the horizontal line; take a picture of the wheel hub to obtain a standard wheel hub image;

[0012] Based on the standard wheel hub image I with background removed M Extract the feature point set M = {M1, M2, ..., M} m};

[0013] The wheel hub to be tested is placed on the conveyor belt, and the wheel hub to be tested is photographed. The camera position is the same as when photographing a wheel hub of the same model as the wheel hub to be tested, so as to obtain an image of the wheel hub to be tested.

[0014] Based on the background-removed image of the wheel hub I N Extract the feature point set N = {N1, N2, ..., N} n};

[0015] For any feature point M in the feature point set M i From the feature point set N, select all feature points whose feature distance is sufficiently small and satisfy the center distance constraint as candidate matching points; set M... i Each candidate matching point forms a candidate matching point pair; the feature point M is calculated. i The angle difference between candidate matching point pairs; where i = 1, 2, ..., m;

[0016] Cluster the angle differences of candidate matching point pairs for all feature points in the feature point set M, and denote the class containing the most angle differences as θ. max θ max The mean of all angle differences is the rotation angle of the image of the wheel hub to be tested.

[0017] Furthermore, the feature point M i The set of candidate matching points is denoted as P. i ;

[0018] The calculated feature point M i The angle difference between candidate matching point pairs is as follows:

[0019] M i With P i The angle difference of the k-th candidate matching point is:

[0020]

[0021] In the formula, atan is the arctangent function; in the image I M middle, These are the x and y coordinates of the image center, respectively. Feature point M i The x and y coordinates; in image I N middle, These are the x and y coordinates of the image center, respectively. They are set P i The x and y coordinates of the k-th candidate matching point.

[0022] Furthermore, for any feature point M in the feature point set M... i From the feature point set N, all feature points whose feature distance is sufficiently small and satisfy the center distance constraint are selected as candidate matching points, specifically:

[0023]

[0024] In the formula, j = 1, 2, ..., n; P i For feature point M i Candidate matching point N j A set; For feature point M i With N j Feature distance between them; The distance to the maximum possible feature; For feature point M i The minimum feature distance found in the point set N; For feature point M i Coordinates and Image I M Euclidean distance between the center coordinates; For candidate matching points N j Coordinates and Image I N The Euclidean distance between the center coordinates; T1 is the feature distance threshold coefficient, used to ensure that the feature distance of the candidate matching point is small enough; T2∈[0,1] is the feature ratio threshold, used to ensure that the feature distance of the candidate matching point is small compared with the feature distance of the optimal matching point; T3 is the center distance threshold, used to ensure that the feature point M i Coordinates, N j The difference between the coordinates and the corresponding image center coordinates is small enough.

[0025] Furthermore, the feature distance is calculated using the SURF algorithm.

[0026] Furthermore, the clustering of the angle differences between candidate matching point pairs of all feature points in the feature point set M includes:

[0027] The angle differences between the candidate matching point pairs are reordered according to the order in which they were obtained, and denoted as θ.t ,t=1,2,…,l;where l is the number of candidate matching point pairs;

[0028] Let k = 1, and assign θ1 to the angle difference class θ1;

[0029] m = 2;

[0030] j = 1;

[0031] Calculate the angle difference class θ j The mean is like Then θ m Assigned to the angle difference class θ j Otherwise: j = j + 1, if j <= k, then return to the calculation of the angle difference θ. j The mean is And continue with the subsequent operations;

[0032] If j = k + 1, then k = k + 1, and θ m Assigned to the angle difference class θ k Where T4 is the set angle difference threshold;

[0033] If m = m + 1, and m ≤ l, return j = 1 and continue with subsequent operations.

[0034] Further, background removal includes:

[0035] The Hough circle transform is applied to the wheel hub image to obtain the outer contour of the wheel hub;

[0036] Set all pixel values ​​of the outer image of the wheel hub's outer contour to 0;

[0037] The image is cropped based on the minimum bounding rectangle of the wheel hub's outer contour to obtain the image after removing the background;

[0038] The wheel hub images are a standard wheel hub image and a wheel hub image to be tested.

[0039] Furthermore, the SURF algorithm is used to extract feature point sets from the images; the images are, respectively, standard wheel hub images with the background removed. M And the image of the wheel hub after background removal I N .

[0040] The second objective of this invention can be achieved by adopting the following technical solution:

[0041] An image angle calculation system based on multiple candidate matching points, the system comprising:

[0042] The first image acquisition module is used to place a wheel hub of the same model as the wheel hub to be tested on the conveyor belt and make the center line of one spoke of the wheel hub coincide with the horizontal line; to take a picture of the wheel hub and obtain a standard wheel hub image;

[0043] The first extraction module is used to extract a standard wheel hub image I after removing the background. M Extract the feature point set M = {M1, M2, ..., M} m};

[0044] The second image acquisition module is used to place the wheel hub to be tested on the conveyor belt, take a picture of the wheel hub to be tested, and the position of the camera when taking the picture is the same as when taking a picture of a wheel hub of the same model as the wheel hub to be tested, so as to obtain an image of the wheel hub to be tested.

[0045] The second extraction module is used to extract the background-removed image of the wheel hub I. N Extract the feature point set N = {N1, N2, ..., N} n};

[0046] The candidate matching module is used to match any feature point M in the feature point set M. i From the feature point set N, select all feature points whose feature distance is sufficiently small and satisfy the center distance constraint as candidate matching points; set M... i Each candidate matching point forms a candidate matching point pair; the feature point M is calculated. i The angle difference between candidate matching point pairs; where i = 1, 2, ..., m;

[0047] The clustering module is used to cluster the angle differences of candidate matching point pairs of all feature points in the feature point set M, and the class containing the most angle differences is denoted as θ. max θ max The mean of all angle differences is the rotation angle of the image of the wheel hub to be tested.

[0048] The third objective of this invention can be achieved by adopting the following technical solution:

[0049] A terminal device includes a processor and a memory for storing a processor-executable program. When the processor executes the program stored in the memory, it implements the above-described image angle calculation method based on multiple candidate matching points.

[0050] The fourth objective of this invention can be achieved by adopting the following technical solution:

[0051] A computer-readable storage medium storing a program that, when executed by a processor, implements the above-described image angle calculation method based on multiple candidate matching points.

[0052] The present invention has the following advantages over the prior art:

[0053] 1. Compared with the standard method that finds only one matching point for each feature point, this invention takes all feature points with sufficiently small feature distances and satisfying the center distance constraint as candidate matching points, which can obtain more correct matching point pairs;

[0054] 2. By simply clustering the angle differences of matching point pairs, the correct matching point pairs can be quickly selected and the correct image rotation angle can be obtained. Attached Figure Description

[0055] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0056] Figure 1 This is a flowchart of the image angle calculation method based on multiple candidate matching points according to Embodiment 1 of the present invention;

[0057] Figure 2 This is a standard wheel hub image of Embodiment 1 of the present invention (in which the center line of the spokes coincides with the horizontal line);

[0058] Figure 3 This is the standard wheel hub image I after background removal in Embodiment 1 of the present invention. M ;

[0059] Figure 4 The image shown is of the wheel hub to be tested in Embodiment 1 of the present invention (the center line of the spokes in the image has a certain angle with the horizontal line);

[0060] Figure 5 Image I of the wheel hub after background removal in Embodiment 1 of the present invention N ;

[0061] Figure 6 This is a rotated image of the wheel hub of Embodiment 1 of the present invention;

[0062] Figure 7 This is a structural block diagram of the image angle calculation system based on multiple candidate matching points according to Embodiment 2 of the present invention;

[0063] Figure 8 This is a structural block diagram of the terminal device according to Embodiment 3 of the present invention. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be understood that the specific embodiments described are merely used to explain this application and are not intended to limit this application.

[0065] Example 1:

[0066] like Figure 1 As shown, this embodiment provides an image angle calculation method based on multiple candidate matching points, which includes two processes: offline and online.

[0067] (1) Offline process.

[0068] Specifically, the following steps are included:

[0069] (1-1) Place a wheel hub of the same model as the one to be tested on the conveyor belt, and manually rotate the hub until the center line of one of its spokes coincides with the horizontal line. Take a picture using a camera fixed above the conveyor belt to obtain a standard wheel hub image, such as... Figure 2 As shown.

[0070] (1-2) Remove the background from the standard wheel hub image.

[0071] Since the wheel hub is circular, the specific steps for removing the background in this embodiment are as follows:

[0072] (1-2-1) Obtain the outer contour of the wheel hub using Hough circle transformation.

[0073] (1-2-2) Set all pixel values ​​of the outer contour of the wheel hub to 0.

[0074] (1-2-3) Extract the image based on the minimum bounding rectangle of the wheel hub's outer contour to obtain the standard image I after removing the background. M ,like Figure 3 As shown.

[0075] (1-3) Extracting image I using feature extraction algorithms M The feature point set M = {M1, M2, ..., M} m} and the feature descriptor corresponding to each feature point.

[0076] The feature extraction algorithm used in this embodiment is the SURF algorithm.

[0077] (2) Online process.

[0078] Specifically, the following steps are included:

[0079] (2-1) Place the wheel hub to be tested on the conveyor belt and take a picture using a camera at the same position as in offline step (1-1) to obtain an image of the wheel hub to be tested, such as... Figure 4 As shown.

[0080] (2-2) Remove the background from the image of the wheel hub to be tested. The method is the same as in the offline step (1-2), and the image of the wheel hub to be tested after removing the background is obtained. N ,like Figure 5 As shown.

[0081] (2-3) Extract image I using feature extraction algorithms N The feature point set N = {N1, N2, ..., N} n The method for obtaining the feature descriptor for each feature point is the same as in offline steps (1-3).

[0082] (2-4) Obtain candidate matching point pairs.

[0083] The specific process is as follows:

[0084] For each M in the feature point set M i Its candidate matching point set is:

[0085]

[0086] In the formula, For feature point M i With N j The feature distance between them is calculated using the SURF algorithm. The distance to the maximum possible feature; For feature point M i The minimum feature distance that can be found in the point set N; For feature point M i Coordinates and Image I M Euclidean distance between the center coordinates; For feature point N j Coordinates and Image I N The Euclidean distance between the center coordinates; T1 is the feature distance threshold coefficient, used to ensure that the feature distance of the candidate matching point is small enough; T2∈[0,1] is the feature ratio threshold, used to ensure that the feature distance of the candidate matching point is small compared with the feature distance of the optimal matching point, that is, the candidate matching point is a reasonable replacement for the optimal matching point; T3 is the center distance threshold, used to ensure that the difference between the distance between the coordinates of the two points and the coordinates of the center of the image is small enough.

[0087] In this embodiment, T1 is 0.15, T2 is 0.6, and T3 is 15.

[0088] M iWith P i Each feature point in the model forms a pair of candidate matching points.

[0089] (2-5) Calculate the angle difference of all candidate matching point pairs.

[0090] M i With P i The angle difference of the j-th feature point is:

[0091]

[0092] In the formula, atan is the arctangent function, and the angular quadrant of its output is determined by the signs of the input numerator and denominator; in image I M middle, These are the x and y coordinates of the image center, respectively. Feature point M i The x and y coordinates; in image I N middle, These are the x and y coordinates of the image center, respectively; They are point sets P i The x and y coordinates of the j-th feature point.

[0093] (2-6) Perform simple clustering on the angle difference of candidate matching point pairs and calculate the image rotation angle θ.

[0094] The specific steps are as follows:

[0095] (2-6-1) Reorder the angle differences of the candidate matching point pairs according to the order in which they were obtained, and denote them as θ. i ,i=1,2,…,l, where l is the number of candidate matching point pairs.

[0096] (2-6-2) Let k = 1, and assign θ1 to the angle difference class θ1.

[0097] (2-6-3) For each subsequent θ i i = 2, ..., l and all existing angle difference classes θ j The mean of all angle differences in each angle difference class in the sequence j = 1, ..., k. If a comparison is made, Then θ i Assigned to the angle difference class θ j Otherwise, let k = k + 1, and set θ i Assigned to the angle difference class θ k .

[0098] Where T4 is the angle difference threshold, and in this embodiment, T4 is set to 5.

[0099] (2-6-4) Let the class containing the most angle differences be θ.max The mean of all angle differences in this class This is the desired image rotation angle θ.

[0100] Rotate image I by this angle N The results are as follows Figure 6 As shown, it can be seen that after rotation, the spokes of the wheel hub basically coincide with the horizontal line.

[0101] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware, and the corresponding program can be stored in a computer-readable storage medium.

[0102] It should be noted that although the method operations of the above embodiments are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the order of execution of the described steps may be changed. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0103] Example 2:

[0104] like Figure 7 As shown, this embodiment provides an image angle calculation system based on multiple candidate matching points. The system includes a first image acquisition module 701, a first extraction module 702, a second image acquisition module 703, a second extraction module 704, a candidate matching module 705, and a clustering module 706, wherein:

[0105] The first image acquisition module 701 is used to place a wheel hub of the same model as the wheel hub to be tested on the conveyor belt and make the center line of one spoke of the wheel hub coincide with the horizontal line; to take a picture of the wheel hub and obtain a standard wheel hub image;

[0106] The first extraction module 702 is used to extract information from a standard wheel hub image i after removing the background. M Extract the feature point set M = {M1, M2, ..., M} m};

[0107] The second image acquisition module 703 is used to place the wheel hub to be tested on the conveyor belt, take a picture of the wheel hub to be tested, and the position of the camera when taking the picture is the same as when taking a picture of a wheel hub of the same model as the wheel hub to be tested, so as to obtain an image of the wheel hub to be tested.

[0108] The second extraction module 704 is used to extract the background-removed wheel hub image I. N Extract the feature point set N = {N1, N2, ..., N} n};

[0109] Candidate matching module 705 is used to match any feature point M in the feature point set M. i From the feature point set N, select all feature points whose feature distance is sufficiently small and satisfy the center distance constraint as candidate matching points; set M... i Each candidate matching point forms a candidate matching point pair; the feature point M is calculated. i The angle difference between candidate matching point pairs; where i = 1, 2, ..., m;

[0110] Clustering module 706 is used to cluster the angle differences of candidate matching point pairs of all feature points in the feature point set M, and the class containing the most angle differences is denoted as θ. max θ max The mean of all angle differences is the rotation angle of the image of the wheel hub to be tested.

[0111] The specific implementation of each module in this embodiment can be found in Embodiment 1 above, and will not be repeated here. It should be noted that the system provided in this embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure can be divided into different functional modules to complete all or part of the functions described above.

[0112] Example 3:

[0113] This embodiment provides a terminal device, which can be a computer, such as... Figure 8 As shown, the processor 802, memory, input device 803, display 804, and network interface 805 are connected via system bus 801. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium 806 and internal memory 807. The non-volatile storage medium 806 stores the operating system, computer programs, and database. The internal memory 807 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. When the processor 802 executes the computer program stored in the memory, it implements the image angle calculation method based on multiple candidate matching points in Embodiment 1, as follows:

[0114] Place a wheel hub of the same model as the one to be tested on the conveyor belt, and align the center line of one spoke of the wheel hub with the horizontal line; take a picture of the wheel hub to obtain a standard wheel hub image;

[0115] Based on the standard wheel hub image I with background removed M Extract the feature point set M = {M1, M2, ..., M} m};

[0116] The wheel hub to be tested is placed on the conveyor belt, and the wheel hub to be tested is photographed. The camera position is the same as when photographing a wheel hub of the same model as the wheel hub to be tested, so as to obtain an image of the wheel hub to be tested.

[0117] Based on the background-removed image of the wheel hub I N Extract the feature point set N = {N1, N2, ..., N} n};

[0118] For any feature point M in the feature point set M i From the feature point set N, select all feature points whose feature distance is sufficiently small and satisfy the center distance constraint as candidate matching points; set M... i Each candidate matching point forms a candidate matching point pair; the feature point M is calculated. i The angle difference between candidate matching point pairs; where i = 1, 2, ..., m;

[0119] Cluster the angle differences of candidate matching point pairs for all feature points in the feature point set M, and denote the class containing the most angle differences as θ. max θ max The mean of all angle differences is the rotation angle of the image of the wheel hub to be tested.

[0120] Example 4:

[0121] This embodiment provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the image angle calculation method based on multiple candidate matching points described in Embodiment 1 above, as follows:

[0122] Place a wheel hub of the same model as the one to be tested on the conveyor belt, and align the center line of one spoke of the wheel hub with the horizontal line; take a picture of the wheel hub to obtain a standard wheel hub image;

[0123] Based on the standard wheel hub image I with background removed M Extract the feature point set M = {M1, M2, ..., M} m};

[0124] The wheel hub to be tested is placed on the conveyor belt, and the wheel hub to be tested is photographed. The camera position is the same as when photographing a wheel hub of the same model as the wheel hub to be tested, so as to obtain an image of the wheel hub to be tested.

[0125] Based on the background-removed image of the wheel hub I N Extract the feature point set N = {N1, N2, ..., N} n};

[0126] For any feature point M in the feature point set M iFrom the feature point set N, select all feature points whose feature distance is sufficiently small and satisfy the center distance constraint as candidate matching points; set M... i Each candidate matching point forms a candidate matching point pair; the feature point M is calculated. i The angle difference between candidate matching point pairs; where i = 1, 2, ..., m;

[0127] Cluster the angle differences of candidate matching point pairs for all feature points in the feature point set M, and denote the class containing the most angle differences as θ. max θ max The mean of all angle differences is the rotation angle of the image of the wheel hub to be tested.

[0128] It should be noted that the computer-readable storage medium in this embodiment can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0129] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope disclosed in the present invention, based on the technical solution and inventive concept of the present invention, shall fall within the scope of protection of the present invention.

Claims

1. A method for calculating image angles based on multiple candidate matching points, characterized in that, The method includes: Place a wheel hub of the same model as the one to be tested on the conveyor belt, and align the center line of one spoke of the wheel hub with the horizontal line; take a picture of the wheel hub to obtain a standard wheel hub image; Based on the standard wheel hub image I with background removed M Extract the feature point set M = {M1, M2, ..., M} m }; The wheel hub to be tested is placed on the conveyor belt, and the wheel hub to be tested is photographed. The camera position is the same as when photographing a wheel hub of the same model as the wheel hub to be tested, so as to obtain an image of the wheel hub to be tested. Based on the background-removed image of the wheel hub I N Extract the feature point set N = {N1, N2, ..., N} n }; For any feature point M in the feature point set M i From the feature point set N, select all feature points whose feature distance is sufficiently small and satisfy the center distance constraint as candidate matching points; set M... i Each candidate matching point forms a candidate matching point pair; the feature point M is calculated. i The angle difference between candidate matching point pairs; where i = 1, 2, ..., m; Cluster the angle differences of candidate matching point pairs for all feature points in the feature point set M, and denote the class containing the most angle differences as θ. max θ max The mean of all angle differences is the rotation angle of the image of the wheel hub to be tested; Wherein, for any feature point M in the feature point set M i From the feature point set N, all feature points whose feature distance is sufficiently small and satisfy the center distance constraint are selected as candidate matching points, specifically: In the formula, j = 1, 2, ..., n; P i For feature point M i Candidate matching point N j A set; For feature point M i With N j The characteristic distance between them; The distance to the maximum possible feature; For feature point M i The minimum feature distance found in the point set N; For feature point M i Coordinates and Image I M Euclidean distance between the center coordinates; For candidate matching points N j Coordinates and Image I N The Euclidean distance between the center coordinates; T1 is the feature distance threshold coefficient, used to ensure that the feature distance of the candidate matching point is small enough; T2∈[0,1] is the feature ratio threshold, used to ensure that the feature distance of the candidate matching point is small compared with the feature distance of the optimal matching point; T3 is the center distance threshold, used to ensure that the feature point M i Coordinates, N j The difference between the coordinates and the corresponding image center coordinates is sufficiently small; The calculated feature point M i The angle difference between candidate matching point pairs is as follows: M i With P i The angle difference of the k-th candidate matching point is: In the formula, atan is the arctangent function; in the image I M middle, These are the x and y coordinates of the image center, respectively. Feature point M i The x and y coordinates; in image I N middle, These are the x and y coordinates of the image center, respectively. They are set P i The x and y coordinates of the k-th candidate matching point.

2. The image angle calculation method according to claim 1, characterized in that, The feature distance is calculated using the SURF algorithm.

3. The image angle calculation method according to claim 1, characterized in that, The clustering of the angle differences between candidate matching point pairs of all feature points in the feature point set M includes: The angle differences between the candidate matching point pairs are reordered according to the order in which they were obtained, and denoted as θ. t ,t=1,2,…,l;where l is the number of candidate matching point pairs; Let c = 1, and assign θ1 to the angle difference class θ1; m=2; d=1; Calculate the angle difference class θ d The mean is like Then θ m Assigned to the angle difference class θ d Otherwise: d = d + 1; if d <= c, then return to the calculation of the angle difference θ. d The mean is And continue with the subsequent operations; If d = c + 1, then c = c + 1, and θ m Assigned to the angle difference class θ c Where T4 is the set angle difference threshold; If m = m + 1, and m ≤ l, return d = 1 and continue with subsequent operations.

4. The image angle calculation method according to claim 1, characterized in that, Background removal includes: The Hough circle transform is applied to the wheel hub image to obtain the outer contour of the wheel hub; Set all pixel values ​​of the outer image of the wheel hub's outer contour to 0; The image is cropped based on the minimum bounding rectangle of the wheel hub's outer contour to obtain the image after removing the background; The wheel hub images are a standard wheel hub image and a wheel hub image to be tested.

5. The image angle calculation method according to claim 1, characterized in that, The SURF algorithm is used to extract feature point sets from the images; the images are, respectively, standard wheel hub images with the background removed. M And the image of the wheel hub after background removal I N .

6. An image angle calculation system based on multiple candidate matching points, characterized in that, The system includes: The first image acquisition module is used to place a wheel hub of the same model as the wheel hub to be tested on the conveyor belt and make the center line of one spoke of the wheel hub coincide with the horizontal line; to take a picture of the wheel hub and obtain a standard wheel hub image; The first extraction module is used to extract data from a standard wheel hub image I after removing the background. M Extract the feature point set M = {M1, M2, ..., M} m }; The second image acquisition module is used to place the wheel hub to be tested on the conveyor belt, take a picture of the wheel hub to be tested, and the position of the camera when taking the picture is the same as when taking a picture of a wheel hub of the same model as the wheel hub to be tested, so as to obtain an image of the wheel hub to be tested. The second extraction module is used to extract the background from the test wheel hub image I. N Extract the feature point set N = {N1, N2, ..., N} n }; The candidate matching module is used to match any feature point M in the feature point set M. i From the feature point set N, select all feature points whose feature distance is sufficiently small and satisfy the center distance constraint as candidate matching points; set M... i Each candidate matching point forms a candidate matching point pair; the feature point M is calculated. i The angle difference between candidate matching point pairs; where i = 1, 2, ..., m; The clustering module is used to cluster the angle differences of candidate matching point pairs of all feature points in the feature point set M, and the class containing the most angle differences is denoted as θ. max θ max The mean of all angle differences is the rotation angle of the image of the wheel hub to be tested; Wherein, for any feature point M in the feature point set M i From the feature point set N, all feature points whose feature distance is sufficiently small and satisfy the center distance constraint are selected as candidate matching points, specifically: In the formula, j = 1, 2, ..., n; P i For feature point M i Candidate matching point N j A set; For feature point M i With N j The characteristic distance between them; The distance to the maximum possible feature; For feature point M i The minimum feature distance found in the point set N; For feature point M i Coordinates and Image I M Euclidean distance between the center coordinates; For candidate matching points N j Coordinates and Image I N The Euclidean distance between the center coordinates; T1 is the feature distance threshold coefficient, used to ensure that the feature distance of the candidate matching point is small enough; T2∈[0,1] is the feature ratio threshold, used to ensure that the feature distance of the candidate matching point is small compared with the feature distance of the optimal matching point; T3 is the center distance threshold, used to ensure that the feature point M i Coordinates, N j The difference between the coordinates and the corresponding image center coordinates is sufficiently small; The calculated feature point M i The angle difference between candidate matching point pairs is as follows: M i With P i The angle difference of the k-th candidate matching point is: In the formula, atan is the arctangent function; in the image I M middle, These are the x and y coordinates of the image center, respectively. Feature point M i The x and y coordinates; in image I N middle, These are the x and y coordinates of the image center, respectively. They are set P i The x and y coordinates of the k-th candidate matching point.

7. A terminal device, comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the image angle calculation method according to any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image angle calculation method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Hub model identification method

    CN109614977A

  • Apparatus and method for detecting a vertex of an image

    US20120257791A1