Fast BRIEF Feature Matching Method and System Based on Hue Information
By integrating hue and angle features from the HSV color space, the method addresses the computational inefficiencies of BRIEF feature matching, improving robustness and efficiency in feature matching processes.
Patent Information
- Application Number
- CN202310113458.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2043-02-10
AI Technical Summary
The prior art lacks feature information when using the BRIEF method to match features, and the calculation amount is large, resulting in low matching efficiency.
Feature points are marked in the image, hue features and angle features are extracted, combined with the BRIEF feature extraction algorithm, feature points are matched through hue information, and histogram statistics and binary search method are used to optimize the matching process.
It improves the robustness of feature matching, reduces the impact of lighting, improves matching efficiency and operating speed, and has better stability.
Smart Images

Figure CN116188807B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a fast BRIEF feature matching method and system based on hue information. Background Art
[0002] Hue is the appearance of a color. Common color spaces include the RGB color space and the HSV color space. Among them, the HSV color space divides colors into a mixture of three channels: hue, saturation, and value. Compared with the RGB color space, the HSV color space is more in line with the human eye's observation of things, and the hue channel is not easily affected by light.
[0003] The feature point method is a commonly used method in the field of image matching. This method includes three parts: feature point extraction, feature point feature description, and feature point matching. Among them, the feature point method has the advantages of small data volume and fast operation. By matching the feature points of two images, technologies such as camera pose estimation and 3D coordinate point estimation can be realized.
[0004] Common feature description vector extraction methods for feature point pairing include methods such as SURF and BRIEF. Among them, the SURF method has a large amount of calculation, while the BRIEF method has a small amount of calculation but does not contain rotation information. Commonly used methods for feature point pairing include the BF method and the FLANN method. Since the Hamming distance used for feature point matching is an exclusive OR operation and its value is not linearly distributed, the existing methods have a large amount of calculation in matching. Summary of the Invention
[0005] The present invention aims to solve the technical problems in the prior art that the BRIEF method lacks feature information and has a large amount of calculation in feature matching and calculation.
[0006] To solve the above technical problems, in a first aspect, an embodiment of the present invention provides a fast BRIEF feature matching method based on hue information, and the method includes the following steps:
[0007] S1. Mark feature points in the image and extract the hue features of the feature points. The image includes a first image and a second image, and the hue features include hue values and angular features;
[0008] S2. Extract the image features of the feature points in the first image and the second image according to the BRIEF feature extraction algorithm, and the image features are BRIEF features;
[0009] S3. Match the feature points in the first image and the second image according to the hue features and the image features, and output the feature point matching result.
[0010] Further, step S1 includes the following sub-steps:
[0011] S11. Mark the feature point P in the first image, and sample the pixel hue value h and the position vector v of the feature point P and the pixels within a preset range; i , position vector v i .
[0012] S12. Construct a histogram with 3 representative columns, and count the pixel hue value h of the feature point P, where the column width Δ of each representative column in the histogram is π / 3, and the statistical range Area of the i-th representative column satisfies: i h is π / 3, and the statistical range Area of the i-th representative column satisfies: i
[0013] Area i = Area i-1 + Δ h , i > 1;
[0014] S13. According to the statistical results of all the representative columns in the histogram, output the group of pixel hue values h and the position vector v with the largest statistical range, define the hue value as F, and the angle feature as θ, which respectively satisfy: i and the position vector v i , define the hue value as F val , and the angle feature as θ, which respectively satisfy:
[0015]
[0016]
[0017] In the above formula, N is the number of sampling points included in the representative group;
[0018] S14. Extract the hue feature in the second image according to the processes of steps S11 to S13.
[0019] Further, before step S2, there is also a step:
[0020] Rotate the pixels within the preset range of the feature point by an angle of -θ according to the angle feature θ of the feature point.
[0021] Further, step S3 includes the following sub-steps:
[0022] S31. Define the set of feature points in the first image as the first set, and the set of feature points in the second image as the second set. Sort the feature points in the first set and the second set respectively in ascending order according to the hue value h i ;
[0023] S32. Select the first feature points that have not been matched in the first set, and use the binary search method to search for the second feature points within the similarity range of the first feature points in the second set. The similarity Δh satisfies:
[0024]
[0025] where h i and h j are the pixel hue values of the first feature point and the second feature point respectively;
[0026] S33. Starting from the second feature point, search for other feature points similar to the first feature point in the sequence of the second set, and construct a third set regarding the rough matching result of the first feature point within the second set;
[0027] S34. Match the first feature point with the feature points in the third set one by one, and output the feature point with the highest similarity as the matching result of the first feature point.
[0028] Furthermore, in step S33, according to the sequence of the second set, starting from the second feature point, search on both sides of the sequence.
[0029] In a second aspect, an embodiment of the present invention further provides a fast BRIEF feature matching system based on hue information, including:
[0030] A hue processing module, configured to mark feature points in an image and extract the hue features of the feature points. The image includes a first image and a second image, and the hue features include hue values and angle features;
[0031] A feature extraction module, configured to extract the image features of the feature points in the first image and the second image according to the BRIEF feature extraction algorithm, and the image features are BRIEF features;
[0032] A feature matching module, configured to perform matching of the feature points in the first image and the second image according to the hue features and the image features, and output a feature point matching result.
[0033] In a third aspect, an embodiment of the present invention further provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the steps in any one of the above embodiments of the fast BRIEF feature matching method based on hue information.
[0034] Fourthly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the fast BRIEF feature matching method based on hue information as described in any one of the above embodiments are implemented.
[0035] The beneficial technical effects achieved by the present invention include:
[0036] First, hue information of the image is added to the matching operation during the matching process, and the features are not easily affected by information such as illumination, having stronger robustness;
[0037] Second, aiming at the complex matching problem of the traditional matching algorithm, the mechanism of the BRIEF algorithm is improved, and the range is locked by rough matching of feature points through the intuitively expressed hue values, improving the matching efficiency;
[0038] Third, through the improvement of the search mechanism, the running speed is not easily affected by the feature size of the BRIEF descriptor, and the running speed is fast and stable. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a schematic flowchart of the fast BRIEF feature matching method based on hue information provided by an embodiment of the present invention;
[0040] Figure 2 is a schematic diagram of a preset range for sampling an image provided by an embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of a statistical area provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0043] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the fast BRIEF feature matching method based on hue information provided by an embodiment of the present invention. The method includes the following steps:
[0044] S1. Mark feature points in the image, and extract the hue features of the feature points. The image includes a first image and a second image, and the hue features include hue values and angular features.
[0045] Furthermore, step S1 includes the following sub-steps:
[0046] S11. Mark the feature point P in the first image, and sample the pixel hue value h of the feature point P and the pixels within a preset range. i , the position vector v i .
[0047] Specifically, please refer to Figure 2 . Figure 2 is a schematic diagram of the preset range for sampling the image in the embodiment of the present invention. The black pixels around the feature point P in the figure are the positions of the actual sampling points.
[0048] S12. Construct a histogram with 3 representative columns, and count the pixel hue value h of the feature point P. i Among them, the column width Δ h of each representative column in the histogram is π / 3, and the statistical range Area i of the i-th representative column satisfies:
[0049] Area i = Area i-1 + Δ h , i > 1.
[0050] Specifically, since the hue information is angular information, that is, a cyclic model:
[0051] 0° = 180° = π;
[0052] Therefore, the column width of the histogram is:
[0053]
[0054] Define max as the maximum value of the hue value and min as the minimum value of the hue value. Then, the statistical range of the first representative column of the histogram is:
[0055] Area1 = [s, s + Δ h ;
[0056] Among them:
[0057]
[0058] Correspondingly, the schematic diagram of the statistical area of the first representative column is as shown in Figure 3 .
[0059] S13. According to the statistical results of all representative columns in the histogram, output the group of pixel hue values h i and the position vector v i with the largest statistical range, define the hue value as F val , and the angular feature as θ, which respectively satisfy:
[0060]
[0061]
[0062] In the above formula, N is the number of the sampling points included in the representative group.
[0063] S14. Extract the hue feature in the second image according to the process of steps S11 to S13.
[0064] S2. Extract the image features of the feature points in the first image and the second image according to the BRIEF feature extraction algorithm, and the image features are BRIEF features.
[0065] The BRIEF feature extraction algorithm is a method for describing feature information. It randomly selects several pairs of points, compares the magnitudes of each pair of points, and combines the results in a binary manner. The comparison between two BRIEF features is achieved through exclusive OR operation. The number of 1s in the operation result is counted and used as the Hamming distance. The higher the similarity between features, the smaller the Hamming distance.
[0066] Furthermore, before step S2, it further includes the step:
[0067] According to the angular feature θ of the feature point, rotate the pixels within the preset range of the feature point by an angle of -θ. Since the BRIEF feature does not contain rotation information, it is necessary to rotate the pixels around the coordinate point by an angle of -θ according to the angular feature θ of the feature point to unify its direction to obtain rotation invariance, and then extract the BRIEF feature value, so as to obtain the rotation-unified BRIEF feature.
[0068] S3. Match the feature points in the first image and the second image according to the hue feature and the image feature, and output the feature point matching result.
[0069] Furthermore, step S3 includes the following sub-steps:
[0070] S31. Define the set of feature points in the first image as the first set, and the set of feature points in the second image as the second set. Sort the feature points in the first set and the second set respectively according to the hue value h i in ascending order;
[0071] S32. Select an unmatched first feature point in the first set, and use the binary search method to find a second feature point in the second set that is within the similarity range of the first feature point. The similarity Δh satisfies:
[0072]
[0073] Among them, h i and h j are respectively the pixel hue values of the first feature point and the second feature point;
[0074] S33. Starting from the second feature point, search for other feature points similar to the first feature point in the sequence of the second set, and construct a third set of the rough matching results of the first feature point within the second set;
[0075] S34. Match the first feature point with the feature points in the third set one by one, and output the feature point with the highest similarity as the matching result of the first feature point.
[0076] Furthermore, in step S33, according to the sequence of the second set, starting from the second feature point, search on both sides of the sequence.
[0077] The beneficial technical effects achieved by the present invention include:
[0078] First, the hue information of the image is added to the matching operation during the matching process, and the features are not easily affected by information such as illumination, and have stronger robustness;
[0079] Second, aiming at the complex matching problem of the traditional matching algorithm, the mechanism of the BRIEF algorithm is improved, and the range is locked by rough matching of feature points through the intuitive hue value, improving the matching efficiency;
[0080] Third, through the improvement of the search mechanism, the running speed is not easily affected by the feature size of the BRIEF descriptor, and the running speed is fast and stable.
[0081] The embodiment of the present invention also provides a fast BRIEF feature matching system based on hue information, including:
[0082] A hue processing module, configured to mark feature points in an image and extract the hue features of the feature points, the image includes a first image and a second image, and the hue features include hue values and angle features;
[0083] A feature extraction module, configured to extract the image features of the feature points in the first image and the second image according to the BRIEF feature extraction algorithm, and the image features are BRIEF features;
[0084] A feature matching module, configured to match the feature points in the first image and the second image according to the hue features and the image features, and output a feature point matching result.
[0085] The fast BRIEF feature matching system based on hue information provided by the embodiments of the present invention can implement the steps in the fast BRIEF feature matching method based on hue information in the above embodiments, and can achieve the same technical effects. Refer to the description in the above embodiments, and details are not repeated here.
[0086] The embodiments of the present invention further provide a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor.
[0087] The processor calls the computer program stored in the memory and executes the steps in the fast BRIEF feature matching method based on hue information provided by the embodiments of the present invention. Please refer to Figure 1 , specifically including:
[0088] S1. Mark feature points in the image and extract the hue features of the feature points. The image includes a first image and a second image, and the hue features include hue values and angular features.
[0089] Furthermore, step S1 includes the following sub-steps:
[0090] S11. Mark the feature point P in the first image, and sample the pixel hue value h i , position vector v i of the feature point P and the pixels within a preset range;
[0091] S12. Construct a histogram with 3 representative columns, and count the pixel hue value h i of the feature point P. Among them, the column width Δ h of each representative column in the histogram is π / 3, and the statistical range Area i of the i-th representative column satisfies:
[0092] Area i = Area i-1 + Δ h , i > 1;
[0093] S13. According to the statistical results of all representative columns in the histogram, output the group of pixel hue values h i and the position vector v i with the largest statistical range, define the hue value as F val , and the angular feature as θ, which respectively satisfy:
[0094]
[0095]
[0096] In the above formula, N is the number of the sampling points included in the representative group;
[0097] S14. Extract the hue feature in the second image according to the processes of steps S11 to S13.
[0098] S2. Extract the image features of the feature points in the first image and the second image according to the BRIEF feature extraction algorithm, and the image features are BRIEF features.
[0099] Furthermore, before step S2, the following step is further included:
[0100] According to the angle feature θ of the feature point, rotate the pixels within the preset range of the feature point by an angle of -θ.
[0101] S3. Match the feature points in the first image and the second image according to the hue feature and the image feature, and output the feature point matching result.
[0102] Furthermore, step S3 includes the following sub-steps:
[0103] S31. Define the set of the feature points in the first image as the first set, and the set of the feature points in the second image as the second set, and sort the feature points in the first set and the second set respectively according to the hue value h i in ascending order.
[0104] S32. Select an unmatched first feature point in the first set, and search for a second feature point within the similarity range of the first feature point in the second set by using the binary search method, and the similarity Δh satisfies:
[0105]
[0106] where h i and h j are the pixel hue values of the first feature point and the second feature point respectively.
[0107] S33. Starting from the second feature point, search for other feature points similar to the first feature point in the sequence of the second set, and construct a third set of the rough matching result of the first feature point within the second set, that is, the third set is a subset of the second set.
[0108] S34. Match the first feature point with the feature points in the third set one by one, and output the feature point with the highest similarity as the matching result of the first feature point.
[0109] Further, in step S33, according to the sequence of the second set, starting from the second feature point, search on both sides of the sequence.
[0110] The computer device provided by the embodiments of the present invention can implement the steps in the fast BRIEF feature matching method based on hue information in the above embodiments, and can achieve the same technical effects. Refer to the description in the above embodiments, and details are not described herein again.
[0111] The embodiments of the present invention also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, it implements each process and step in the fast BRIEF feature matching method based on hue information provided by the embodiments of the present invention, and can achieve the same technical effects. To avoid repetition, details are not described here again.
[0112] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0113] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitations, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including that element.
[0114] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0115] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. What is disclosed is only the preferred embodiments of the present invention. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many equivalent changes in form without departing from the spirit and scope protected by the claims of the present invention, and all of them fall within the protection scope of the present invention.
Claims
1. A fast BRIEF feature matching method based on hue information, characterized in that The method includes the following steps: S1. Mark feature points in the image, and extract the hue features of the feature points. The image includes a first image and a second image, and the hue features include hue values and angular features; S2. According to the BRIEF feature extraction algorithm, extract the image features of the feature points in the first image and the second image. The image features are BRIEF features; S3. According to the hue features and the image features, perform matching of the feature points in the first image and the second image, and output the feature point matching result; Among them, step S1 includes the following sub-steps: S11. Mark the feature point P in the first image, and sample the pixel hue value h of the feature point P and the pixels within a preset range i , the position vector v i ; S12. Construct a histogram with 3 representative columns, and perform statistics on the pixel hue value h of the feature point P i where the column width Δ of each representative column in the histogram h is π / 3, and the statistical range Area of the i-th representative column i satisfies: Area i = Area i-1 + Δ h , i > 1; S13. Output a set of the pixel hue values h with the largest statistical range according to the statistical results of all the representative columns in the histogram i and the position vector v i , define the hue value as F val , and the angular feature is θ, which respectively satisfy: In the above formula, N is the number of sampling points included in the representative group; S14. Extract the hue features in the second image according to the processes of steps S11 to S13; Step S3 includes the following sub-steps: S31. Define the set of the feature points in the first image as the first set, and the set of the feature points in the second image as the second set. Sort the feature points in the first set and the second set respectively according to the hue value h i in ascending order; S32. Select an unmatched first feature point in the first set, and use the binary search method to find a second feature point in the second set that is within the similarity range of the first feature point. The similarity Δh satisfies: where h i and h j are the pixel hue values of the first feature point and the second feature point, respectively; S33. Starting from the second feature point, search for other feature points similar to the first feature point in the sequence of the second set, and construct a third set regarding the rough matching result of the first feature point in the second set; S34. Match the first feature point with the feature points in the third set one by one, and output the one with the highest similarity as the matching result of the first feature point.
2. The fast BRIEF feature matching method based on hue information according to claim 1, characterized in that Before step S2, there is also a step: According to the angular feature θ of the feature point, perform a rotation process with an angle of -θ on the pixels within the preset range of the feature point.
3. The fast BRIEF feature matching method based on hue information according to claim 1, wherein In step S33, according to the sequence of the second set, starting from the second feature point, search on both sides of the sequence.
4. A fast BRIEF feature matching system based on hue information, characterized in that, It includes: A hue processing module for marking feature points in the image and extracting the hue features of the feature points. The image includes a first image and a second image, and the hue features include hue values and angular features; A feature extraction module for extracting the image features of the feature points in the first image and the second image according to the BRIEF feature extraction algorithm. The image features are BRIEF features; A feature matching module for performing matching of the feature points in the first image and the second image according to the hue features and the image features, and outputting the feature point matching result; Among them, the hue processing module is also used to execute: S11. Mark the feature point P in the first image, and sample the pixel hue value h of the feature point P and the pixels within a preset range i , the position vector v i ; S12. Construct a histogram with 3 representative columns, and perform statistics on the pixel hue value h of the feature point P i wherein the column width Δ of each representative column in the histogram h is π / 3, and the statistical range Area of the i-th representative column i satisfies: Area i = Area i-1 + Δ h , i > 1; S13. Output a set of the pixel hue values h with the largest statistical range according to the statistical results of all the representative columns in the histogram i and the position vector v i . Define the hue value as F val . The angle feature is θ, and they respectively satisfy: In the above formula, N is the number of sampling points included in the representative group; S14. Extract the hue features in the second image according to the processes of steps S11 to S13; The feature matching module is also used to execute: S31. Define the set of the feature points in the first image as the first set, and the set of the feature points in the second image as the second set. Sort the feature points in the first set and the second set respectively according to the hue value h i in ascending order; S32. Select an unmatched first feature point in the first set, and use the binary search method to find a second feature point in the second set that is within the similarity range of the first feature point. The similarity Δh satisfies: where h i and h j are respectively the pixel hue values of the first feature point and the second feature point; S33. Starting from the second feature point, search for other feature points similar to the first feature point in the sequence of the second set, and construct a third set regarding the rough matching result of the first feature point within the second set; S34. Match the first feature point with the feature points in the third set one by one, and output the feature point with the highest similarity as the matching result of the first feature point.
5. A computer device, characterized in that, Comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the fast BRIEF feature matching method based on hue information as described in any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps in the fast BRIEF feature matching method based on hue information as described in any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Characteristic point extraction and matching method and system based on color image, and medium
CN113011498A
Apparatus and method for recognizing object
KR1020130091918A