Image matching method and system based on feature extraction
Through the image matching method based on feature extraction, including partition processing, FAST algorithm and LDB descriptor, combined with the improved RANSAC algorithm and interquartile range elimination, the problem of insufficient image matching speed and accuracy in the existing technology is solved, and the problem of insufficient image matching speed and accuracy is achieved. More efficient and accurate matching results.
Patent Information
- Application Number
- CN202411287592.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-10-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing image matching technology has shortcomings in fast and accurate matching. In particular, the ORB algorithm performs poorly in the case of mismatching, and its real-time performance and robustness need to be further improved.
An image matching method based on feature extraction is adopted, including preprocessing, partition processing, using the FAST algorithm to extract feature points, LDB descriptors for feature description, an improved RANSAC algorithm and interquartile range to eliminate erroneous matching points to improve matching accuracy and rate.
Through image partitioning and efficient feature descriptor matching, the matching rate and accuracy are significantly improved, suitable for complex image scenes and diversified application scenarios, and the robustness and discrimination of the matching results are enhanced.
Smart Images

Figure CN118799600A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image matching method based on feature extraction. Background Art
[0002] Image matching technology has a wide range of applications, including 3D reconstruction, medical image analysis, map matching, aircraft navigation, weather forecasting, object recognition, image retrieval, automatic monitoring, motion tracking, etc. The technology has gradually spread to various fields, which has also put forward more stringent requirements for the technology, requiring not only fast and accurate, but also anti-interference and robustness, which is why the research on this technology is becoming more and more in-depth.
[0003] Image matching can be divided into three types of image matching methods: region-based, template-based, and feature-based. Region-based matching methods can be further divided into two types: grayscale information-based and transform domain information-based. The key to distinguishing feature-based matching methods from other matching methods lies in the word "feature". This method must go through the step of feature extraction before matching. Different images should select different features based on their unique information to ensure the uniqueness of the features and improve the efficiency of matching. Feature-based image matching includes feature extraction and feature matching. Feature extraction has two processes: feature detection and feature description. So far, scholars have proposed many feature-based matching algorithms. Existing studies have proposed a local feature detection algorithm based on scale feature invariance, namely the SIFT algorithm, but its high-dimensional descriptor greatly reduces the speed of feature extraction. Therefore, existing scholars have made improvements to the SIFT algorithm and proposed the SURF algorithm, which enhances robustness, but has poor real-time performance. Existing scholars have also improved the BRIEF algorithm and proposed the ORB algorithm, which solves the rotation adaptability problem of BRIEF while maintaining rotation invariance and noise resistance. Among them, the ORB algorithm is a binary algorithm that takes up little storage space, has improved speed, and has high real-time performance. It is currently widely used in image recognition, image stitching, and other aspects. The feature point detection of this algorithm is completed by the improved FAST algorithm, and the feature descriptor is constructed by the improved BRIEF operator. Although the ORB algorithm improves the matching speed, there are still cases of mismatching. Therefore, how to match quickly and accurately is an urgent problem to be solved. Summary of the invention
[0004] The present invention aims to improve the matching rate and solve the mismatch problem of existing image matching, and proposes an image matching method based on feature extraction, and the scheme specifically includes: An image matching method based on feature extraction, the method comprising: S1: Acquire a reference image and an image to be matched, and preprocess the reference image and the image to be matched; S2: performing partition processing on the preprocessed reference image and the image to be matched, and performing regional matching on the partitioned image; S3: The FAST algorithm is used to extract the feature points of the reference image and the feature points of the image to be matched after the region matching, and the LDB descriptor is used to describe the feature points of the reference image and the feature points of the image to be matched, so as to obtain the binary descriptors of the feature points of the reference image and the binary descriptors of the feature points of the image to be matched; S4: brute-force matching is performed between the binary descriptors of the reference image feature points and the binary descriptors of the image feature points to be matched; S5: Use the improved RANSAC algorithm to remove incorrectly matched feature points; S6: Use the interquartile range to further eliminate the feature points eliminated by the improved RANSAC algorithm to obtain the final matching result.
[0005] Furthermore, a preferred embodiment is proposed, wherein the preprocessing in step S1 includes image denoising and sharpening processing.
[0006] Furthermore, a preferred method is proposed, wherein step S2 includes: partitioning the image into 1×2 partitions, 2×2 partitions, 3×3 partitions, and 4×4 partitions.
[0007] Furthermore, a preferred method is proposed, in step S3, the feature points of the reference image and the feature points of the image to be matched are described using the LDB descriptor, including: Performing grayscale processing on the feature points of the reference image and the feature points of the image to be matched to obtain grayscale information of the feature points of the reference image and the feature points of the image to be matched; Adding the grayscale information of the feature points of the reference image and the grayscale information of the feature points of the image to be matched to the horizontal gradient and the vertical gradient; The feature point area of the reference image and the feature point area of the image to be matched are divided into sub-grids of size n×n, and the average grayscale information and gradient information of each sub-grid pixel are calculated:
[0008] in, For the i The average gray value of the pixels in the sub-grids, m is the number of pixels in each sub-grid, d x ( i )for x The gradient value of the direction, d y (i ) are respectively y The gradient value of the direction; Compare the average grayscale and gradient information of each pair of sub-grids to obtain the binary descriptors of the reference image and the image to be matched.
[0009] Furthermore, a preferred method is proposed, wherein step S4 comprises: calculating the distance between the binary descriptor of the reference image feature point and the binary descriptor of the image feature point to be matched.
[0010] Furthermore, a preferred embodiment is proposed, wherein step S5 comprises: S51: Randomly select two sample points, recorded as sample point 1 and sample point 2; S52: Calculate the midpoint between sample point 1 and sample point 2 ( x’ , y’ ), obtain the matching point farthest from the midpoint in the reference image and set it as sample midpoint 1; S53: Calculate the centroid of sample point 1, sample point 2 and sample midpoint 1 ( x ” , y ” ), obtain the point farthest from the centroid in the reference image, set it as sample point three, and sample point one, sample point two and sample point three are the first three matching sample points; S54: Calculate the center of gravity ( x ” , y ” ) and the midpoint of sample point three, and repeat steps S52 to S53 to obtain the fourth sample point, that is, to obtain 4 sets of matching sample point pairs; S55: Calculate the transformation matrix, and determine the points that meet the matching conditions among all sample points through the transformation matrix. The points that meet the matching conditions are internal points; otherwise, they are external points. S56: Repeat the sampling iteration. When all sample points have completed the iteration, the optimal transformation matrix is obtained and the elimination is completed.
[0011] Furthermore, a preferred method is proposed, wherein step S6 comprises: Calculate the Euclidean distance of each matching pair and sort the distances. The sorted distance set is D=[ d 1 ,d 2 ,..., d n ]; Calculate the first quartile and the third quartile based on the sorted distance set; The interquartile range was calculated based on the first and third quartiles; The upper and lower bounds are set according to the interquartile range, and the matching pairs outside the upper and lower bounds are eliminated to obtain the final matching results.
[0012] Based on the same inventive concept, the present invention also proposes an image matching system based on feature extraction, the system comprising: A preprocessing unit, used to obtain a reference image and an image to be matched, and preprocess the reference image and the image to be matched; A partitioning unit, used to perform partitioning processing on the preprocessed reference image and the image to be matched, and perform regional matching on the partitioned image; A feature extraction unit is used to respectively extract feature points of the reference image and the image to be matched after the region matching by using the FAST algorithm, and to perform feature description on the feature points of the reference image and the image to be matched by using the LDB descriptor, so as to obtain binary descriptors of the feature points of the reference image and the image to be matched; A brute force matching unit, used for brute force matching between the binary descriptors of the feature points of the reference image and the binary descriptors of the feature points of the image to be matched; A removal unit is used to remove incorrectly matched feature points using an improved RANSAC algorithm; The matching result acquisition unit is used to further eliminate the feature points eliminated by the improved RANSAC algorithm using the interquartile range to obtain the final matching result.
[0013] Based on the same inventive concept, the present invention also proposes a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes an image matching method based on feature extraction as described in any one of the above items.
[0014] Based on the same inventive concept, the present invention also proposes a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of an image matching method based on feature extraction as described in any one of the above items are executed.
[0015] The present invention is beneficial in that: The present invention proposes an image matching method based on feature extraction. By partitioning the image, the feature points extracted from each area can ensure the maximum use of the information on the image. The LDB descriptor is used to describe the feature points, and gradient constraint information is added on the basis of grayscale information to ensure the uniqueness of the descriptor, so that the feature description of the ORB algorithm has more discriminativeness. The improved RANSAC algorithm and IQR are used to eliminate the mismatched points, thereby improving the matching accuracy of the ORB algorithm to a certain extent.
[0016] The present invention proposes an image matching method based on feature extraction, which pre-processes a reference image and an image to be matched to enhance the features of the image. The processed image is divided into small areas. This partitioning method helps to reduce the complexity of global matching and make matching more efficient. The FAST algorithm is used to extract key points from each area, which can quickly identify significant feature points in the image, avoid intensive scanning of the entire image, and thus improve the matching rate. The LDB descriptor is used to describe each feature point to improve the matching ability, which is suitable for fast matching application scenarios. The extracted binary descriptors are violently matched to quickly find candidate matching points. For the feature points of preliminary matching, the improved RANSAC algorithm is used for further screening to eliminate the feature points of mismatching. The improved RANSAC algorithm can effectively estimate model parameters in the presence of outliers (mismatching points). The interquartile range is used to further screen the feature points after RANSAC elimination, identify outliers in the data, further reduce mismatching, and improve the accuracy of the final matching result.
[0017] The invention is applied to the field of image matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flow chart of an image matching method based on feature extraction described in implementation mode 1; Figure 2 This is a schematic diagram of the improved RANSAC algorithm flow chart of the eleventh embodiment; Figure 3 This is a schematic diagram of further eliminating mismatches using the IQR described in Implementation 11. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0020] Implementation method 1, see Figure 1 The present embodiment is described as follows. The present embodiment describes an image matching method based on feature extraction, the method comprising: S1: Acquire a reference image and an image to be matched, and preprocess the reference image and the image to be matched; S2: performing partition processing on the preprocessed reference image and the image to be matched, and performing regional matching on the partitioned image; S3: The FAST algorithm is used to extract the feature points of the reference image and the feature points of the image to be matched after the region matching, and the LDB descriptor is used to describe the feature points of the reference image and the feature points of the image to be matched, so as to obtain the binary descriptors of the feature points of the reference image and the binary descriptors of the feature points of the image to be matched; S4: brute-force matching is performed between the binary descriptors of the reference image feature points and the binary descriptors of the image feature points to be matched; S5: Use the improved RANSAC algorithm to remove incorrectly matched feature points; S6: Use the interquartile range to further eliminate the feature points eliminated by the improved RANSAC algorithm to obtain the final matching result.
[0021] In this embodiment, the reference image and the image to be matched are preprocessed to enhance the features of the image. The processed image is divided into small areas. This partitioning method helps to reduce the complexity of global matching and make matching more efficient. The FAST algorithm is used to extract key points for each area. This algorithm can quickly identify significant feature points in the image, avoid intensive scanning of the entire image, and thus improve the matching rate. The LDB descriptor is used to describe each feature point. The LDB descriptor is a local binary descriptor with efficient matching capabilities and low computational overhead, which is suitable for fast matching application scenarios. The extracted binary descriptors are violently matched to quickly find candidate matching points. For the feature points of preliminary matching, the improved RANSAC algorithm is used for further screening to eliminate the feature points of mismatching. The improved RANSAC algorithm can effectively estimate model parameters in the presence of outliers (mismatching points). The interquartile range is used to further screen the feature points after RANSAC elimination to identify outliers in the data, which is used here to further reduce mismatching and improve the accuracy of the final matching results.
[0022] In this embodiment, the strategy of partition processing and local feature point description is adopted to enable the method to better adapt to complex image scenes, such as image matching requirements in situations such as illumination changes and viewing angle changes.
[0023] Implementation method 2: This implementation method further limits the image matching method based on feature extraction described in implementation method 1, and the preprocessing in step S1 includes image denoising and sharpening processing.
[0024] Implementation method three: This implementation method further limits the image matching method based on feature extraction described in implementation method one, and step S2 includes: partitioning the image into 1×2 partitions, 2×2 partitions, 3×3 partitions, and 4×4 partitions.
[0025] Specific: Perform feature point detection on the above four partitioned images: (1) 1×2 partitioning: The image is divided horizontally into two parts. It is suitable for simple scenes, but the feature point detection in uniform areas such as the sky is not ideal, resulting in sparse feature points, or even no feature points and uneven distribution.
[0026] (2) 2×2 partitioning: The image is divided into four regions horizontally and vertically. This method is suitable for detecting images with more feature points, but it still has the problem of sparse feature points in some uniform areas.
[0027] (3) 3×3 partitioning: Feature point detection after 3×3 partitioning divides the image into nine small blocks, which can provide a more uniform distribution of feature points and avoid the situation where the feature points are too concentrated or sparse.
[0028] (4) 4×4 partitioning: The image is subdivided into sixteen small blocks, which is suitable for high-precision matching scenarios. When it is necessary to identify and analyze smaller details or features in the image, such as in medical image analysis, where it is necessary to locate small tissue structures or lesion areas, using 4×4 partitioning can provide sufficient detail granularity, which helps to extract and match features accurately.
[0029] In applications that require high-precision image registration, such as remote sensing image processing or surveying and mapping, 4×4 partitioning can provide more local information and help accurately align images at different time points or perspectives to obtain precise spatial information.
[0030] In complex scenes, such as urban landscapes or industrial facilities, 4×4 partitioning can help identify and match feature points of various scales and sizes for more reliable image matching and object recognition.
[0031] In practical applications, partitioning at different scales can capture image features at different levels and describe image information from coarse to fine. This allows more accurate positioning and matching of feature points in images at different resolutions or viewing angles, improving the robustness of matching. Partitioning images into 1×2, 2×2, 3×3, and 4×4 partitions can transform complex global matching problems into relatively simple local matching problems. This partitioning strategy effectively reduces the computational complexity of the matching process and speeds up matching.
[0032] Partition processing at different scales makes the method more adaptable and can process images of different sizes and proportions, as well as images with different scale features. This is particularly important for processing diverse image scenes in practical applications (such as mixed near and far scenes, size changes, etc.). Partition processing provides more local information, allowing feature points to be more accurately located during the matching process, thereby improving the accuracy and stability of matching. Especially in application scenarios that require fine matching, this method can significantly improve the quality of matching results.
[0033] Combined with the FAST algorithm and LDB descriptor used in step S3, each partition can quickly and accurately extract and describe image features, thereby maintaining the efficiency and superiority of the original method.
[0034] Embodiment 4: This embodiment further limits the image matching method based on feature extraction described in Embodiment 1. In step S3, the feature points of the reference image and the image to be matched are described using the LDB descriptor, including: Performing grayscale processing on the feature points of the reference image and the feature points of the image to be matched to obtain grayscale information of the feature points of the reference image and the feature points of the image to be matched; Adding the grayscale information of the feature points of the reference image and the grayscale information of the feature points of the image to be matched to the horizontal gradient and the vertical gradient; The feature point area of the reference image and the feature point area of the image to be matched are divided into sub-grids of size n×n, and the average grayscale information and gradient information of each sub-grid pixel are calculated:
[0035] in, For the i The average gray value of the pixels in the sub-grids, m is the number of pixels in each sub-grid, d x ( i )for x The gradient value of the direction, d y ( i ) are respectively y The gradient value of the direction; The average grayscale and gradient information of each pair of sub-grids are compared to obtain the binary descriptor of the reference image and the binary descriptor of the image to be matched.
[0036] This embodiment can obtain a high-dimensional feature description by using the LDB descriptor, combined with the grayscale information, horizontal gradient and vertical gradient of the feature point. This multi-dimensional description can more comprehensively capture the information of the feature points in the image, including details such as grayscale changes and edge directions, thereby enhancing the distinguishability and uniqueness of the features. The feature point area is divided into sub-grids of n×n size, and the average grayscale and gradient information of the pixels of each sub-grid are calculated, which can effectively enhance the local features. This method can more accurately describe the local image structure around the feature point, reduce the impact caused by illumination changes or background noise, and improve the stability and reliability of the feature points. By comparing the average grayscale and gradient information of each pair of sub-grids, binary descriptors of the reference image and the image to be matched are generated. These descriptors are usually highly efficient and compact, and are suitable for fast matching and retrieval of large-scale image databases. At the same time, the binary descriptor can quickly calculate the distance and similarity during the matching process, which accelerates the execution speed of the matching algorithm.
[0037] Implementation method 5: This implementation method further limits the image matching method based on feature extraction described in implementation method 1, and step S4 includes: calculating the distance between the binary descriptors of the feature points of the reference image and the image to be matched.
[0038] By comparing binary descriptors, the difference between two feature points can be accurately measured, thus achieving accurate feature matching. When processing large-scale image databases, distance calculations using binary descriptors can quickly identify and filter out the best matches from a large number of feature points, making the entire matching process more efficient and feasible.
[0039] Embodiment 6: This embodiment further limits the image matching method based on feature extraction described in Embodiment 1, and step S5 includes: S51: Randomly select two sample points, recorded as sample point 1 and sample point 2; S52: Calculate the midpoint between sample point 1 and sample point 2 ( x’ , y’ ), obtain the matching point farthest from the midpoint in the reference image and set it as sample midpoint 1; S53: Calculate the centroid of sample point 1, sample point 2 and sample midpoint 1 ( x ” , y ” ), obtain the point farthest from the centroid in the reference image, set it as sample point three, and sample point one, sample point two and sample point three are the first three matching sample points; S54: Calculate the center of gravity ( x ” , y” ) and the midpoint of sample point three, and repeat steps S52 to S53 to obtain the fourth sample point, that is, to obtain 4 sets of matching sample point pairs; S55: Calculate the transformation matrix, and determine the points that meet the matching conditions among all sample points through the transformation matrix. The points that meet the matching conditions are internal points; otherwise, they are external points. S56: Repeat the sampling iteration. When all sample points have completed the iteration, the optimal transformation matrix is obtained and the elimination is completed.
[0040] The method described in this embodiment uses random selection and centroid calculation to effectively extract key sample points from the reference image, and find the best matching point by calculating the midpoint and centroid. Compared with the traditional global search method, this method can significantly reduce the amount of calculation and time complexity, and improve the matching efficiency. : The robustness of the algorithm to noise and deformation can be enhanced by multiple iterations and random selection of sample points. Even if there are some interference points in the image or the transformation is large, the internal points can still be accurately found to obtain an accurate transformation matrix. This method can be applied to different types of image matching problems, including but not limited to object recognition, scene reconstruction, and image registration. By adjusting the number of iterations and the strategy for selecting sample points, it can flexibly adapt to different matching requirements and complexities. After multiple iterations and internal point elimination, the final transformation matrix can provide highly accurate and stable image matching results. This is particularly important for tasks that require precise alignment or reconstruction of three-dimensional structures.
[0041] Embodiment 7: This embodiment further limits the image matching method based on feature extraction described in Embodiment 1, and step S6 includes: Calculate the Euclidean distance of each matching pair and sort the distances. The sorted distance set is D=[ d 1 ,d 2 ,..., d n ]; Calculate the first quartile and the third quartile based on the sorted distance set; The interquartile range was calculated based on the first and third quartiles; The upper and lower bounds are set according to the interquartile range, and the matching pairs outside the upper and lower bounds are eliminated to obtain the final matching results.
[0042] This embodiment can effectively eliminate those matching pairs with abnormally long distances by calculating the Euclidean distance and based on the quartile method. These outliers usually represent matching errors or noise points, and by eliminating them, the accuracy and stability of the matching results can be improved. The calculation of the interquartile range is based on the actual distribution of the data, and does not rely on a fixed threshold. This method can therefore adapt to changes in different data sets and scenarios, and maintain effective control over the matching quality.
[0043] Compared with simple distance thresholds or fixed percentage elimination methods, the use of quartiles and interquartile ranges can more accurately determine the matching pairs that need to be eliminated. In this way, the algorithm can avoid calculating a large number of unnecessary matching pairs, thereby improving efficiency. The vast majority of valid matching pairs are still retained during the elimination process. These matching pairs are within the upper and lower limits of the interquartile range and represent relatively reasonable matching relationships. Therefore, this method can retain useful matching information to the greatest extent while maintaining accuracy, providing a better foundation for subsequent image processing and analysis.
[0044] Embodiment 8: An image matching system based on feature extraction described in this embodiment includes: A preprocessing unit, used to obtain a reference image and an image to be matched, and preprocess the reference image and the image to be matched; A partitioning unit, used to perform partitioning processing on the preprocessed reference image and the image to be matched, and perform regional matching on the partitioned image; A feature extraction unit is used to respectively extract feature points of the reference image and the image to be matched after the region matching by using the FAST algorithm, and to perform feature description on the feature points of the reference image and the image to be matched by using the LDB descriptor, so as to obtain binary descriptors of the feature points of the reference image and the image to be matched; A brute force matching unit, used for brute force matching between the binary descriptors of the feature points of the reference image and the binary descriptors of the feature points of the image to be matched; A removal unit is used to remove incorrectly matched feature points using an improved RANSAC algorithm; The matching result acquisition unit is used to further eliminate the feature points eliminated by the improved RANSAC algorithm using the interquartile range to obtain the final matching result.
[0045] Embodiment 9. A computer device described in this embodiment is characterized in that it includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor runs the computer program stored in the memory, the processor executes an image matching method based on feature extraction described in any one of embodiments 1 to 7.
[0046] Embodiment 10: A computer-readable storage medium described in this embodiment, on which a computer program is stored, and when the computer program is executed by a processor, the steps of an image matching method based on feature extraction as described in any one of embodiments 1 to 7 are executed.
[0047] Implementation Method 11: See Figure 2 and Figure 3 This embodiment provides a specific example of the image matching method based on feature extraction described in the first embodiment, and is also used to explain the second to seventh embodiments, specifically: S1: Input the reference image and the image to be matched, perform preprocessing such as denoising and sharpening on the two images, and partition the images to determine whether the regions match. By dividing the regions and extracting feature points from each region, it can ensure that the information on the image is used to the greatest extent, and also increase the robustness of the algorithm.
[0048] Furthermore, the specific steps of the above image partitioning are: (1) Assume that there are four types of image partitions: 1×2, 2×2, 3×3, and 4×4.
[0049] (2) Perform feature point detection on the above four partitioned images respectively: ①1×2 partitioning: The image is divided into two parts horizontally. It is suitable for simple scenes, but the feature point detection in uniform areas such as the sky is not ideal, which will result in sparse feature points, or even no feature points and uneven distribution.
[0050] ②2×2 partitioning: The image is divided into four regions horizontally and vertically. It is suitable for detecting images with more feature points, but there is still a problem of sparse feature points in some uniform areas.
[0051] ③3×3 partitioning: Using feature point detection after 3×3 partitioning, the image is divided into nine small blocks, which can provide a more uniform distribution of feature points and avoid the situation where the feature points are too concentrated or sparse.
[0052] ④4×4 partitioning: The image is subdivided into sixteen small blocks, which is suitable for high-precision images. However, too many partitions may cause feature points to be too concentrated in certain local areas, which may not be suitable for all scenes.
[0053] (3) Through the above analysis, the present invention selects a 3×3 partitioning method to partition the image, and then matches the partitioned areas to make full use of the information on the image and further detect feature points.
[0054] S2: Use the FAST algorithm to roughly extract corner points as feature points. Since many of the selected candidate corner points are close to each other, non-maximum suppression is needed to eliminate this effect.
[0055] Furthermore, the FAST algorithm is used to roughly extract feature points, and the steps include: (1) Select pixels in the image p , assuming its brightness is I p ; (2) Set a threshold T (for example I p 20% of (3) Pixels p As the center, select 16 pixels on a circle with a radius of 3; (4) If there are continuous N The brightness of the point is greater than I p +T or less than I p −T , then the pixel p can be considered as feature points ( N Usually 12 is used, which is FAST-12. Other commonly used N The values are 9 and 11, respectively called FAST-9 and FAST-11). In the FAST-12 algorithm, for each pixel, the brightness of the 1st, 5th, 9th, and 13th pixels on the neighborhood circle are directly detected. Only when three of these four pixels are greater than I p +T or less than I p −T When , the current pixel is likely to be a corner point, otherwise it should be directly excluded. This operation greatly speeds up the corner point detection.
[0056] (5) Repeat the above four steps and perform the same operation on each pixel.
[0057] Furthermore, non-maximum suppression processing is performed on the feature points.
[0058] Calculate the feature points separately p The difference between the grayscale values of the 16 points on the circle with it as the center is taken as the absolute value, and the sum of these 16 absolute values is used as the response value. If the response value is greater than the set threshold, the feature point is retained, otherwise the feature point is removed, so as to remove the local dense feature points. The calculation formula is as follows:
[0059] in, I p express p The gray value of the point, I i Indicates the first i The gray value of a point, I th Indicates a preset threshold.
[0060] S3: Use LDB descriptors to describe the feature points. The steps include: Furthermore, when describing features, horizontal gradient and vertical gradient constraint information are added based on grayscale information to improve the uniqueness of the descriptor; Furthermore, the feature point area is divided into n×n grids, and sub-grids are used to obtain enough local detail information to improve the distinguishability of the descriptor; Furthermore, the average grayscale information and gradient information of each sub-grid pixel are calculated to represent the feature information of each sub-grid. The calculation formula is as follows:
[0061] in, m is the number of pixels in each sub-grid, d x ( i )and d y ( i ) are respectively x , y The gradient value of the direction.
[0062] Furthermore, for each pair of subgrids ( i subgrid and the j The formula is as follows:
[0063] in, F (·) is the feature information extracted from the sub-grid, including grayscale information and gradient information, F ( i )and F ( j ) are respectively i and j The feature information of each sub-grid.
[0064] Furthermore, the average grayscale and gradient information of each pair of sub-grids are compared to obtain a 3n 2 (n 2-1) / 2 bits binary descriptor, where n = 2, 3, 4; the larger n is, the greater the difference of the descriptor is.
[0065] S4: Perform brute force matching on the binary descriptor, that is, calculate the distance between each feature point and each feature point of the image to be matched, that is, calculate the Hamming distance.
[0066] S5: Figure 2 As shown in the figure, the improved RANSAC algorithm is used to remove the mismatched points. The steps are as follows: Furthermore, the random sampling method of the traditional RANSAC algorithm cannot ensure that the sample points extracted are sufficiently dispersed and uniform, so a method that can make the selected sample points more uniform is used. Dispersed sampling of feature points from the matching set; Since the homography matrix model requires at least 4 sets of matching point pairs to be solved, scattered sampling is used to extract 4 sets of matching point pairs. Here, the 4 sets of matching point pairs are determined by finding matching sample points in the reference image. The scattered sampling steps are: (1) Randomly select two matching sample points ①②; (2) Calculate the midpoint between point ① and point ② ( x ’ ,y ’ ), find the matching point farthest from the midpoint and set it as point ③; (3) Find the centroid ④ of points ①, ②, and ③, and find the distance to the centroid ( x ” ,y ” ) The farthest point is the sample point ⑤ to be found. So far, ①②⑤ are the first three matching sample points required; (4) Calculate the midpoint between point ④ and point ⑤, repeat the above steps to obtain the fourth sample point, and obtain four sets of matching sample point pairs. x ’ ,y ’ ) and the center of gravity ( x ” ,y ” ) is calculated as follows:
[0067]
[0068] in,( , ), , )and( , ) are the coordinates of points ①, ②, and ③ respectively.
[0069] Furthermore, the model in the initial matching set is calculated, that is, the transformation matrix H, and the points in the matching set that meet the model are judged by H to distinguish between internal and external points. If they meet the model, they are internal points; otherwise, they are external points.
[0070] The changed matrix H is calculated and expressed as follows:
[0071] ( x,y )and( x 1 ,y 1) Respectively represent the coordinate positions of the feature points in the reference image and the image to be matched, usually let h 33 =1 to normalize the matrix and find an optimal matrix solution. In order to find the eight unknowns in the matrix, it is necessary to randomly select four pairs of matching points from the initial rough matching points, and the selected matching points should not be collinear, and calculate the transformation matrix H; Further, multiple sampling iterations are performed; Furthermore, when the number of internal points is the largest, the optimal transformation matrix is obtained. The iterative result at this time is the final result.
[0072] S6: Use the interquartile range (IQR) to further eliminate the results of the previous step and use it as the final matching result after eliminating the false matches, such as Figure 3 shown.
[0073] Furthermore, IQR elimination of false matches is a statistical method, and the steps of eliminating false matches are as follows: (1) Among the matching points filtered by the improved RANSAC algorithm, calculate the Euclidean distance of each matching pair and sort the distances. The sorted distance set is D=[ d 1 ,d 2 ,..., d n ].
[0074] Furthermore, the distance calculation formula is as follows:
[0075] In the formula, ( x 1 ,y 1) and ( x 2 ,y 2) are points in the reference image and the image to be matched respectively.
[0076] (2) After sorting all matching pairs, calculate the first quartile (Q1) and the third quartile (Q3). Q1 is the 25th percentile position in D, and Q3 is the 75th percentile position in D.
[0077] (3) Calculate the interquartile range, that is: .
[0078] (4) Set upper and lower bounds based on IQR to detect mismatches. Keep the matching pairs whose distances are within the upper and lower bounds. The upper and lower bounds are calculated as follows: , Finally, we get the final result .
[0079] The technical solution of the present invention proposes an image matching method based on feature extraction. After the image is partitioned, the LDB descriptor is used to describe the features. The improved RANSAC algorithm and IQR are used to eliminate mismatching points, thereby improving the matching accuracy.
[0080] Although the preferred embodiments of the present disclosure have been described, those skilled in the art will appreciate that once the basic inventive concept is known, If the present invention is not limited to the embodiment of the present invention, further changes and modifications may be made to these embodiments. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present disclosure. Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
[0081] It should be understood by those skilled in the art that the embodiments of the present disclosure may be provided as methods, systems or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0082] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure rather than to limit its protection scope. Although the present disclosure has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that after reading the present disclosure, those skilled in the art can still make various changes, modifications or equivalent substitutions to the specific implementation methods of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the disclosed claims to be approved.
Claims
1. An image matching method based on feature extraction, characterized in that: The method comprises: S1: Acquire a reference image and an image to be matched, and preprocess the reference image and the image to be matched; S2: performing partition processing on the preprocessed reference image and the image to be matched, and performing regional matching on the partitioned image; S3: The FAST algorithm is used to extract the feature points of the reference image and the feature points of the image to be matched after the region matching, and the LDB descriptor is used to describe the feature points of the reference image and the feature points of the image to be matched, so as to obtain the binary descriptors of the feature points of the reference image and the binary descriptors of the feature points of the image to be matched; S4: brute-force matching is performed between the binary descriptors of the reference image feature points and the binary descriptors of the image feature points to be matched; S5: Use the improved RANSAC algorithm to remove incorrectly matched feature points; S6: Use the interquartile range to further eliminate the feature points eliminated by the improved RANSAC algorithm to obtain the final matching result.
2. The image matching method based on feature extraction according to claim 1, characterized in that: The preprocessing in step S1 includes image denoising and sharpening.
3. The image matching method based on feature extraction according to claim 1, characterized in that: The step S2 includes: partitioning the image into 1×2 partitions, 2×2 partitions, 3×3 partitions and 4×4 partitions.
4. The image matching method based on feature extraction according to claim 1, characterized in that: In step S3, the feature points of the reference image and the feature points of the image to be matched are described using the LDB descriptor, including: Performing grayscale processing on the feature points of the reference image and the feature points of the image to be matched to obtain grayscale information of the feature points of the reference image and the feature points of the image to be matched; Adding the grayscale information of the feature points of the reference image and the grayscale information of the feature points of the image to be matched to the horizontal gradient and the vertical gradient; The feature point area of the reference image and the feature point area of the image to be matched are divided into sub-grids of size n×n, and the average grayscale information and gradient information of each sub-grid pixel are calculated: in, For the i The average gray value of the pixels in the sub-grids, m is the number of pixels in each sub-grid, d x ( i )for x The gradient value of the direction, d y ( i )for y The gradient value of the direction; The average grayscale and gradient information of each pair of sub-grids are compared to obtain the binary descriptor of the reference image and the binary descriptor of the image to be matched.
5. The image matching method based on feature extraction according to claim 1, characterized in that: The step S4 includes: calculating the distance between the binary descriptor of the reference image feature point and the binary descriptor of the image feature point to be matched.
6. The image matching method based on feature extraction according to claim 1, characterized in that: The step S5 comprises: S51: Randomly select two sample points, recorded as sample point 1 and sample point 2; S52: Calculate the midpoint between sample point 1 and sample point 2 ( x’ , y’ ), obtain the matching point farthest from the midpoint in the reference image and set it as sample midpoint 1; S53: Calculate the centroid of sample point 1, sample point 2 and sample midpoint 1 ( x ” , y ” ), obtain the point farthest from the centroid in the reference image, set it as sample point three, and sample point one, sample point two and sample point three are the first three matching sample points; S54: Calculate the center of gravity ( x ” , y ” ) and the midpoint of sample point 3, and repeat steps S52 to S53 to obtain the fourth sample point, that is, to obtain 4 sets of matching sample point pairs; S55: Calculate the transformation matrix, and determine the points that meet the matching conditions among all sample points through the transformation matrix. The points that meet the matching conditions are internal points; otherwise, they are external points. S56: Repeat the sampling iteration. When all sample points have completed the iteration, the optimal transformation matrix is obtained and the elimination is completed.
7. The image matching method based on feature extraction according to claim 1, characterized in that: The step S6 comprises: Calculate the Euclidean distance of each matching pair and sort the distances. The sorted distance set is D=[ d 1 ,d 2 ,..., d n ]; Calculate the first quartile and the third quartile based on the sorted distance set; The interquartile range was calculated based on the first and third quartiles; The upper and lower bounds are set according to the interquartile range, and the matching pairs outside the upper and lower bounds are eliminated to obtain the final matching results.
8. An image matching system based on feature extraction, characterized in that: The system comprises: A preprocessing unit, used to obtain a reference image and an image to be matched, and preprocess the reference image and the image to be matched; A partitioning unit, used to perform partitioning processing on the preprocessed reference image and the image to be matched, and perform regional matching on the partitioned image; A feature extraction unit is used to respectively extract feature points of the reference image and the image to be matched after the region matching by using the FAST algorithm, and to perform feature description on the feature points of the reference image and the image to be matched by using the LDB descriptor, so as to obtain binary descriptors of the feature points of the reference image and the image to be matched; A brute force matching unit, used for brute force matching between the binary descriptors of the feature points of the reference image and the binary descriptors of the feature points of the image to be matched; A removal unit is used to remove incorrectly matched feature points using an improved RANSAC algorithm; The matching result acquisition unit is used to further eliminate the feature points eliminated by the improved RANSAC algorithm using the interquartile range to obtain the final matching result.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor runs the computer program stored in the memory, the processor executes an image matching method based on feature extraction according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image matching method based on feature extraction as described in any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Rapid correction method of scanning electron microscope image drift
CN108520502A
Improved RANSAC algorithm-based medium / long wave infrared image registration method
CN109741376A
Trajectory recognition method based on ORB feature extraction and FLANN rapid matching
CN110032983A
Feature point mismatching elimination method applied to visual SLAM
CN116630662A
Cited By
Cross-scale data fusion method and device based on feature region, equipment and storage medium
CN119848764A
