Image feature matching method, device, system and PCB board visual inspection equipment

By extracting the preset dimension of the preset dimension in the image matching, the characteristic description of the preset dimension is less than 128 dimension and the error matching point is eliminated, the problem of complexity and high error matching rate of the image matching process in the existing technologies has been solved. Image matching.

CN113723428BActive Publication Date: 2025-01-24ZHUHAI GREE REFRIGERATION TECH CENT OF ENERGY SAVING & ENVIRONMENTAL PROTECTION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110955667.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2025-01-24
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

In the prior art, the image matching process is complex and the calculation is large, resulting in a long matching time and reducing the dimension of the feature descriptor, the problem of mismatch is prone to occur.

Method used

Adopt a image feature matching method to extract the target characteristics of the preset dimension of less than 128 dimensions and the standard feature descriptors, to match the target feature points and standard feature points, and eliminate the initial matching point set to eliminate the matching point. Process and generate matching data.

Benefits of technology

It reduces the degree of calculation complexity and matching time, reduces the error matching rate, and improves the accuracy of image matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113723428B_ABST
    Figure CN113723428B_ABST
Patent Text Reader

Abstract

The present invention relates to an image feature matching method, device, system and PCB board visual inspection equipment, the method comprising: obtaining a pre-input to-be-matched image and a standard image; extracting a target feature point set and a standard feature point set; extracting a target feature descriptor of a preset dimension for each target feature point and a standard feature descriptor of a preset dimension for each standard feature point, wherein the preset dimension is less than 128 dimensions; according to the target feature descriptor and the standard feature descriptor, roughly matching the target feature point and the standard feature point, matching the matching point of each target feature point from the standard feature point set, generating an initial matching point set; removing the mismatched points from the initial matching point set, and obtaining matching data. In this scheme, the dimension of the extracted feature descriptor is less than 128 dimensions, and the mismatches are finally removed, which reduces the mismatch rate while reducing the computational complexity and matching time, and ensures the image matching accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image matching technology, and in particular to an image feature matching method, device, system and PCB board visual inspection equipment. Background Art

[0002] During PCB production, it is necessary to inspect the circuits, silk screens, and versions on the PCB surface. However, manual visual inspection of PCBs is prone to fatigue, which can lead to missed inspections or incorrect inspections, resulting in low inspection accuracy and efficiency.

[0003] In the existing technology, the traditional SIFT image matching method is usually used to perform visual inspection on the PCB board surface. However, each feature point extracted by the traditional SIFT image matching method includes a 128-dimensional feature descriptor. During the matching process, the calculation process of the 128-dimensional feature descriptor is complex and computationally intensive, resulting in a long matching time. However, if the dimension of the feature descriptor is reduced, when there are many similar features in the PCB board image, a large number of duplicate feature points will be generated, making it easy to mismatch.

[0004] Therefore, how to reduce the computational complexity in the matching process, improve the matching efficiency and reduce the mismatch rate is a technical problem that those skilled in the art need to solve urgently. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide an image feature matching method, device, system and PCB board visual inspection equipment to solve the problem in the prior art that the matching process is complex and computationally intensive, resulting in a long matching time. However, if the dimension of the feature descriptor is reduced, when there are many similar features in the PCB board image, a large number of duplicate feature points will be generated, which will easily lead to mismatching.

[0006] To achieve the above objectives, the present invention adopts the following technical solutions:

[0007] An image feature matching method, comprising:

[0008] Obtain the pre-input image to be matched and the standard image;

[0009] Extracting a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image;

[0010] Extracting a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set; wherein the preset dimension is less than 128 dimensions;

[0011] According to the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, the target feature point and the standard feature point are roughly matched, the matching point corresponding to each target feature point is matched from the standard feature point set, and an initial matching point set between the target feature point set and the standard feature point set is generated;

[0012] The initial matching point set is processed to eliminate incorrect matching points to obtain matching data between the image to be matched and the standard image.

[0013] Furthermore, in the above-mentioned image feature matching method, the step of removing mismatched points from the initial matching point set to obtain matching data between the image to be matched and the standard image includes:

[0014] Taking the initial matching point set as the to-be-processed point set, dividing all matching point pairs in the to-be-processed point set into a preset number of parts, and obtaining the preset number of to-be-processed point subsets;

[0015] Performing mismatching point elimination processing on each of the subsets of points to be processed to obtain the inliers corresponding to each of the subsets of points to be processed;

[0016] A current inlier point set corresponding to the image to be matched is obtained by collecting all inlier points in the point subset to be processed;

[0017] Add one to the pre-recorded current iteration number and determine whether the updated current iteration number reaches the target iteration number determined in the pre-training;

[0018] If the current number of iterations reaches the target number of iterations, a basic matrix is ​​calculated based on the current interior point set based on the eight-point method as matching data between the image to be matched and the standard image;

[0019] If the current number of iterations does not reach the target number of iterations, the current inlier point set is used as a point set to be processed, and allocation and mismatching point elimination processing are continued on the point set to be processed until the current number of iterations reaches the target number of iterations.

[0020] Furthermore, in the above-mentioned image feature matching method, the step of removing mismatched points from each of the subsets of points to be processed to obtain the inliers corresponding to each of the subsets of points to be processed includes:

[0021] Randomly extracting a preset number of current matching point pairs from the subset of points to be processed;

[0022] Determine a current basic matrix based on the current matching point pair based on the eight-point method;

[0023] Determining the conversion error value of each group of initial matching point pairs not extracted from the subset of points to be processed according to the current basic matrix and a preset error calculation rule;

[0024] Determine whether the conversion error value of each group of initial matching point pairs is less than a preset error threshold;

[0025] If the conversion error value of the initial matching point pair is less than the preset error threshold, the initial matching point pair is regarded as an inlier pair;

[0026] If the conversion error of the initial matching point pair is not less than the preset error threshold, the initial matching point pair is eliminated;

[0027] Gathering the inlier point pairs corresponding to the to-be-processed point subset to obtain a current inlier point subset corresponding to the to-be-processed point subset;

[0028] Incrementing the pre-recorded number of draws by one, and determining whether the number of draws reaches a pre-set target number of draws;

[0029] If the number of extractions does not reach the target number of extractions, a preset number of current matching point pairs are randomly extracted from the to-be-processed point subset to redetermine the current inlier point subset;

[0030] If the number of extractions reaches the target number of extractions, the number of inlier pairs in the current inlier subset corresponding to each extraction is compared, and the inlier in the current inlier subset with the largest number of inlier pairs is used as the inlier corresponding to the point subset to be processed.

[0031] Furthermore, in the above-mentioned image feature matching method, the step of determining the target number of iterations includes:

[0032] Performing feature extraction and rough matching on a pre-input first training image and a second training image to obtain a training matching point set between the first training image and the second training image;

[0033] Performing mismatching point elimination processing on the training matching point set to obtain a training inlier point set corresponding to the training matching point set;

[0034] Increasing the pre-recorded number of training iterations by one, and calculating a basic matrix as training output data based on the training internal point set based on the eight-point method;

[0035] determining, based on the training output data, whether the training output data conforms to training matching data between the first training image and the second training image;

[0036] If the training output data matches the training matching data, the updated number of training iterations is used as the target number of iterations;

[0037] If the training output data does not conform to the training matching data, the training inlier point set is used as the training matching point set to perform mismatching point elimination processing until the training output data conforms to the training matching data;

[0038] The first training image and the second training image are images of the same object from different angles.

[0039] Furthermore, in the above-mentioned image feature matching method, the target feature points and the standard feature points are roughly matched according to the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, matching the matching points corresponding to each target feature point from the standard feature point set, and generating an initial matching point set between the target feature point set and the standard feature point set, including:

[0040] According to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, the Euclidean distance between each standard feature point and the target feature point is calculated, and the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point are determined;

[0041] Calculating the ratio of the closest Euclidean distance to the next closest Euclidean distance corresponding to each target feature point;

[0042] Determine whether the distance ratio corresponding to each target feature point is less than a preset threshold;

[0043] If the distance ratio corresponding to the target feature point is less than the preset threshold, the standard feature point corresponding to the nearest Euclidean distance is used as the matching point corresponding to the target feature point;

[0044] All the target feature points and all the matching point sets corresponding to the target feature points are combined to obtain an initial matching point set between the target feature point set and the standard feature point set.

[0045] Furthermore, in the above-mentioned image feature matching method, before calculating the Euclidean distance between each standard feature point and the target feature point based on the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point, and the Euclidean distance calculation rule, and determining the nearest Euclidean distance and the next nearest Euclidean distance corresponding to the target feature point, the method further includes:

[0046] Creating a matching tree corresponding to each target feature point in the target feature point set according to the standard feature point set and the target feature point set;

[0047] Correspondingly, the step of calculating the Euclidean distance between each standard feature point and the target feature point based on the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point, and the Euclidean distance calculation rule, and determining the nearest Euclidean distance and the next nearest Euclidean distance corresponding to the target feature point, includes:

[0048] Based on the matching tree corresponding to each target feature point, according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, the Euclidean distance between each standard feature point and the target feature point is calculated, and the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point are determined.

[0049] The present invention also provides an image feature matching device, comprising:

[0050] An acquisition module is used to acquire the pre-input image to be matched and the standard image;

[0051] A first extraction module is used to extract a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image;

[0052] A second extraction module is configured to extract a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set; the preset dimension is less than 128 dimensions;

[0053] a coarse matching module, configured to perform coarse matching on the target feature points and the standard feature points according to the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, match the matching points corresponding to each target feature point from the standard feature point set, and generate an initial matching point set between the target feature point set and the standard feature point set;

[0054] The elimination module is used to eliminate incorrect matching points from the initial matching point set to obtain matching data between the image to be matched and the standard image.

[0055] Furthermore, in the above-mentioned image feature matching device, the elimination module includes: an allocation unit, a processing unit, a first collection unit, an iterative judgment unit, a matrix calculation unit and a first determination unit;

[0056] The allocating unit is configured to use the initial matching point set as a to-be-processed point set, and divide all matching points in the to-be-processed point set into a preset number of parts, to obtain a preset number of to-be-processed point subsets;

[0057] The processing unit is configured to perform mismatching point elimination processing on each of the subsets of points to be processed to obtain the inliers corresponding to each of the subsets of points to be processed;

[0058] The first collection unit is used to collect all the inlier points in the subset of points to be processed to obtain a current inlier point set corresponding to the image to be matched;

[0059] The iteration judgment unit is used to increase the pre-recorded current iteration number by one, and judge whether the updated current iteration number reaches the target iteration number determined in advance;

[0060] The matrix calculation unit is configured to calculate a basic matrix as matching data between the image to be matched and the standard image based on the eight-point method and the current interior point set if the current number of iterations reaches the target number of iterations;

[0061] The first determining unit is configured to, if the current number of iterations does not reach the target number of iterations, use the current internal point set as a point set to be processed, and continue to allocate and remove mismatched points from the point set to be processed until the current number of iterations reaches the target number of iterations.

[0062] Furthermore, in the above-mentioned image feature matching device, the coarse matching module includes: a distance calculation unit, a ratio calculation unit, a ratio judgment unit, a second determination unit and a second aggregation unit;

[0063] The distance calculation unit is used to calculate the Euclidean distance between each standard feature point and the target feature point according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, and determine the nearest Euclidean distance and the next nearest Euclidean distance corresponding to the target feature point;

[0064] The ratio calculation unit is used to calculate the distance ratio of the closest Euclidean distance to the second closest Euclidean distance corresponding to each target feature point;

[0065] The ratio judgment unit is used to judge whether the distance ratio corresponding to each target feature point is less than a preset threshold;

[0066] The second determining unit is configured to use the standard feature point corresponding to the nearest Euclidean distance as the matching point corresponding to the target feature point if the distance ratio corresponding to the target feature point is less than the preset threshold;

[0067] The second collection unit is configured to collect all the target feature points and all the matching point sets corresponding to the target feature points to obtain an initial matching point set between the target feature point set and the standard feature point set.

[0068] Furthermore, in the above-mentioned image feature matching device, the coarse matching module further comprises: a creation unit;

[0069] The creation unit is configured to create a matching tree corresponding to each target feature point in the target feature point set based on the standard feature point set and the target feature point set;

[0070] The distance extraction unit is specifically used to calculate the Euclidean distance between each standard feature point and the target feature point based on the matching tree corresponding to each target feature point, according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, and determine the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point.

[0071] The present invention also provides an image feature matching system, comprising: a processor and a memory connected to the processor;

[0072] The memory is used to store a computer program, and the computer program is at least used to execute the above-mentioned image feature matching method;

[0073] The processor is configured to call and execute the computer program.

[0074] The present invention also provides a PCB board visual inspection device, comprising: an image collector, a data analyzer and the above-mentioned image feature matching system;

[0075] The image collector and the data analyzer are respectively connected to the image feature matching system;

[0076] The image collector is used to collect a PCB board surface image and input the PCB board surface image into the image feature matching system, so that the image feature matching system outputs matching data corresponding to the PCB board surface image;

[0077] The data analyzer is used to analyze the matching data output by the image feature matching system to determine the detection result of the PCB board.

[0078] An image feature matching method, device, system, and PCB board visual inspection equipment include: obtaining a pre-input image to be matched and a standard image; extracting a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image; extracting a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set, wherein the preset dimension is less than 128; performing a rough match between the target feature point and the standard feature point based on the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, matching each target feature point from the standard feature point set, and generating an initial matching point set corresponding to the target feature point set and the standard feature point set; performing a mismatching point elimination process on the initial matching point set to obtain matching data between the image to be matched and the standard image. Using the technical solution of the present invention, the dimension of the extracted feature descriptor is less than 128, thereby reducing computational complexity and matching time, and finally eliminating mismatches, thereby reducing the mismatching rate while reducing computational complexity and matching time, thereby ensuring image matching accuracy.

[0079] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0081] Figure 1 This is a flowchart provided by an embodiment of the image feature matching method of the present invention;

[0082] Figure 2 yes Figure 1 Schematic diagram of the division of feature descriptors;

[0083] Figure 3 This is a structural diagram of an image feature matching device according to an embodiment of the present invention;

[0084] Figure 4 This is a structural diagram of an image feature matching system according to an embodiment of the present invention;

[0085] Figure 5 The figure is a schematic structural diagram of an embodiment of a PCB visual inspection device according to the present invention. DETAILED DESCRIPTION

[0086] To make the objectives, technical solutions, and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other implementations obtained by those of ordinary skill in the art without inventive effort are within the scope of protection of the present invention.

[0087] Figure 1 This is a flow chart provided by an embodiment of the image feature matching method of the present invention. Figure 1 As shown, the image feature matching method of this embodiment specifically includes the following steps:

[0088] S101: Obtain pre-input image to be matched and standard image.

[0089] This embodiment first needs to obtain pre-input images to be matched and standard images, wherein the image to be matched is a surface image of the PCB board captured by an image acquisition device, and the standard image is a standard image of the PCB board in the drawing.

[0090] S102: Extracting a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image.

[0091] Utilizing corresponding extraction techniques, target feature points are extracted from the image to be matched to form a target feature point set corresponding to the image to be matched, and standard feature points are extracted from the standard image to form a standard feature point set corresponding to the standard image. The extraction technique preferably employs the SIFT technique in the prior art, which is a prior art. The specific steps for extracting feature points from an image are prior art and will not be further elaborated in this embodiment.

[0092] S103 , extracting a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set.

[0093] A target feature descriptor of a preset dimension is extracted for each target feature point in the target feature point set from the image to be matched, and a standard feature descriptor of a preset dimension is extracted for each standard feature point in the standard feature point set from the standard image. The preset dimension is less than 128. This reduces the computational complexity of subsequent matching using the descriptors and improves matching speed. In this embodiment, the preset dimension is preferably 64 dimensions. Figure 2 yes Figure 1 Schematic diagram of the division of feature descriptors, such as Figure 2 As shown in FIG, the division diagram is a division diagram of a 64-dimensional feature descriptor. The extraction method of the 64-dimensional feature descriptor is as follows:

[0094] The feature points (such as Figure 2 The 8×8 square pixel area around the black dot in the middle Figure 2 The middle black frame square area in the figure is divided into 2×2=4 small square sub-pixel areas (such as Figure 2 Each region a contains information in 8 directions. The information in the 8 directions is accumulated according to the gradient to obtain a feature point descriptor with a dimension of 4×8=32.

[0095] In order to supplement the 32-dimensional feature point descriptor, the 16×16 square pixels (such as Figure 2 Select 4 trapezoidal pixel areas close to the feature points (such as Figure 2 The gradient accumulation method is fully utilized to process the 8 directional information contained in all rectangular pixel areas (areas b), and the feature point descriptor obtained on this basis is 4×8=32 dimensions.

[0096] By combining these two feature descriptors, we can get a new 32+32=64-dimensional feature descriptor.

[0097] In this embodiment, the 64-dimensional feature descriptor extraction method is based on a combination of two descriptors with different geometric shapes and different numbers of pixels. To eliminate these differences, the two descriptors need to be balanced. Furthermore, to reflect the influence of distance on the weight, the gradient is weighted according to the distance. This new descriptor provides a more comprehensive description of image information than the original one and better reflects the characteristics of key points.

[0098] S104. Based on the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, the target feature points and the standard feature points are roughly matched, the matching points corresponding to each target feature point are matched from the standard feature point set, and an initial matching point set between the target feature point set and the standard feature point set is generated.

[0099] In this embodiment, the KNN algorithm (nearest neighbor algorithm) can be used to perform a rough match between the target feature points and the standard feature points based on the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, thereby matching the matching point corresponding to each target feature point from the standard feature point set. Each target feature point and its corresponding matching point can also be combined into a matching point pair, and all matching point pairs can be combined to generate an initial matching point set between the target feature point set and the standard feature point set.

[0100] S105 , performing a process of eliminating incorrect matching points on the initial matching point set to obtain matching data between the image to be matched and the standard image.

[0101] Since the dimensions of the target feature descriptor and the standard feature descriptor in this embodiment are both less than 128 dimensions, the image mismatch rate may increase. Therefore, after determining the initial matching point set between the target feature point set and the standard feature point set, this embodiment needs to perform mismatch point elimination on the initial matching point set to obtain matching data between the image to be matched and the standard image. The RANSAC algorithm is preferably used for mismatch point elimination. In this way, not only can the computational complexity of the image matching process be reduced by reducing the dimension of the feature descriptor, thereby improving the image matching efficiency, but the mismatch rate can also be reduced by eliminating mismatch points, thereby ensuring the accuracy of image matching.

[0102] The image feature matching method of this embodiment obtains a pre-input image to be matched and a standard image; extracts a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image; extracts a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set, wherein the preset dimension is less than 128 dimensions; performs a rough match between the target feature point and the standard feature point based on the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, matches each target feature point from the standard feature point set, and generates an initial matching point set corresponding to the target feature point set and the standard feature point set; and removes mismatched points from the initial matching point set to obtain matching data between the image to be matched and the standard image. Using the technical solution of this embodiment, the dimension of the extracted feature descriptor is less than 128 dimensions, reducing computational complexity and matching time. Finally, mismatches are removed, thereby reducing computational complexity and matching time while also reducing the mismatch rate and ensuring image matching accuracy.

[0103] Furthermore, in the image feature matching method of this embodiment, step S104 specifically includes the following steps:

[0104] First, according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, the Euclidean distance between each standard feature point and the target feature point is calculated, and the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point are determined.

[0105] According to the Euclidean distance calculation rules and the pre-extracted target feature descriptors corresponding to each target feature point and the standard feature descriptors corresponding to each standard feature point, the Euclidean distance between each target feature point and each standard feature point is calculated respectively for each target feature point, and the nearest Euclidean distance and the second nearest Euclidean distance are extracted from these Euclidean distances, thereby determining the nearest Euclidean distance and the second nearest Euclidean distance corresponding to each target feature point.

[0106] Second, the ratio of the closest Euclidean distance to the second closest Euclidean distance corresponding to each target feature point is calculated.

[0107] This embodiment needs to calculate the nearest Euclidean distance and the second nearest Euclidean distance corresponding to each target feature point, and then calculate the ratio between the nearest Euclidean distance and the second nearest Euclidean distance corresponding to each target feature point, so as to determine the distance ratio corresponding to each target feature point.

[0108] Third, determine whether the distance ratio corresponding to each target feature point is less than a preset threshold.

[0109] This embodiment needs to determine whether the distance ratio corresponding to each target feature point is less than a preset threshold, wherein the preset threshold is preferably set to 2.

[0110] Fourth, if the distance ratio corresponding to the target feature point is less than a preset threshold, the standard feature point corresponding to the nearest Euclidean distance is used as the matching point corresponding to the target feature point.

[0111] If it is determined that the distance ratio corresponding to the target feature point is less than the preset threshold, it means that there is a reliable match between the standard feature point whose distance to the target feature point is the nearest Euclidean distance and the target feature point. Therefore, the standard feature point corresponding to the nearest Euclidean distance is used as the matching point corresponding to the target feature point. In this way, the matching points corresponding to all target feature points can be determined.

[0112] If it is determined that the distance ratio corresponding to the target feature point is not less than the preset threshold, it means that the standard feature point whose distance to the target feature point is the closest Euclidean distance is not a matching point of the target feature point.

[0113] Fifth, all target feature points and all matching point sets corresponding to the target feature points are combined to obtain an initial matching point set between the target feature point set and the standard feature point set.

[0114] After all the matching points corresponding to the target feature points are determined through the above steps, each target feature point and its corresponding matching point can be combined into a matching point pair, and all matching point pairs are collected to generate an initial matching point set between the target feature point set and the standard feature point set.

[0115] Furthermore, step S104 in this embodiment further includes the following steps:

[0116] According to the standard feature point set and the target feature point set, a matching tree corresponding to each target feature point in the target feature point set is created.

[0117] This embodiment can utilize KD-Tree technology along with a standard feature point set and a target feature point set to create a matching tree corresponding to each target feature point in the target feature point set. This allows for the use of KD-Tree combined with a best-node-first search (BBF) method to find the closest and next closest Euclidean distances to determine the target feature point. The establishment of a matching tree facilitates search during matching and automatically switches search strategies based on the standard feature point set and the target feature point set, reducing time and further improving image matching efficiency.

[0118] Furthermore, in the image feature matching method of this embodiment, step S105 specifically includes the following steps:

[0119] First, the initial matching point set is used as the to-be-processed point set, and all matching point pairs in the to-be-processed point set are divided into a preset number of parts to obtain the preset number of to-be-processed point subsets.

[0120] In this embodiment, the initial matching point set between the generated target feature point set and the standard feature point set is used as the point set to be processed, all matching point pairs in the point set to be processed are divided into a preset number of parts, and each set of matching point pairs is used as a subset of points to be processed, thereby obtaining a preset number of subsets of points to be processed.

[0121] Second, each subset of points to be processed is processed to eliminate mismatched points, and obtain the inner points corresponding to each subset of points to be processed.

[0122] In this embodiment, the RANSAC algorithm can be used to remove mismatched points from each subset of points to be processed, and obtain the inliers corresponding to each subset of points to be processed. The specific steps are as follows:

[0123] (1) Randomly extract a preset number of current matching point pairs from the subset of points to be processed.

[0124] Using the RANSAC algorithm, a preset number of current matching point pairs are randomly extracted from the subset of points to be processed, wherein the preset number in this embodiment is preferably 4.

[0125] (2) Based on the eight-point method, determine the current basic matrix according to the current matching point pairs.

[0126] The current basic matrix is ​​calculated using the eight-point method and a preset number of randomly selected current matching point pairs. The eight-point method is a prior art, so those skilled in the art can calculate the current basic matrix using a preset number of current matching point pairs based on the prior art, which will not be further elaborated in this embodiment.

[0127] (3) According to the current basic matrix and the preset error calculation rules, the conversion error value of each group of initial matching point pairs that have not been extracted in the point subset to be processed is determined.

[0128] After calculating the current basic matrix, the conversion error value of each set of initial matching point pairs that were not extracted in the point subset to be processed is calculated based on the current basic matrix and the preset error calculation rules. The preset error calculation rules are:

[0129] E(x1,x2,H)=d(x1,H -1 ,x2) 2 +d(x2,Hx1) 2

[0130] Among them, x1, x2 are the initial matching point pairs, and H is the current basic matrix.

[0131] (4) Determine whether the conversion error value of each group of initial matching point pairs is less than a preset error threshold.

[0132] (5) If the conversion error value of the initial matching point pair is less than the preset error threshold, the initial matching point pair is regarded as an inlier point pair.

[0133] (6) If the conversion error of the initial matching point pair is not less than the preset error threshold, the initial matching point pair is eliminated.

[0134] (7) The inlier point pairs corresponding to the to-be-processed point subset are grouped together to obtain the current inlier point subset corresponding to the to-be-processed point subset.

[0135] After the conversion error value of each group of initial matching point pairs is judged, many inlier pairs can be obtained. These inlier pairs are the inlier pairs corresponding to the current subset of points to be processed. By gathering these inlier pairs, the current subset of inliers corresponding to the subset of points to be processed can be obtained.

[0136] (8) The pre-recorded number of extractions is increased by one, and it is determined whether the number of extractions reaches the pre-set target number of extractions.

[0137] After determining the conversion error value for each initial matching point pair in the current subset of points to be processed, this embodiment increments the pre-recorded number of extractions by one, and then determines whether the extraction has reached the preset target number of extractions. The target number of extractions is the maximum number of random sampling values ​​that the RANSAC method can perform by setting the parameter.

[0138] (9) If the number of extractions does not reach the target number of extractions, a preset number of current matching point pairs are randomly extracted from the point subset to be processed, thereby re-determining the current inner point subset.

[0139] If it is determined that the number of extractions does not reach the target number of extractions, random extraction is performed again from the current subset of points to be processed, and then the current inlier subset is re-determined based on the current matching point pairs randomly extracted this time.

[0140] (10) If the number of extractions reaches the target number of extractions, the number of inlier pairs in the current inlier subset corresponding to each extraction is compared, and the inlier in the current inlier subset with the largest number of inlier pairs is used as the inlier corresponding to the point subset to be processed.

[0141] If it is determined that the number of extractions has reached the target number of extractions, the number of inlier pairs in the current inlier subset determined by each extraction is compared, and the inliers in the current inlier subset at the time of the extraction with the largest number of inlier pairs are used as the inliers corresponding to the current point subset to be processed.

[0142] The inner points corresponding to each subset of points to be processed are obtained by the above method for obtaining the inner points corresponding to the subset of points to be processed.

[0143] Third, the inlier point set in all the point subsets to be processed is collected to obtain the current inlier point set corresponding to the image to be matched.

[0144] After obtaining the inliers corresponding to each subset of points to be processed through the above steps, all inliers in all subsets of points to be processed are gathered together to obtain the current inlier set corresponding to the image to be matched.

[0145] Fourth, the pre-recorded current number of iterations is increased by one, and it is determined whether the updated current number of iterations reaches the target number of iterations determined in the pre-training.

[0146] In this embodiment, after determining the current set of inliers corresponding to the image to be matched, the pre-recorded current number of iterations is incremented by one, and then a determination is made as to whether the current number of iterations has reached the target number of iterations determined in advance during training. In this embodiment, the target number of iterations is the target number of iterations determined when training using the first and second training images according to the execution steps of the image matching method of this embodiment.

[0147] Fifth, if the current number of iterations reaches the target number of iterations, the basic matrix is ​​calculated based on the eight-point method and the current internal point set as the matching data between the image to be matched and the standard image.

[0148] If it is determined that the current number of iterations has reached the target number of iterations, the eight-point method is used to calculate the basic matrix based on the internal points in the current internal point set corresponding to the image to be matched, and the basic matrix is ​​used as the matching data between the image to be matched and the standard image.

[0149] Sixth, if the current number of iterations does not reach the target number of iterations, the current internal point set is used as the point set to be processed, and the point set to be processed is continuously allocated and mismatched points are eliminated until the current number of iterations reaches the target number of iterations.

[0150] Furthermore, in the image feature matching method of this embodiment, the steps for determining the target number of iterations are as follows:

[0151] First, feature extraction and rough matching are performed on the pre-input first training image and the second training image to obtain a training matching point set between the first training image and the second training image.

[0152] Before matching the image to be matched with the standard image, the image feature matching method needs to be trained using the first training image and the second training image to determine the target number of iterations. Therefore, it is first necessary to perform feature extraction and rough matching on the pre-input first training image and the second training image to obtain a set of training matching points between the first training image and the second training image. The feature extraction and rough matching steps are the same as those of steps S102, S103, and S104 described above and will not be further elaborated in this embodiment. The first training image and the second training image are images of the same object from different angles, where the different angles can be slightly translated and rotated.

[0153] Second, the training matching point set is processed to remove the mismatched points to obtain the training inlier point set corresponding to the training matching point set.

[0154] The RANSAC algorithm is used to remove mismatched points from the training matching point set to obtain a training inlier set corresponding to the training matching point set. The method for determining the training inlier set is the same as the method for determining the current inlier set corresponding to the image to be matched in step S105 above, and will not be further elaborated in this embodiment.

[0155] Third, the pre-recorded number of training iterations is increased by one, and based on the eight-point method, the basic matrix is ​​calculated as the training output data according to the training internal point set.

[0156] After determining the training inlier set corresponding to the training matching point set, this embodiment needs to increase the pre-recorded number of training iterations by one, and use the eight-point method to calculate the basic matrix based on the inlier pairs in the training inlier set, and use the basic matrix as the training output data.

[0157] Fourth, based on the training output data, it is determined whether the training output data matches the training matching data between the first training image and the second training image.

[0158] Fifth, if the training output data matches the training matching data, the updated number of training iterations is used as the target number of iterations.

[0159] If it is determined that the training output data is consistent with the training matching data, it means that after the mismatching points are eliminated for the training iteration number, more accurate output data can be obtained. Therefore, the updated training iteration number is used as the target iteration number.

[0160] Sixth, if the training output data does not match the training matching data, the training internal point set is used as the training matching point set to remove the incorrect matching points until the training output data matches the training matching data.

[0161] If it is determined that the training output data does not conform to the training matching data, it means that after the wrong matching point elimination process for the training iteration number, there are still many wrong matching points. It is necessary to use the obtained training internal point set as the training matching point set and continue to use the training matching point set to eliminate wrong matching points until the training output data conforms to the training matching data.

[0162] For the purpose of being more comprehensive, corresponding to the image feature matching method provided in the embodiment of the present invention, the present application also provides an image feature matching device.

[0163] Figure 3 FIG. 1 is a structural diagram of an embodiment of an image feature matching device according to the present invention. Figure 3 As shown, the image feature matching device of this embodiment includes: an acquisition module 11 , a first extraction module 12 , a second extraction module 13 , a coarse matching module 14 and a elimination module 15 .

[0164] An acquisition module 11 is used to acquire a pre-input image to be matched and a standard image;

[0165] A first extraction module 12 is used to extract a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image;

[0166] A second extraction module 13 is configured to extract a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set; the preset dimension is less than 128 dimensions;

[0167] A coarse matching module 14 is configured to perform coarse matching on the target feature points and the standard feature points based on the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, match the matching point corresponding to each target feature point from the standard feature point set, and generate an initial matching point set between the target feature point set and the standard feature point set;

[0168] The elimination module 15 is used to eliminate incorrect matching points from the initial matching point set to obtain matching data between the image to be matched and the standard image.

[0169] The image feature matching device of this embodiment extracts feature descriptors with a dimension less than 128 dimensions, which reduces the computational complexity and matching time, and finally eliminates false matches. While reducing the computational complexity and matching time, it also reduces the false matching rate, thereby ensuring the accuracy of image matching.

[0170] Furthermore, in the image feature matching device of this embodiment, the elimination module 15 includes: an allocation unit, a processing unit, a first collection unit, an iterative judgment unit, a matrix calculation unit and a first determination unit.

[0171] An allocating unit is configured to use the initial matching point set as a to-be-processed point set, divide all matching point pairs in the to-be-processed point set into a preset number of portions, and obtain a preset number of to-be-processed point subsets;

[0172] A processing unit, configured to remove mismatched points from each subset of points to be processed, and obtain an inner point corresponding to each subset of points to be processed;

[0173] The first collection unit is used to collect all the inlier points in the subset of points to be processed to obtain the current inlier point set corresponding to the image to be matched;

[0174] An iteration judgment unit is used to increase the pre-recorded current iteration number by one and judge whether the updated current iteration number reaches the target iteration number determined in advance by training;

[0175] A matrix calculation unit is used to calculate a basic matrix as matching data between the image to be matched and the standard image based on the eight-point method and the current interior point set if the current number of iterations reaches the target number of iterations;

[0176] The first determining unit is configured to, if the current number of iterations does not reach the target number of iterations, use the current internal point set as the to-be-processed point set, and continue to allocate and remove mismatched points from the to-be-processed point set until the current number of iterations reaches the target number of iterations.

[0177] Furthermore, in the image feature matching device of this embodiment, the processing unit is specifically configured to:

[0178] Randomly extract a preset number of current matching point pairs from the subset of points to be processed;

[0179] Based on the eight-point method, the current basic matrix is ​​determined according to the current matching point pairs;

[0180] Determine the conversion error value of each set of initial matching point pairs that are not extracted in the point subset to be processed based on the current basic matrix and the preset error calculation rules;

[0181] Determine whether the conversion error value of each group of initial matching point pairs is less than a preset error threshold;

[0182] If the conversion error value of the initial matching point pair is less than the preset error threshold, the initial matching point pair is regarded as an inlier pair;

[0183] If the conversion error of the initial matching point pair is not less than the preset error threshold, the initial matching point pair is eliminated;

[0184] Collect the inlier point pairs corresponding to the to-be-processed point subset to obtain the current inlier point subset corresponding to the to-be-processed point subset;

[0185] Increment the pre-recorded number of draws by one, and determine whether the number of draws reaches the pre-set target number of draws;

[0186] If the number of extractions does not reach the target number of extractions, a preset number of current matching point pairs are randomly extracted from the point subset to be processed, thereby re-determining the current inlier point subset;

[0187] If the number of extractions reaches the target number of extractions, the number of inlier pairs in the current inlier subset corresponding to each extraction is compared, and the inlier in the current inlier subset with the largest number of inlier pairs is used as the inlier corresponding to the point subset to be processed.

[0188] Furthermore, in the image feature matching device of this embodiment, the step of determining the target number of iterations in the iteration judgment unit includes:

[0189] Performing feature extraction and rough matching on a pre-input first training image and a second training image to obtain a training matching point set between the first training image and the second training image;

[0190] Eliminate the mismatched points from the training matching point set to obtain the training internal point set corresponding to the training matching point set;

[0191] The pre-recorded number of training iterations is increased by one, and based on the eight-point method, the basic matrix is ​​calculated according to the training internal point set as the training output data;

[0192] determining, based on the training output data, whether the training output data conforms to training matching data between the first training image and the second training image;

[0193] If the training output data matches the training matching data, the updated number of training iterations is used as the target number of iterations;

[0194] If the training output data does not match the training matching data, the training internal point set is used as the training matching point set to remove the incorrect matching points until the training output data matches the training matching data;

[0195] The first training image and the second training image are images of the same object from different angles.

[0196] Furthermore, in the image feature matching device of this embodiment, the coarse matching module 14 includes: a distance calculation unit, a ratio calculation unit, a ratio judgment unit, a second determination unit and a second aggregation unit.

[0197] a distance calculation unit, configured to calculate the Euclidean distance between each standard feature point and the target feature point based on the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point, and the Euclidean distance calculation rule, and determine the nearest Euclidean distance and the next nearest Euclidean distance corresponding to the target feature point;

[0198] A ratio calculation unit, used to calculate the distance ratio between the closest Euclidean distance and the second closest Euclidean distance corresponding to each target feature point;

[0199] A ratio judgment unit is used to judge whether the distance ratio corresponding to each target feature point is less than a preset threshold;

[0200] A second determining unit is configured to use the standard feature point corresponding to the nearest Euclidean distance as the matching point corresponding to the target feature point if the distance ratio corresponding to the target feature point is less than a preset threshold;

[0201] The second collection unit is used to collect all target feature points and the matching point sets corresponding to all target feature points to obtain an initial matching point set between the target feature point set and the standard feature point set.

[0202] Furthermore, in the image feature matching device of this embodiment, the coarse matching module 14 further includes: a creation unit.

[0203] A creation unit, configured to create a matching tree corresponding to each target feature point in the target feature point set based on the standard feature point set and the target feature point set;

[0204] The distance extraction unit is specifically used to calculate the Euclidean distance between each standard feature point and the target feature point based on the matching tree corresponding to each target feature point, according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, and determine the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point.

[0205] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0206] Figure 4 FIG. 1 is a structural diagram of an embodiment of the image feature matching system of the present invention. Figure 4 As shown, the image feature matching system of this embodiment includes: a processor 21 and a memory 22 connected to the processor 21. The memory 22 is used to store a computer program, which is used to at least execute the image feature matching method described in the above embodiment. The processor 21 is used to call and execute the computer program.

[0207] The image feature matching system of this embodiment extracts feature descriptors with a dimension less than 128, which reduces the computational complexity and matching time, and finally eliminates false matches. While reducing the computational complexity and matching time, it also reduces the false matching rate and ensures the accuracy of image matching.

[0208] Figure 5 FIG. 1 is a schematic diagram showing a structure of an embodiment of a PCB visual inspection device according to the present invention. Figure 5 As shown, the PCB visual inspection device of this embodiment includes: an image collector, a data analyzer, and the image feature matching system described in the above embodiment. The image collector and the data analyzer are respectively connected to the image feature matching system.

[0209] The image collector is used to collect the surface image of the PCB board and input the surface image of the PCB board into the image feature matching system so that the image feature matching system outputs the matching data corresponding to the surface image of the PCB board; the data analyzer is used to analyze the matching data output by the image feature matching system to determine the detection result of the PCB board.

[0210] The PCB board visual inspection device of this embodiment, when performing image matching, extracts feature descriptors with a dimension less than 128 dimensions, which reduces the computational complexity and matching time, and finally eliminates false matches. While reducing the computational complexity and matching time, it also reduces the false matching rate, thereby ensuring the accuracy of image matching.

[0211] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0212] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" is at least two.

[0213] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0214] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. An image feature matching method, characterized in that: include: Obtaining the pre-input image to be matched and the standard image; Extracting a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image; Extracting a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set; the preset dimension is less than 128 dimensions; According to the standard feature point set and the target feature point set, a matching tree corresponding to each target feature point in the target feature point set is created; According to the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, the target feature point and the standard feature point are roughly matched, the matching point corresponding to each target feature point is matched from the standard feature point set, and an initial matching point set between the target feature point set and the standard feature point set is generated; wherein, according to the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, the target feature point and the standard feature point are roughly matched, the matching point corresponding to each target feature point is matched from the standard feature point set, including: based on the matching points corresponding to each target feature point Matching trees, calculating the Euclidean distance between each standard feature point and the target feature point according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, determining the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point; calculating the distance ratio of the nearest Euclidean distance to the second nearest Euclidean distance corresponding to each of the target feature points; judging whether the distance ratio corresponding to each of the target feature points is less than a preset threshold; if the distance ratio corresponding to the target feature point is less than the preset threshold, taking the standard feature point corresponding to the nearest Euclidean distance as the matching point corresponding to the target feature point; Eliminating mismatched points from the initial matching point set to obtain matching data between the image to be matched and the standard image, including: Taking the initial matching point set as the to-be-processed point set, dividing all matching point pairs in the to-be-processed point set into a preset number of parts, and obtaining the preset number of to-be-processed point subsets; Perform mismatching point elimination processing on each of the to-be-processed point subsets to obtain the inner points corresponding to each of the to-be-processed point subsets; The internal point set in all the to-be-processed point subsets is used to obtain a current internal point set corresponding to the to-be-matched image; Add one to the pre-recorded current iteration number, and determine whether the updated current iteration number reaches the target iteration number determined by pre-training; If the current number of iterations reaches the target number of iterations, a basic matrix is ​​calculated based on the eight-point method and the current interior point set as matching data between the image to be matched and the standard image; If the current number of iterations does not reach the target number of iterations, the current internal point set is used as a point set to be processed, and the point set to be processed is continuously allocated and mismatched points are eliminated until the current number of iterations reaches the target number of iterations.

2. The image feature matching method according to claim 1, characterized in that: The step of performing mismatching point elimination processing on each of the to-be-processed point subsets to obtain the inner points corresponding to each of the to-be-processed point subsets includes: Randomly extracting a preset number of current matching point pairs from the subset of points to be processed; Based on the eight-point method, determining the current basic matrix according to the current matching point pair; Determine the conversion error value of each group of initial matching point pairs that are not extracted in the to-be-processed point subset according to the current basic matrix and a preset error calculation rule; Determine whether the conversion error value of each group of initial matching point pairs is less than a preset error threshold; If the conversion error value of the initial matching point pair is less than the preset error threshold, the initial matching point pair is used as an inner point pair; If the conversion error of the initial matching point pair is not less than the preset error threshold, the initial matching point pair is eliminated; Collecting the inlier point pairs corresponding to the to-be-processed point subset to obtain a current inlier point subset corresponding to the to-be-processed point subset; Increasing the pre-recorded number of draws by one, and determining whether the number of draws reaches a pre-set target number of draws; If the number of extractions does not reach the target number of extractions, a preset number of current matching point pairs are randomly extracted from the to-be-processed point subset again, thereby re-determining the current inner point subset; If the number of extractions reaches the target number of extractions, the number of inlier pairs in the current inlier subset corresponding to each extraction is compared, and the inlier in the current inlier subset with the largest number of inlier pairs is used as the inlier corresponding to the point subset to be processed.

3. The image feature matching method according to claim 1, characterized in that: The step of determining the target number of iterations comprises: Performing feature extraction and rough matching on a pre-input first training image and a second training image to obtain a training matching point set between the first training image and the second training image; Performing mismatching point elimination processing on the training matching point set to obtain a training inlier point set corresponding to the training matching point set; The pre-recorded number of training iterations is increased by one, and based on the eight-point method, a basic matrix is ​​calculated according to the training internal point set as training output data; According to the training output data, determining whether the training output data conforms to training matching data between the first training image and the second training image; If the training output data matches the training matching data, the updated number of training iterations is used as the target number of iterations; If the training output data does not match the training matching data, the training internal point set is used as the training matching point set to remove mismatched points until the training output data matches the training matching data; The first training image and the second training image are images of the same object at different angles.

4. The image feature matching method according to claim 1, characterized in that: The generating an initial matching point set between the target feature point set and the standard feature point set comprises: All the target feature points and all the matching point sets corresponding to the target feature points are combined to obtain an initial matching point set between the target feature point set and the standard feature point set.

5. An image feature matching device, characterized in that: include: An acquisition module is used to acquire the pre-input image to be matched and the standard image; A first extraction module, used to extract a target feature point set corresponding to the image to be matched and a standard feature point set corresponding to the standard image; A second extraction module is used to extract a target feature descriptor of a preset dimension for each target feature point in the target feature point set and a standard feature descriptor of a preset dimension for each standard feature point in the standard feature point set; the preset dimension is less than 128 dimensions; A coarse matching module, used for creating a matching tree corresponding to each target feature point in the target feature point set according to the standard feature point set and the target feature point set; According to the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, the target feature point and the standard feature point are roughly matched, the matching point corresponding to each target feature point is matched from the standard feature point set, and an initial matching point set between the target feature point set and the standard feature point set is generated; wherein, according to the target feature descriptor corresponding to each target feature point and the standard feature descriptor corresponding to each standard feature point, the target feature point and the standard feature point are roughly matched, the matching point corresponding to each target feature point is matched from the standard feature point set, including: based on the matching points corresponding to each target feature point Matching trees, calculating the Euclidean distance between each standard feature point and the target feature point according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, determining the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point; calculating the distance ratio of the nearest Euclidean distance to the second nearest Euclidean distance corresponding to each of the target feature points; judging whether the distance ratio corresponding to each of the target feature points is less than a preset threshold; if the distance ratio corresponding to the target feature point is less than the preset threshold, taking the standard feature point corresponding to the nearest Euclidean distance as the matching point corresponding to the target feature point; A removal module, used for removing mismatched points from the initial matching point set to obtain matching data between the image to be matched and the standard image; The elimination module includes: an allocation unit, a processing unit, a first collection unit, an iteration judgment unit, a matrix calculation unit and a first determination unit; The allocating unit is used to use the initial matching point set as a to-be-processed point set, divide all matching points in the to-be-processed point set into a preset number of parts, and obtain a preset number of to-be-processed point subsets; The processing unit is used to perform mismatch point elimination processing on each of the to-be-processed point subsets to obtain the inner points corresponding to each of the to-be-processed point subsets; The first collection unit is used to obtain a current inner point set corresponding to the image to be matched by collecting all the inner point sets in the point subsets to be processed; The iteration judgment unit is used to increase the pre-recorded current iteration number by one, and judge whether the updated current iteration number reaches the target iteration number determined in advance by training; The matrix calculation unit is used to calculate a basic matrix as matching data between the image to be matched and the standard image based on the eight-point method and the current interior point set if the current number of iterations reaches the target number of iterations; The first determination unit is used to, if the current number of iterations does not reach the target number of iterations, use the current internal point set as a point set to be processed, and continue to allocate and remove mismatched points on the point set to be processed until the current number of iterations reaches the target number of iterations.

6. The image feature matching device according to claim 5, characterized in that: The rough matching module includes: a distance calculation unit, a ratio calculation unit, a ratio judgment unit, a second determination unit and a second collection unit; The distance calculation unit is used to calculate the Euclidean distance between each standard feature point and the target feature point according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, and determine the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point; The ratio calculation unit is used to calculate the distance ratio between the closest Euclidean distance and the second closest Euclidean distance corresponding to each target feature point; The ratio judgment unit is used to judge whether the distance ratio corresponding to each of the target feature points is less than a preset threshold; The second determining unit is configured to use the standard feature point corresponding to the nearest Euclidean distance as the matching point corresponding to the target feature point if the distance ratio corresponding to the target feature point is less than the preset threshold; The second set unit is used to obtain an initial matching point set between the target feature point set and the standard feature point set by combining all the target feature points and all the matching point sets corresponding to the target feature points.

7. The image feature matching device according to claim 6, characterized in that: The coarse matching module further includes: a creation unit; The creation unit is used to create a matching tree corresponding to each target feature point in the target feature point set according to the standard feature point set and the target feature point set; The distance extraction unit is specifically used to calculate the Euclidean distance between each standard feature point and the target feature point based on the matching tree corresponding to each target feature point, according to the target feature descriptor corresponding to each target feature point, the standard feature descriptor corresponding to each standard feature point and the Euclidean distance calculation rule, and determine the nearest Euclidean distance and the second nearest Euclidean distance corresponding to the target feature point.

8. An image feature matching system, characterized in that: include: A processor and a memory connected to the processor; The memory is used to store a computer program, and the computer program is at least used to execute the image feature matching method according to any one of claims 1 to 4; The processor is used for calling and executing the computer program.

9. A PCB board visual inspection device, characterized in that: include: An image collector, a data analyzer and an image feature matching system as claimed in claim 8; The image collector and the data analyzer are respectively connected to the image feature matching system; The image collector is used to collect the PCB board surface image, and input the PCB board surface image into the image feature matching system, so that the image feature matching system outputs the matching data corresponding to the PCB board surface image; The data analyzer is used to analyze the matching data output by the image feature matching system to determine the detection result of the PCB board.

Citation Information

Patent Citations

  • Efficient image matching method based on improved scale invariant feature transform (SIFT) algorithm

    CN102722731A

  • Depth-based light field splicing method

    CN108921781A