Feature matching method, system, medium, product and equipment based on K clustering

By adopting K cluster-based feature matching method in visual SLAM system, using dynamic image pyramids and K-means clustering, the problem of the reduction in accuracy and efficiency in complex scenarios is solved, and efficient and accurate feature matching is achieved.

CN118968110BActive Publication Date: 2025-05-16SHANDONG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411432989.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-05-16
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

In the case of rapid motion, lighting changes and complex scenes, the matching accuracy and efficiency have significantly decreased, increasing the computing overhead.

Method used

Using K clustering-based feature matching method, feature points are extracted through dynamic image pyramids, the number of pyramid layers and sampling scale are adaptively adjusted, the search space is reduced by K-means clustering, and false matching is eliminated through geometric test.

Benefits of technology

It realizes efficient and accurate feature matching in complex scenarios, improves matching efficiency and accuracy, and reduces computing overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968110B_ABST
    Figure CN118968110B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of image processing technology. Provided is a feature matching method, system, medium, product and device based on K clustering, which extracts the edge of a preprocessed image to obtain an edge image; extracts feature points on edge images of different scales adaptively through a dynamic image pyramid, and generates feature descriptors corresponding to the feature points; performs K-means clustering on the feature descriptors, divides the feature descriptors into K clusters according to similarity, matches feature points in each cluster, and screens out the optimal matching point pair by calculating the Euclidean distance between feature descriptors; performs secondary screening on the screened matching point pairs, removes globally inconsistent mismatching points, and obtains the final feature matching result; the present invention realizes efficient and accurate feature matching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a feature matching method, system, medium, product and equipment based on K clustering. Background Art

[0002] The statements in this section merely provide background art related to the present invention and do not necessarily constitute prior art.

[0003] Visual SLAM (Simultaneous Localization and Mapping) is a key technology for simultaneous positioning and mapping, and is widely used in robot navigation, augmented reality, autonomous driving and other fields. In the visual SLAM system, the extraction and matching of feature points are the core steps to achieve precise positioning and environmental perception, which determines whether the system can correctly extract environmental information from continuous image frames and perform self-positioning.

[0004] However, although traditional feature matching algorithms, such as SIFT, SURF, and ORB, can effectively extract image features, they have certain limitations in real-time and accuracy. Especially in the case of rapid motion, lighting changes, and complex scenes, the matching accuracy and efficiency will drop significantly, and the computational overhead will increase. Summary of the invention

[0005] In order to address the deficiencies in the prior art, the present invention provides a feature matching method, system, medium, product and device based on K clustering, which adopts a dynamic image pyramid to extract feature points, adaptively adjusts the number of layers of the image pyramid and the sampling scale of each layer according to different scenes and image contents, clusters feature descriptors according to their similarity to reduce the search space, performs geometric inspection on the screened matching point pairs, eliminates false matches, and achieves efficient and accurate feature matching.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a feature matching method based on K clustering.

[0008] A feature matching method based on K clustering includes the following processes:

[0009] Perform edge extraction on the preprocessed image to obtain an edge image;

[0010] Through the dynamic image pyramid, feature points are adaptively extracted from edge images of different scales, and feature descriptors corresponding to the feature points are generated;

[0011] Perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between feature descriptors;

[0012] The selected matching point pairs are screened again to remove globally inconsistent mismatching points and obtain the final feature matching results.

[0013] As a further limitation of the first aspect of the present invention, the preprocessing includes: image denoising processing and image enhancement processing;

[0014] Perform edge extraction on the preprocessed image, including:

[0015] The Sobel operator is used to calculate the horizontal and vertical gradients of the image. The improved Canny algorithm is used to perform non-maximum suppression and double threshold screening based on the calculated gradient to remove insignificant edges and obtain a preliminary edge image. For the preliminary edge image, two thresholds are set. and , get the pixel value of the final edge image For: When Or when G is connected to a strong edge pixel, is 1, hour, is 0, where is the gradient amplitude.

[0016] As a further limitation of the first aspect of the present invention, extracting feature points on edge images of different scales adaptively through a dynamic image pyramid includes:

[0017] Obtain image complexity. When the image complexity is greater than a set threshold, increase the number of pyramid layers. When the image complexity is less than or equal to the set threshold, reduce the number of pyramid layers.

[0018] When the feature area included in the edge image is larger than the set threshold, the scaling ratio is increased; for areas containing complex or subtle features, the scaling ratio is reduced.

[0019] As a further limitation of the first aspect of the present invention, when the extraction results of feature points in the current image layer tend to be stable and no new meaningful features appear at a smaller scale, the pyramid processing stops early;

[0020] Analyze the gradient distribution of the image at different scales to determine the density change of feature points. If the distribution of feature points tends to be sparse at a smaller scale, the pyramid processing stops early.

[0021] As a further limitation of the first aspect of the present invention, the extracted feature descriptors are clustered, and the feature descriptors are divided into K clusters according to their similarities;

[0022] For each cluster, find the corresponding cluster with the closest feature description in the first image and the second image. The feature points in cluster K1 form a cluster in the first image and a cluster in the second image. It is only necessary to match the feature points in the corresponding cluster K1 without traversing all the feature points. In each pair of corresponding clusters, the similarity measure between the feature descriptors is used for feature matching. Only the feature points in the same cluster are considered, and cross-cluster matching is not required.

[0023] As a further limitation of the first aspect of the present invention, the RANSAC algorithm is used to perform geometric verification on the selected matching point pairs, and to eliminate erroneous matching points that are locally matched but do not meet the geometric consistency globally.

[0024] In a second aspect, the present invention provides a feature matching system based on K clustering.

[0025] A feature matching system based on K clustering, comprising:

[0026] The image preprocessing unit is configured to: extract edges from the preprocessed image to obtain an edge image;

[0027] The dynamic feature extraction unit is configured to: adaptively extract feature points on edge images of different scales through a dynamic image pyramid, and generate feature descriptors corresponding to the feature points;

[0028] The clustering unit is configured to: perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between the feature descriptors;

[0029] The secondary screening unit is configured to perform secondary screening on the screened matching point pairs, eliminate globally inconsistent erroneous matching points, and obtain the final feature matching result.

[0030] In a third aspect, the present invention provides a computer device, comprising: a processor and a computer-readable storage medium;

[0031] a processor adapted to execute a computer program;

[0032] A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the feature matching method based on K clustering as described in the first aspect of the present invention is implemented.

[0033] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program is suitable for being loaded by a processor and executing the K-clustering-based feature matching method as described in the first aspect of the present invention.

[0034] In a fifth aspect, the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the feature matching method based on K clustering as described in the first aspect of the present invention.

[0035] Compared with the prior art, the present invention has the following beneficial effects:

[0036] 1. The present invention innovatively proposes a dynamic image pyramid processing method, which is an improved multi-scale image processing technology. It can adaptively adjust the number of layers and the sampling scale of each layer of the image pyramid according to different scenes and image contents. By analyzing the image content and adaptively adjusting the number of layers and proportions, more abundant feature points can be obtained in complex scenes. Compared with traditional fixed-scale pyramid processing, this method can more effectively capture features of various scales in the image and improve the efficiency and accuracy of feature matching.

[0037] 2. This method innovatively proposes a feature matching method based on K-means clustering. It performs K-means clustering on descriptors with high similarity and divides them into different clusters. It reduces the number of feature points in each cluster and the amount of calculation in subsequent matching. It then performs feature matching within the cluster and uses the RANSAN algorithm to perform secondary screening on the selected feature point pairs. This can greatly reduce the search range, eliminate false matches, and improve the matching accuracy.

[0038] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0040] Figure 1 An overall schematic diagram of a feature matching method based on K clustering provided in Example 1 of the present invention;

[0041] Figure 2 A schematic diagram of an image preprocessing process provided by Embodiment 1 of the present invention;

[0042] Figure 3 A schematic diagram of a traditional image pyramid provided in Example 1 of the present invention;

[0043] Figure 4 A dynamic image pyramid structure framework diagram provided by Embodiment 1 of the present invention;

[0044] Figure 5 A schematic diagram of a process of clustering descriptors using K-means clustering provided in Example 1 of the present invention;

[0045] Figure 6 A schematic diagram of the distribution of feature descriptors before clustering provided in Example 1 of the present invention;

[0046] Figure 7 A schematic diagram of the distribution of feature descriptors after clustering provided in Example 1 of the present invention;

[0047] Figure 8 A schematic diagram of a feature matching system based on K clustering provided in Example 2 of the present invention;

[0048] Fig. 9 A schematic diagram of a computer device provided in Example 3 of the present invention. DETAILED DESCRIPTION

[0049] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0050] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0051] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0052] Embodiment 1:

[0053] Traditional feature matching algorithms have certain limitations in terms of real-time performance and accuracy. In view of this, this implementation provides a feature matching method based on K-means clustering. Figure 1 As shown, the following process is included:

[0054] Preprocess the input original image, including denoising and image enhancement, and then extract the edge to generate an edge image;

[0055] Construct a dynamic image pyramid that can adaptively extract feature points on images of different scales for different scenes and image contents, and generate corresponding feature descriptors;

[0056] Perform K-means clustering on the extracted feature descriptors, initialize K cluster centers, and divide the feature descriptors into the corresponding nearest K clusters according to their similarity (calculated distance);

[0057] Update the cluster center. When the number of iterations is reached or the convergence condition is reached, the algorithm ends. When the number of iterations is not reached or the convergence condition is not reached, continue to iterate until the algorithm ends. After the algorithm ends, the feature point clusters in each image frame are obtained.

[0058] Search and match feature points in each corresponding cluster, and filter out the best matching point pair for accurate matching by calculating the Euclidean distance between feature descriptors;

[0059] The RANSAC algorithm (random sampling consensus algorithm) is used to perform secondary screening and verification on the selected matching point pairs to eliminate globally inconsistent mismatching points and further improve the matching accuracy.

[0060] In this implementation, K-means clustering is an unsupervised machine learning algorithm that is widely used in data classification and cluster analysis. It can effectively group data and reduce computational complexity. Its core goal is to divide data into K clusters, each of which consists of similar data points. It divides data points into the closest cluster centroids through iterative optimization methods, ultimately making data points within a cluster similar to each other and data points between clusters more different.

[0061] In this implementation, in order to improve the accuracy of feature extraction and matching, it is necessary to ensure that the algorithm can work stably under various complex conditions. The original image often contains noise, uneven lighting and other problems, which may lead to inaccurate or lost feature point extraction. Through denoising, the interference in the image can be reduced, key details can be retained, and feature points can be made clearer; image enhancement can improve contrast and highlight details, so that images with different brightness and contrast can still effectively detect feature points. Edge detection can highlight the structural information of edges and contours in the image, making it easier for feature points to be distributed around these areas, improving the effectiveness of feature points and the rationality of their distribution. Through these preprocessing steps, the image quality is improved, making subsequent feature extraction and matching more reliable and accurate. The preprocessing process is as follows: Figure 2 shown.

[0062] Denoising processing, specifically, includes the following processes:

[0063] Perform Gaussian filtering on the input image, apply the Gaussian filter to smooth the image, remove high-frequency noise, adjust the kernel size of the filter, and dynamically select the appropriate smoothing level according to the noise intensity. The two-dimensional form of the Gaussian filter can be expressed as:

[0064] (1);

[0065] in, and are the pixel coordinates in the image, is the standard deviation of the Gaussian kernel, and the filtering process is to convolve this Gaussian function with the image:

[0066] (2);

[0067] in, is the pixel value of the original image, Indicates the size of the filter kernel, u and v respectively represent the coordinate offset values ​​of the pixel coordinates x and y in the Gaussian filter window relative to the current pixel, and the value range is between -k and k. Represents the convolution result;

[0068] After Gaussian filtering, a bilateral filter is applied. Bilateral filtering preserves edge details while removing noise. It avoids edge blurring by combining spatial distance and pixel intensity differences. The bilateral filtering formula is as follows:

[0069] (3);

[0070] in, and is the pixel position in the image, is the neighborhood around the pixel, is the spatial distance weight (usually a Gaussian function), is the pixel intensity difference weight, is a normalization factor that ensures that the weights sum to 1.

[0071] In this implementation, the image enhancement process specifically includes the following steps:

[0072] For the denoised image, calculate the grayscale distribution, generate a cumulative histogram, and apply histogram equalization to enhance the contrast between bright and dark areas of the image and adjust the overall brightness and contrast of the image:

[0073] (4);

[0074] in: is the enhanced pixel value, is the number of gray levels of the image (usually 256), is the total number of pixels in the image, Is the pixel value frequency;

[0075] Afterwards, based on the histogram equalization, local adaptive equalization is applied to further improve the local contrast, enhance the local area, avoid over-enhancement, and protect the local details of the image.

[0076] After the first two steps, the image can now be used to extract feature points. In order to improve the accuracy and stability of feature extraction, image edge detection is performed again to better extract image features.

[0077] First, use the Sobel operator to calculate the horizontal and vertical gradients of the image, and generate an edge map based on the gradient information. The Sobel operator calculates the horizontal and vertical gradients of the image. The formula is as follows:

[0078] (5);

[0079] (6);

[0080] in, and Represent the gradients in the horizontal and vertical directions respectively. Represents the convolution operation, the gradient magnitude The calculation formula is:

[0081] (7);

[0082] Using the improved Canny algorithm, non-maximum suppression and double threshold screening are performed on the basis of calculated gradients to remove insignificant edges. After edge detection, edge tracking is performed to ensure edge continuity. By setting two thresholds and , the gradient amplitude It is divided into strong edge, weak edge and non-edge. The pixel value of the final output edge image Determined by the following conditions: Or when G is connected to a strong edge pixel, is 1, hour, is 0, where is the gradient amplitude.

[0083] Traditional image pyramids (such as Figure 3(as shown in the figure) The scaling ratio is fixed, which may result in the inability to fully extract suitable feature points in some scenarios. This globally unified scaling method cannot adapt to the feature complexity of different areas in the image. For complex detail areas, this scaling may lead to the loss of subtle features; in simple areas, it may cause over-refinement and increase unnecessary calculations. Traditional pyramids usually use the same number of layers in all image areas. For example, ORB-SLAM2 uniformly uses 8 layers, so the number of layers cannot be adjusted according to the complexity of different areas of the image. For simple areas, it will lead to redundant feature extraction and calculation; for complex areas, insufficient layers may not capture all important feature information.

[0084] In view of the above problems, this implementation proposes a dynamic pyramid processing method, such as Figure 4 As shown in FIG. 1 , it is an improved multi-scale image processing technology, which aims to adaptively adjust the number of layers of the image pyramid and the sampling scale of each layer. For different scenes and image contents, such as image quality, texture complexity, and lighting conditions, the number of pyramid layers and the sampling scale of each layer are adaptively selected, so that richer feature points can be obtained in complex scenes.

[0085] 1) Adaptive adjustment of the number of layers: The dynamic pyramid processing method will adaptively adjust the number of pyramid layers according to the complexity of the image content and the distribution of feature points. Specifically, the level of the pyramid is dynamically adjusted by analyzing the local complexity of the image (such as gradient changes, texture density, etc.);

[0086] For complex image scenes (i.e., complexity greater than a set threshold, such as images with dense textures), the number of pyramid layers is increased to extract features at more scales to ensure that subtle features in complex scenes are not ignored. For simple image scenes (i.e., complexity less than or equal to a set threshold, such as flat or geometrically simple areas), the number of pyramid layers is reduced to avoid unnecessary feature extraction and calculation, thereby improving efficiency.

[0087] 2) Adaptive scaling: Dynamic pyramid processing selects the most appropriate scaling according to the characteristics of the local area of ​​the image; the scaling is no longer globally fixed, but can be flexibly changed for different areas; for areas containing large-size features (i.e., the feature area is larger than the set threshold, such as the outline or structure of a large object), the scaling can be larger to reduce the redundancy of detail capture while ensuring that features in a large range can be effectively identified; for areas containing complex and subtle features, a smaller scaling is used to ensure that these key features are captured at a finer scale.

[0088] 3) Content-based pyramid stopping conditions: The dynamic pyramid method dynamically determines whether to continue scaling based on the image content to avoid unnecessary processing; the pyramid will terminate processing when encountering the following two situations; if the extraction results of feature points in the current image layer tend to be stable and no new meaningful features will appear at a smaller scale, the pyramid processing will stop early to save computing resources; by analyzing the gradient distribution of the image at different scales, the density change of the feature points is determined. If the distribution of feature points at a smaller scale tends to be sparse, there is no need to continue to reduce the image scale.

[0089] In this implementation, K-means clustering is used for feature matching. Specifically, Figure 5 As shown, including:

[0090] 1) Cluster the extracted feature descriptors and divide them into K clusters according to their similarity. When the convergence condition is reached, the clustering is considered to have converged, that is, the descriptors have been divided into K clusters according to their similarity, and the algorithm terminates. The formula for the convergence condition is as follows:

[0091] (8);

[0092] Among them, ||·|| represents the Euclidean distance of vectors, is the preset convergence threshold, t represents the current iteration round, t-1 represents the previous iteration round, represents the feature descriptor in the kth cluster in t iteration rounds, Represents the feature descriptor in the kth cluster in the t-1 iteration round.

[0093] This clustering is based on the similarity of descriptors, but the spatial position of feature points remains unchanged, such as Figure 6 and Figure 7 As shown (of which x and y Represent the horizontal and vertical coordinates of the pixels in the image respectively). After clustering the feature points of the two images, K clusters are obtained in each image ( Figure 7 Only three clusters are drawn for illustration, including only K1, K2 and K3). The feature points in each cluster represent feature points that are similar in some feature description.

[0094] 2) For each cluster, find the corresponding cluster with the closest feature description in image A (i.e., the first image) and image B (i.e., the second image). For example, if the feature points in cluster K1 form a cluster in image A and a similar cluster in image B, then it is only necessary to match the feature points in the corresponding cluster K1, without traversing all the feature points; in each pair of corresponding clusters, use the similarity measure between feature descriptors for feature matching, and only consider feature points within the same cluster, rather than matching across clusters;

[0095] 3) Use the RANSAC algorithm to perform geometric verification on the selected matching point pairs, eliminate those mismatched points that appear to match locally but do not meet the geometric consistency globally, ensure that the final matching results are globally consistent, and further improve the matching accuracy.

[0096] Embodiment 2:

[0097] like Figure 8 As shown, this implementation provides a feature matching system based on K clustering, including:

[0098] The image preprocessing unit is configured to: extract edges from the preprocessed image to obtain an edge image;

[0099] The dynamic feature extraction unit is configured to: adaptively extract feature points on edge images of different scales through a dynamic image pyramid, and generate feature descriptors corresponding to the feature points;

[0100] The clustering unit is configured to: perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between the feature descriptors;

[0101] The secondary screening unit is configured to perform secondary screening on the screened matching point pairs, eliminate globally inconsistent erroneous matching points, and obtain the final feature matching result.

[0102] The specific working methods of each unit are described in Example 1 and will not be repeated here.

[0103] It is understandable that the above-mentioned units can be separately or completely combined into one or several other units to constitute, or one (some) of the units can be further divided into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the functions of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the system may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0104] According to another embodiment of the present application, the system described in this embodiment can be constructed, and the method of Example 1 of the present application can be implemented by running a computer program (including program code) capable of executing the steps involved in the corresponding method described in Example 1 on a general-purpose computing device such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, and loaded into the above-mentioned computing device through the computer-readable recording medium and run therein.

[0105] Embodiment 3:

[0106] like Fig. 9 As shown, this implementation provides an electronic device, which includes a processor 1001, a communication interface 1002, and a computer-readable storage medium 1003. The processor 1001, the communication interface 1002, and the computer-readable storage medium 1003 may be connected via a bus or other means.

[0107] Among them, the communication interface 1002 is used to receive and send data, the computer-readable storage medium 1003 can be stored in the memory of the electronic device, the computer-readable storage medium 1003 is used to store a computer program, the computer program includes program instructions, and the processor 1001 is used to execute the program instructions stored in the computer-readable storage medium 1003.

[0108] The processor 1001 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device, which is suitable for implementing one or more instructions, and specifically suitable for loading and executing one or more instructions to implement corresponding method processes or corresponding functions.

[0109] The processor 1001 is configured to execute the following process:

[0110] Perform edge extraction on the preprocessed image to obtain an edge image;

[0111] Through the dynamic image pyramid, feature points are adaptively extracted from edge images of different scales, and feature descriptors corresponding to the feature points are generated;

[0112] Perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between feature descriptors;

[0113] The selected matching point pairs are screened again to remove globally inconsistent mismatching points and obtain the final feature matching results.

[0114] The specific working method is described in Example 1 and will not be repeated here.

[0115] Embodiment 4:

[0116] This implementation provides a computer-readable storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the electronic device and, of course, extended storage media supported by the electronic device. The computer-readable storage medium provides a storage space that stores the processing system of the electronic device.

[0117] In addition, the storage space also stores one or more instructions suitable for being loaded and executed by the processor, and these instructions may be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here may be a high-speed RAM memory, or a non-volatile memory, such as at least one disk memory; optionally, it may also be at least one computer-readable storage medium located away from the aforementioned processor.

[0118] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor loads and executes the one or more instructions stored in the computer-readable storage medium to implement the following process:

[0119] Perform edge extraction on the preprocessed image to obtain an edge image;

[0120] Through the dynamic image pyramid, feature points are adaptively extracted from edge images of different scales, and feature descriptors corresponding to the feature points are generated;

[0121] Perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between feature descriptors;

[0122] The selected matching point pairs are screened again to remove globally inconsistent mismatching points and obtain the final feature matching results.

[0123] The specific working method is described in Example 1 and will not be repeated here.

[0124] Embodiment 5:

[0125] The present implementation provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the following process:

[0126] Perform edge extraction on the preprocessed image to obtain an edge image;

[0127] Through the dynamic image pyramid, feature points are adaptively extracted from edge images of different scales, and feature descriptors corresponding to the feature points are generated;

[0128] Perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between feature descriptors;

[0129] The selected matching point pairs are screened again to remove globally inconsistent mismatching points and obtain the final feature matching results.

[0130] The specific working method is described in Example 1 and will not be repeated here.

[0131] A person skilled in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0132] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by the computer or a data processing device such as a server, a data center, etc. that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0133] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A feature matching method based on K clustering, characterized in that: The process includes: Perform edge extraction on the preprocessed image to obtain an edge image; The method of adaptively extracting feature points from edge images of different scales by using a dynamic image pyramid to generate feature descriptors corresponding to the feature points comprises: Obtain image complexity. When the image complexity is greater than a set threshold, increase the number of pyramid layers. When the image complexity is less than or equal to the set threshold, reduce the number of pyramid layers. When the feature area included in the edge image is larger than the set threshold, the scaling ratio is increased; for areas containing complex or subtle features, the scaling ratio is reduced; When the feature point extraction results in the current image layer tend to be stable and no new meaningful features appear at a smaller scale, the pyramid processing stops early; Analyze the gradient distribution of the image at different scales to determine the density change of feature points. If the distribution of feature points tends to be sparse at a smaller scale, the pyramid processing stops early. Perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between feature descriptors; for each cluster, find the corresponding cluster with the closest feature description in the first image and the second image, the feature points in cluster K1 form a cluster in the first image and a cluster in the second image, and it is only necessary to match the feature points in the corresponding cluster K1 without traversing all the feature points. In each pair of corresponding clusters, use the similarity measure between feature descriptors to perform feature matching, and only consider the feature points in the same cluster without cross-cluster matching; The selected matching point pairs are screened again to remove globally inconsistent mismatching points and obtain the final feature matching results.

2. The feature matching method based on K clustering according to claim 1, characterized in that: The preprocessing includes: image denoising and image enhancement; Perform edge extraction on the preprocessed image, including: The Sobel operator is used to calculate the horizontal and vertical gradients of the image. The improved Canny algorithm is used to perform non-maximum suppression and double threshold screening based on the calculated gradient to remove insignificant edges and obtain a preliminary edge image. For the preliminary edge image, two thresholds are set. and , get the pixel value of the final edge image For: When Or when G is connected to a strong edge pixel, is 1, hour, is 0, where G is the gradient amplitude.

3. The feature matching method based on K clustering according to claim 1, characterized in that: The RANSAC algorithm is used to perform geometric verification on the selected matching point pairs to eliminate the mismatched points that are locally matched but not globally consistent with geometric consistency.

4. A feature matching system based on K clustering, characterized in that: include: The image preprocessing unit is configured to: extract edges from the preprocessed image to obtain an edge image; The dynamic feature extraction unit is configured to: adaptively extract feature points on edge images of different scales through a dynamic image pyramid, and generate feature descriptors corresponding to the feature points, wherein adaptively extracting feature points on edge images of different scales through a dynamic image pyramid comprises: Obtain image complexity. When the image complexity is greater than a set threshold, increase the number of pyramid layers. When the image complexity is less than or equal to the set threshold, reduce the number of pyramid layers. When the feature area included in the edge image is larger than the set threshold, the scaling ratio is increased; for areas containing complex or subtle features, the scaling ratio is reduced; When the feature point extraction results in the current image layer tend to be stable and no new meaningful features appear at a smaller scale, the pyramid processing stops early; Analyze the gradient distribution of the image at different scales to determine the density change of feature points. If the distribution of feature points tends to be sparse at a smaller scale, the pyramid processing stops early. The clustering unit is configured to: perform K-means clustering on the feature descriptors, divide the feature descriptors into K clusters according to similarity, match feature points in each cluster, and screen out the best matching point pair by calculating the Euclidean distance between the feature descriptors; for each cluster, find a corresponding cluster with the closest feature description in the first image and the second image, the feature points in cluster K1 form a cluster in the first image and a cluster in the second image, only feature points need to be matched in the corresponding cluster K1, without traversing all feature points, and in each pair of corresponding clusters, use the similarity measure between feature descriptors to perform feature matching, only consider feature points in the same cluster, and do not need to match across clusters; The secondary screening unit is configured to perform secondary screening on the screened matching point pairs, eliminate globally inconsistent erroneous matching points, and obtain the final feature matching result.

5. A computer device, characterized in that: include: a processor and a computer readable storage medium; a processor adapted to execute a computer program; A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, the feature matching method based on K clustering according to any one of claims 1 to 3 is implemented.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the K-clustering-based feature matching method according to any one of claims 1 to 3.

7. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the feature matching method based on K clustering is implemented as claimed in any one of claims 1 to 3.

Citation Information

Patent Citations

  • ORB feature point matching method with scale invariance

    CN104850851A

  • ORB algorithm based on threshold adaptive threshold adjustment

    CN113191370A

  • Self-adaptive image matching algorithm fusing edge features

    CN114359591A