Image feature point screening method, device and equipment and computer readable storage medium
By screening and supplementing key points in the image, and screening key point pairs based on angle and distance thresholds, the accuracy problem of image feature matching under conditions such as noise and perspective changes is solved, and the robustness and accuracy of matching are improved.
Patent Information
- Application Number
- CN202410844258.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-30
AI Technical Summary
Existing image feature matching methods have insufficient accuracy and robustness when dealing with noise, viewing angle changes, scale changes, and changes in lighting conditions. Mismatching is prone to occur, especially when there are large areas of white pixels in the image.
By detecting and matching key points in the image, calculate the angle and distance of the key point pairs, and filter out the appropriate key point pairs according to the preset angle threshold and distance threshold. If the screening result does not reach the quantity threshold, the detection will be repeated until it reaches the threshold. Threshold; supplement key points when the target area lacks key points to improve the accuracy and robustness of matching.
It effectively improves the accuracy and robustness of image feature matching, avoids mismatching, enhances the uniformity and stability of key point distribution, and improves the quality of image feature matching.
Smart Images

Figure CN118570575A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image feature point screening method, device, equipment and computer-readable storage medium. Background Art
[0002] Image feature matching is a basic and key technology in computer vision, and is widely used in object recognition, 3D reconstruction and other fields. The existing image feature matching methods currently have the following problems in practical applications: 1. Difficulties may be encountered when dealing with noise, changes in perspective, changes in scale, and changes in lighting conditions, all of which may affect the accuracy and robustness of the matching. 2. The detected feature points are not effectively screened, resulting in mismatches, especially when large areas of white pixels appear in the image. In view of this, how to improve the accuracy and robustness of matching has become a technical problem that needs to be urgently solved by those skilled in the art. Summary of the invention
[0003] The purpose of this application is to provide an image feature point screening method, device, equipment and computer-readable storage medium, which can improve the accuracy and robustness of image feature matching.
[0004] In order to solve the above technical problems, the present application provides an image feature point screening method, comprising: Perform key point detection and matching on the image to be matched to obtain a key point pair; the key point pair includes two matched key points; Calculate the angle and distance of the key point pair; According to the angle and distance of the key point pairs, the key point pairs that meet the angle threshold and the distance threshold are selected from the key point pairs; If the number of the selected key point pairs does not reach the quantity threshold, the key point detection and matching are performed again on the matching image to obtain new key point pairs, and the key point pairs that meet the angle threshold and the distance threshold are selected from each new key point pair again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; When the number of filtered key point pairs reaches the quantity threshold, if there are no key points included in the filtered key point pairs in any target area of the image to be matched, key points are added to the target area where there are no key points included in the filtered key point pairs; the key points added to the same target area in the two images to be matched constitute new key point pairs.
[0005] In some embodiments, performing key point detection and matching on the image to be matched to obtain key point pairs includes: Detecting key points of the image to be matched, and constructing key point descriptors of the key points; By matching the key point descriptors, matched key points are obtained; the matched key points constitute the key point pairs.
[0006] In some embodiments, based on the angle and distance of the key point pairs, selecting the key point pairs that meet the angle threshold and the distance threshold from each of the key point pairs includes: According to the angles of the key point pairs, select the key point pairs that meet the angle threshold from the key point pairs; According to the distances of the key point pairs, the key point pairs that meet the distance threshold are screened out from the key point pairs that meet the angle threshold.
[0007] In some embodiments, based on the angles of the key point pairs, selecting the key point pairs that meet the angle threshold from each of the key point pairs includes: sorting the angles of the key point pairs; Quantize the angles of each key point pair after sorting to a preset degree interval; The angle mode in the interval with the highest frequency is used as the angle threshold; The key point pairs whose angles do not satisfy the angle threshold are filtered out, and the key point pairs whose angles satisfy the angle threshold are retained.
[0008] In some embodiments, based on the distance of the key point pairs, selecting the key point pairs that meet the distance threshold from the key point pairs that meet the angle threshold includes: Sorting the distances of the key point pairs; Quantize the distances of the sorted key point pairs to a preset distance interval; The distance mode in the interval with the highest frequency is used as the distance threshold; The key point pairs whose distances do not meet the distance threshold are filtered out, and the key point pairs whose distances meet the distance threshold are retained.
[0009] In some embodiments, key point detection and matching are performed again on the image to be matched, and new key point pairs are obtained, including: The distance magnification is adjusted, and key point detection and matching are performed on the image to be matched according to the adjusted distance magnification to obtain new key point pairs.
[0010] In some embodiments, supplementing key points to a target area containing key points where there are no filtered key points includes: The center point of the target area where there is no key point included in the filtered key point pair is taken as the key point.
[0011] In order to solve the above technical problems, the present application also provides an image feature point screening device, comprising: A first key point detection and matching module is used to perform key point detection and matching on the image to be matched to obtain a key point pair; the key point pair includes two matched key points; An angle and distance calculation module, used to calculate the angle and distance of the key point pair; A key point pair screening module, used to screen out key point pairs that meet an angle threshold and a distance threshold from each of the key point pairs according to the angle and distance of the key point pairs; A second key point detection and matching module is used to perform key point detection and matching on the image to be matched again if the number of the key point pairs screened out does not reach the quantity threshold, obtain new key point pairs, and screen out key point pairs that meet the angle threshold and the distance threshold from each new key point pair again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; The key point supplement module is used to supplement key points in the target area where there are no key points included in the filtered key point pairs when the number of filtered key point pairs reaches a quantity threshold. The supplemented key points in the same target area in the two images to be matched constitute a new key point pair.
[0012] In order to solve the above technical problems, the present application also provides an image feature point screening device, comprising: Memory for storing computer programs; A processor is used to implement the steps of the above-mentioned image feature point screening method when executing the computer program.
[0013] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image feature point screening method described above are implemented.
[0014] The image feature point screening method provided in the present application includes: performing key point detection and matching on the image to be matched to obtain a key point pair; the key point pair includes two matched key points; calculating the angle and distance of the key point pair; based on the angle and distance of the key point pair, screening out the key point pairs that meet the angle threshold and the distance threshold from each of the key point pairs; if the number of the screened key point pairs does not reach the quantity threshold, performing key point detection and matching on the image to be matched again to obtain new key point pairs, and screening out the key point pairs that meet the angle threshold and the distance threshold from each of the new key point pairs again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; when the number of the screened key point pairs reaches the quantity threshold, if any target area of the image to be matched does not contain the key points included in the screened key point pair, then supplementing the key points in the target area where the key points included in the screened key point pair do not exist; the supplemented key points in the same target area in the two images to be matched constitute a new key point pair.
[0015] It can be seen that the image feature point screening method provided by the present application screens key point pairs according to the distance threshold and the angle threshold. In this way, by screening key point pairs from the distance dimension and the angle dimension, it is possible to ensure that the selected key points are accurate and effective, avoid mismatching during image feature matching, and improve the accuracy and robustness of image feature matching. At the same time, when there are no key points included in the screened key point pairs in any target area of the image to be matched, key points are supplemented in the target area where there are no key points included in the screened key point pairs. This can improve the uniformity and stability of the key point distribution, avoid mismatching during image feature matching, and improve the accuracy and robustness of image feature matching.
[0016] The image feature point screening device, equipment and computer-readable storage medium provided in this application all have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the prior art and the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A schematic diagram of a flow chart of an image feature point screening method provided in an embodiment of the present application; Figure 2 A schematic diagram of an image feature point screening device provided in an embodiment of the present application; Figure 3 A schematic diagram of an image feature point screening device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The core of this application is to provide an image feature point screening method, device, equipment and computer-readable storage medium, which can improve the accuracy and robustness of image feature matching.
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0021] Please refer to Figure 1 , Figure 1 A flowchart of an image feature point screening method provided in an embodiment of the present application is provided. Figure 1 As shown, the method includes: S101: performing key point detection and matching on the image to be matched to obtain a key point pair; the key point pair includes two matched key points; Image feature point screening is a key step in feature matching between two images to be matched. Step S101 is to detect and match key points of the images to be matched to obtain matching key points. Two matching key points constitute a key point pair, where one key point comes from one image to be matched and the other key point comes from another image to be matched. The two key points are considered to be points on the same scene or object.
[0022] In some embodiments, performing key point detection and matching on the image to be matched to obtain key point pairs includes: Detecting key points of the image to be matched, and constructing key point descriptors of the key points; By matching the key point descriptors, matched key points are obtained; the matched key points constitute the key point pairs.
[0023] The SURF (Speeded Up Robust Features) algorithm can be used to detect the key points of the image to be matched and construct the key point descriptor. The key point descriptor is a multi-dimensional feature vector that captures the feature information of the area around the key point by accumulating and counting the Harr wavelet responses of the area around the key point, thereby effectively describing the key point. The SURF algorithm mainly includes the following steps to detect the key points of the image to be matched: 1. Constructing the scale space: Using Gaussian blur to create different scale versions of the image, so as to detect key points at multiple scales. 2. Fast Hessian matrix detection: Using the integral image to quickly calculate the approximate value of the Hessian matrix to detect points of interest. 3. Direction assignment: Assign a main direction to each key point to achieve rotation invariance. 4. Feature descriptor generation: Generate feature descriptors for matching based on the pixel intensity information around the key point.
[0024] The constructed key point descriptors can be matched using the FLANN (Fast Library for Approximate Nearest Neighbors) algorithm to obtain the best matching key point pair, i.e., the key point pair. For two images to be matched, the FLANN algorithm usually constructs a FLANN index using the feature descriptors of the first image, and then uses the feature descriptors of the second image to query the FLANN index to find the nearest neighbor match.
[0025] S102: Calculate the angle and distance of the key point pair; The angle of a key point pair refers to the angle between the line connecting the two key points constituting the key point pair and the horizontal axis. The distance of a key point pair refers to the straight-line distance between the two key points constituting the key point pair in two-dimensional space.
[0026] S103: Filtering out key point pairs that meet an angle threshold and a distance threshold from each of the key point pairs according to the angle and distance of the key point pairs; Step S103 is intended to filter the key points from the angle dimension and the distance dimension, retain the key point pairs that meet the angle threshold and the distance threshold, and filter out the key point pairs that do not meet the angle threshold and the distance threshold. Meeting the angle threshold means that the angle of the key point pair is equal to the angle threshold. Meeting the distance threshold means that the distance of the key point pair is equal to the distance threshold.
[0027] In some embodiments, based on the angle and distance of the key point pairs, selecting the key point pairs that meet the angle threshold and the distance threshold from each of the key point pairs includes: According to the angles of the key point pairs, select the key point pairs that meet the angle threshold from the key point pairs; According to the distances of the key point pairs, the key point pairs that meet the distance threshold are screened out from the key point pairs that meet the angle threshold.
[0028] This embodiment firstly selects key point pairs that meet an angle threshold from all key point pairs according to their angles, and then selects key point pairs that meet a distance threshold from key point pairs that meet the angle threshold according to their distances.
[0029] It is clear that in addition to the above embodiments, it is also possible to first screen out key point pairs that meet the distance threshold from all key point pairs based on the distance of the key point pairs, and then screen out key point pairs that meet the angle threshold from the key point pairs that meet the distance threshold based on the angle of the key point pairs.
[0030] In some embodiments, based on the angles of the key point pairs, selecting the key point pairs that meet the angle threshold from each of the key point pairs includes: sorting the angles of the key point pairs; Quantize the angles of each key point pair after sorting to a preset degree interval; The angle mode in the interval with the highest frequency is used as the angle threshold; The key point pairs whose angles do not satisfy the angle threshold are filtered out, and the key point pairs whose angles satisfy the angle threshold are retained.
[0031] This embodiment sorts the angles of each key point pair, and quantizes the angles of each key point pair after sorting to a preset angle interval. For example, the angles of each key point pair after sorting are quantized to an interval of 10 degrees in order to count the frequency of occurrence of the angles of the key point pairs. The angle mode in the interval with the highest frequency is selected as the angle threshold. The highest frequency of an interval means that the most angles are quantized to this interval. Filter out the key point pairs whose angles do not meet the angle threshold, and retain the key point pairs whose angles meet the angle threshold.
[0032] For example, the angles of each key point pair after sorting are quantized to an interval of 10 degrees, and the angles of each key point pair are quantized to the intervals [10, 20], [30, 40]. Among them, the interval [10, 20] is the interval with the highest frequency, and the mode of the angles quantized to this interval is 18 degrees, so 18 degrees is selected as the angle threshold. The key point pairs whose angles are not equal to the angle threshold are filtered out, and the key point pairs whose angles meet the angle threshold are retained.
[0033] This embodiment sets the angle threshold by finding the mode of the angles, which is helpful for screening out reasonable key point pairs and improving the accuracy and robustness of image feature point screening.
[0034] In some embodiments, based on the distance of the key point pairs, selecting the key point pairs that meet the distance threshold from the key point pairs that meet the angle threshold includes: Sorting the distances of the key point pairs; Quantize the distances of the sorted key point pairs to a preset distance interval; The distance mode in the interval with the highest frequency is used as the distance threshold; The key point pairs whose distances do not meet the distance threshold are filtered out, and the key point pairs whose distances meet the distance threshold are retained.
[0035] This embodiment sorts the distances of each key point pair, and quantizes the distances of each key point pair after sorting to a preset distance interval. The mode of the distance in the interval with the highest frequency is selected as the distance threshold. The highest frequency of the interval means that the distance quantized to the interval is the largest. The key point pairs whose distances do not meet the distance threshold are filtered out, and the key point pairs whose distances meet the distance threshold are retained.
[0036] This embodiment sets the distance threshold by finding the mode of the distance, which is helpful to screen out reasonable key point pairs and improve the accuracy and robustness of image feature point screening.
[0037] S104: If the number of the selected key point pairs does not reach the quantity threshold, key point detection and matching are performed again on the image to be matched to obtain new key point pairs, and key point pairs that meet the angle threshold and the distance threshold are selected from each new key point pair again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; After screening, if the number of key point pairs that meet the angle threshold and the distance threshold is not up to the quantity threshold, then return to step S101, and execute steps S101 to S103 again in sequence to perform key point detection and matching on the image to be matched again to obtain new key point pairs, and again screen out key point pairs that meet the angle threshold and the distance threshold from each new key point pair, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold.
[0038] In some embodiments, key point detection and matching are performed again on the image to be matched, and new key point pairs are obtained, including: The distance magnification is adjusted, and key point detection and matching are performed on the image to be matched according to the adjusted distance magnification to obtain new key point pairs.
[0039] When the threshold is initialized, the minimum distance and distance multiplier are set. The minimum distance refers to the minimum value of the key point descriptor distance among all key point pairs, which represents the distance between the two most similar key points in all key point pairs. The threshold for screening out the best matching key point pair can be determined based on the distance multiplier and the minimum distance. The threshold is equal to the distance multiplier multiplied by the minimum distance. When the key point detection and matching are performed on the image to be matched again, the distance multiplier is adjusted, and the distance multiplier can be specifically increased. When the distance multiplier is increased, the threshold is increased accordingly. Traverse all the key point pairs determined according to the key point descriptors to determine whether the distance of the key point pairs is less than or equal to the threshold. If so, the key point pair is the best key point pair, which is used as the new key point pair. If not, the distance multiplier is increased again, and the cycle is repeated in this way. The cycle stops until the distance multiplier reaches the set value and / or the distance of the key point pair is less than or equal to the threshold.
[0040] By dynamically adjusting the threshold, it helps to adapt to the changes in keypoint distances between different images while maintaining matching quality.
[0041] S105: When the number of the screened key point pairs reaches a quantity threshold, if any target area of the image to be matched does not contain the key points included in the screened key point pairs, key points are added to the target area where the key points included in the screened key point pairs do not exist; the key points added to the same target area in the two images to be matched constitute a new key point pair.
[0042] The image to be matched can be divided into four target areas: upper left, upper right, lower left, and lower right. When the number of the selected key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold, if any target area of the image to be matched does not contain the key points included in the selected key point pair, then the key points are supplemented in the target area where the key points included in the selected key point pair do not exist, that is, key points are selected in the target area where the key points included in the selected key point pair do not exist, and the selected key points constitute a new key point pair.
[0043] Among them, a key point can be selected in the target area where there is no key point included in the filtered key point pair. A key point is selected in the same target area of the two images to be matched, and these two key points constitute a key point pair. Alternatively, two or more key points can be selected in the target area where there is no key point included in the filtered key point pair. Two or more key points are selected in the same target area of the two images to be matched. A key point at a certain position of the target area in one image to be matched and a key point at the same position of the same target area in another image to be matched constitute a key point pair. For example, a key point at the upper left corner of the target area in one image to be matched and a key point at the upper left corner of the same target area in another image to be matched constitute a key point pair. A key point at the center position of the target area in one image to be matched and a key point at the center position of the same target area in another image to be matched constitute a key point pair.
[0044] In some embodiments, supplementing key points to a target area containing key points where there are no filtered key points includes: The center point of the target area where there is no key point included in the filtered key point pair is taken as the key point.
[0045] When supplementing key points, this embodiment selects the center point of the target area as the key point, and the center points of the same target area of the two images to be matched constitute a new key point pair.
[0046] It can be understood that in addition to selecting the center point as the key point, other points in the target area can also be selected as key points.
[0047] The image feature point screening method provided in the above embodiment can be applied to image stitching and three-dimensional reconstruction. The key point pairs after screening have the following main uses: (1) Establishing correspondence: Key point matching is the basis for establishing correspondence between different images, and these correspondences are the key inputs for three-dimensional reconstruction. (2) Estimating geometric transformation: Key point pairs are used to estimate the geometric transformation between images, which is crucial for restoring the three-dimensional structure of the scene. (3) Improving reconstruction quality: High-quality matching can significantly improve the accuracy and robustness of three-dimensional reconstruction.
[0048] In summary, the image feature point screening method provided by the present application screens key point pairs according to the distance threshold and the angle threshold. In this way, by screening key point pairs from the distance dimension and the angle dimension, it is possible to ensure that the selected key points are accurate and effective, avoid mismatching during image feature matching, and improve the accuracy and robustness of image feature matching. At the same time, when there are no key points included in the screened key point pairs in any target area of the image to be matched, key points are supplemented in the target area where there are no key points included in the screened key point pairs. This can improve the uniformity and stability of the key point distribution, avoid mismatching during image feature matching, and improve the accuracy and robustness of image feature matching.
[0049] The present application also provides an image feature point screening device, and the device described below can be referred to in correspondence with the method described above. Figure 2 , Figure 2 A schematic diagram of an image feature point screening device provided in an embodiment of the present application, combined with Figure 2 As shown, the device comprises: A first key point detection and matching module 10 is used to perform key point detection and matching on the image to be matched to obtain a key point pair; the key point pair includes two matched key points; An angle and distance calculation module 20, used to calculate the angle and distance of the key point pair; A key point pair screening module 30, configured to screen key point pairs that meet an angle threshold and a distance threshold from each of the key point pairs according to the angle and distance of the key point pairs; The second key point detection and matching module 40 is used to perform key point detection and matching on the image to be matched again to obtain new key point pairs if the number of the selected key point pairs does not reach the quantity threshold, and select key point pairs that meet the angle threshold and the distance threshold from each new key point pair again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; The key point supplement module 50 is used to supplement key points in the target area where the key points included in the filtered key point pairs do not exist when the number of the filtered key point pairs reaches a quantity threshold; the supplemented key points in the same target area in the two images to be matched constitute a new key point pair.
[0050] In some embodiments, the first key point detection and matching module 10 includes: A key point description construction unit, used for detecting key points of the image to be matched and constructing key point descriptors of the key points; The key point descriptor matching unit is used to obtain matched key points by matching the key point descriptors; the matched key points constitute the key point pairs.
[0051] In some embodiments, the key point pair screening module 30 includes: A first key point pair screening unit, configured to screen out key point pairs that meet an angle threshold from each of the key point pairs according to the angles of the key point pairs; The second key point pair screening unit is used to screen out key point pairs that meet a distance threshold from key point pairs that meet an angle threshold according to the distance of the key point pairs.
[0052] In some embodiments, the first key point pair screening unit includes: An angle sorting subunit, used to sort the angles of each of the key point pairs; An angle quantization subunit, used to quantize the angles of each key point pair after sorting to a preset degree interval; An angle threshold determination subunit, used to take the angle mode in the interval with the highest frequency as the angle threshold; The first key point pair screening subunit is used to filter out key point pairs whose angles do not meet the angle threshold, and retain key point pairs whose angles meet the angle threshold.
[0053] In some embodiments, the second key point pair screening unit includes: A distance sorting subunit, used for sorting the distances of the key point pairs; A distance quantization subunit, used to determine the interval of the distance quantization of each key point pair after sorting to a preset distance; a distance threshold determination subunit, configured to use the distance mode in the interval with the highest frequency as the distance threshold; The second key point pair screening subunit is used to filter out key point pairs whose distances do not meet the distance threshold, and retain key point pairs whose distances meet the distance threshold.
[0054] In some embodiments, the second key point detection and matching module 40 includes: The distance magnification adjustment unit is used to adjust the distance magnification, and perform key point detection and matching on the image to be matched according to the adjusted distance magnification to obtain a new key point pair.
[0055] In some embodiments, the key point supplement module 50 is specifically used to: The center point of the target area where there is no key point included in the filtered key point pair is taken as the key point.
[0056] The image feature point screening device provided by the present application screens key point pairs according to the distance threshold and the angle threshold. In this way, the key point pairs are screened from the distance dimension and the angle dimension, which can ensure that the selected key points are accurate and effective, avoid mismatching during image feature matching, and improve the accuracy and robustness of image feature matching. At the same time, when the key points included in the screened key point pairs do not exist in any target area of the image to be matched, the key points are supplemented in the target area where the key points included in the screened key point pairs do not exist. This can improve the uniformity and stability of the key point distribution, avoid mismatching during image feature matching, and improve the accuracy and robustness of image feature matching.
[0057] This application also provides an image feature point screening device, referring to Figure 3 As shown, the device includes a memory 1 and a processor 2 .
[0058] Memory 1, used for storing computer programs; Processor 2 is used to execute the computer program to implement the following steps: Perform key point detection and matching on the image to be matched to obtain a key point pair; the key point pair includes two matched key points; calculate the angle and distance of the key point pair; based on the angle and distance of the key point pair, select the key point pairs that meet the angle threshold and the distance threshold from each of the key point pairs; if the number of the selected key point pairs does not reach the quantity threshold, perform key point detection and matching on the image to be matched again to obtain a new key point pair, and select the key point pairs that meet the angle threshold and the distance threshold from each of the new key point pairs again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; when the number of the selected key point pairs reaches the quantity threshold, if any target area of the image to be matched does not contain the key points included in the selected key point pair, then add key points to the target area where the key points included in the selected key point pair do not exist; the key points added to the same target area in the two images to be matched constitute a new key point pair.
[0059] For an introduction to the equipment provided in this application, please refer to the above method embodiments, and this application will not go into details here.
[0060] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented: Perform key point detection and matching on the image to be matched to obtain a key point pair; the key point pair includes two matched key points; calculate the angle and distance of the key point pair; based on the angle and distance of the key point pair, select the key point pairs that meet the angle threshold and the distance threshold from each of the key point pairs; if the number of the selected key point pairs does not reach the quantity threshold, perform key point detection and matching on the image to be matched again to obtain a new key point pair, and select the key point pairs that meet the angle threshold and the distance threshold from each of the new key point pairs again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; when the number of the selected key point pairs reaches the quantity threshold, if any target area of the image to be matched does not contain the key points included in the selected key point pair, then add key points to the target area where the key points included in the selected key point pair do not exist; the key points added to the same target area in the two images to be matched constitute a new key point pair.
[0061] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0062] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.
[0063] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices, equipment, and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0064] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.
[0065] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0066] The image feature point screening method, device, equipment and computer-readable storage medium provided by the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A method for screening image feature points, characterized in that: include: Perform key point detection and matching on the image to be matched to obtain key point pairs; The key point pair includes two matched key points; Calculate the angle and distance of the key point pair; According to the angle and distance of the key point pairs, the key point pairs that meet the angle threshold and the distance threshold are selected from the key point pairs; If the number of the selected key point pairs does not reach the quantity threshold, the key point detection and matching are performed again on the matching image to obtain new key point pairs, and the key point pairs that meet the angle threshold and the distance threshold are selected from each new key point pair again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; When the number of filtered key point pairs reaches the quantity threshold, if there are no key points included in the filtered key point pairs in any target area of the image to be matched, key points are added to the target area where there are no key points included in the filtered key point pairs; the key points added to the same target area in the two images to be matched constitute new key point pairs.
2. The image feature point screening method according to claim 1, characterized in that: Perform key point detection and matching on the image to be matched, and obtain key point pairs including: Detecting key points of the image to be matched, and constructing key point descriptors of the key points; By matching the key point descriptors, matched key points are obtained; the matched key points constitute the key point pairs.
3. The image feature point screening method according to claim 1, characterized in that: According to the angle and distance of the key point pairs, the key point pairs satisfying the angle threshold and the distance threshold are selected from each of the key point pairs, including: According to the angles of the key point pairs, select the key point pairs that meet the angle threshold from the key point pairs; According to the distances of the key point pairs, the key point pairs that meet the distance threshold are screened out from the key point pairs that meet the angle threshold.
4. The image feature point screening method according to claim 3, characterized in that: According to the angles of the key point pairs, the key point pairs satisfying the angle threshold are selected from the key point pairs, including: sorting the angles of the key point pairs; Quantize the angles of each key point pair after sorting to a preset degree interval; The angle mode in the interval with the highest frequency is used as the angle threshold; The key point pairs whose angles do not satisfy the angle threshold are filtered out, and the key point pairs whose angles satisfy the angle threshold are retained.
5. The image feature point screening method according to claim 3, characterized in that: According to the distance of the key point pairs, the key point pairs that meet the distance threshold are screened out from the key point pairs that meet the angle threshold, including: Sorting the distances of the key point pairs; Quantize the distances of the sorted key point pairs to a preset distance interval; The distance mode in the interval with the highest frequency is used as the distance threshold; The key point pairs whose distances do not meet the distance threshold are filtered out, and the key point pairs whose distances meet the distance threshold are retained.
6. The image feature point screening method according to claim 5, characterized in that: The key point detection and matching are performed on the image to be matched again, and the new key point pairs obtained include: The distance magnification is adjusted, and key point detection and matching are performed on the image to be matched according to the adjusted distance magnification to obtain new key point pairs.
7. The image feature point screening method according to claim 6, characterized in that: In the absence of filtered key points, the target area of the included key points supplemented with key points includes: The center point of the target area where there is no key point included in the filtered key point pair is taken as the key point.
8. An image feature point screening device, characterized in that: include: The first key point detection and matching module is used to perform key point detection and matching on the image to be matched to obtain key point pairs; The key point pair includes two matched key points; An angle and distance calculation module, used to calculate the angle and distance of the key point pair; A key point pair screening module, used to screen out key point pairs that meet an angle threshold and a distance threshold from each of the key point pairs according to the angle and distance of the key point pairs; A second key point detection and matching module is used to perform key point detection and matching on the image to be matched again if the number of the key point pairs screened out does not reach the quantity threshold, obtain new key point pairs, and screen out key point pairs that meet the angle threshold and the distance threshold from each new key point pair again, until the number of key point pairs that meet the angle threshold and the distance threshold reaches the quantity threshold; The key point supplement module is used to supplement key points in the target area where there are no key points included in the filtered key point pairs when the number of filtered key point pairs reaches a quantity threshold. The supplemented key points in the same target area in the two images to be matched constitute a new key point pair.
9. An image feature point screening device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the image feature point screening method as described in any one of claims 1 to 7 when executing the computer program.
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 feature point screening method according to any one of claims 1 to 7 are implemented.
