An image matching method based on spatial ordered gradient histogram
By constructing an image matching method based on ordered gradient histograms, the problem of insufficient robustness in complex lighting changes is solved in the existing technology, and a more efficient and robust image matching effect is achieved.
Patent Information
- Application Number
- CN202111376034.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-11-19
AI Technical Summary
The existing image matching method based on gradient information is poorly robust in complex lighting changes scenarios and is difficult to match effectively.
By calculating the ordered amplitude angle information of the gradient vector in the support area of the image local feature, mapping it to the corresponding direction corner sub-interval, an ordered gradient histogram is constructed to realize the description and matching of the local features of the image.
It effectively improves the robustness and matching effect of the image matching method in complex lighting changes scenes, and reduces the impact of lighting changes on the gradient vector amplitude.
Smart Images

Figure CN114037638B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an image matching technology, and more specifically, to an image matching method based on a spatial ordered gradient histogram. Background Art
[0002] Image matching based on local feature description methods is an indispensable prerequisite for many computer vision applications, such as image fusion, image stitching, depth of field calculation, etc., and has a significant impact on the performance of related application systems. Therefore, it is particularly important to further improve the robustness of local feature description methods for common scenes, such as image rotation and scaling, illumination changes, and image blur.
[0003] As the application of computer vision continues to expand, the number of matching scenarios that image matching needs to cope with is also increasing. The local feature description method of the image based on gradient information shows good performance in the field of image matching, but its robustness to some scenes such as complex illumination changes is poor, and the matching effect is not ideal. The existing image matching method based on pixel grayscale information can better adapt to illumination change scenes, but cannot cope well with nonlinear complex illumination change scenes. Since the amplitude of the gradient vector is more sensitive to complex illumination changes, the amplitude angle is more robust to them. Summary of the invention
[0004] In view of the shortcomings of the prior art, the purpose of the present invention is to provide an image matching method based on a spatial ordered gradient histogram. The invention maps the ordered amplitude-angle information to the corresponding direction angle sub-interval by calculating the ordered amplitude-angle information of the gradient, and constructs an ordered gradient amplitude-angle histogram to describe the local features of the image. The ordered gradient vector amplitude-angle histogram constructed based on the local gradient information completes the description of the local features of the image and realizes image matching. The present invention only uses the amplitude-angle information of the gradient, which effectively improves the robustness to complex lighting changes.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] An image matching method based on a spatial ordered gradient histogram, which calculates the gradient features of sampling points in a feature support area of a feature point in sequence according to a specified direction, maps the amplitude angles of the gradient features in a specified order, establishes an ordered gradient histogram to complete the description of the feature points, and performs an image matching operation to obtain a mapping relationship between images, specifically comprising the following steps:
[0007] Step 1. Input a grayscale image and perform Gaussian filtering on the image, and extract feature points on the filtered image;
[0008] Step 2. Taking feature point X as the center of the circle, determine the feature support area and sampling points of feature point X, and calculate the ordered gradient vector of each sampling point in the feature support area;
[0009] Step 3. Calculate the amplitude of the ordered gradients of all sampling points;
[0010] Step 4. Map the ordered gradient amplitude angle of the sampling point to the ordered direction angle sub-interval;
[0011] Step 5. Establish an ordered gradient histogram based on the ordered gradient amplitude-angle mapping distribution obtained in step 4 to complete the description of the feature points; use the image local feature descriptor to perform image matching operations to obtain the mapping relationship between images.
[0012] Furthermore, in step 2, the sampling point P of feature point X in the feature support area i The direction of the gradient is set as follows, and the obtained gradient angle is encoded:
[0013] Step 2.1 Take sampling point P i As the origin, from the feature point X to the sampling point P i The direction of the coordinate system is the y-axis;
[0014] Step 2.2 Select several sampling points P i Neighborhood point P i n , the sampling point P on the positive y-axis i The neighboring point of i 0 , other neighboring points are sorted in the specified direction, starting with the sampling point P i Construct the gradient vector for the center of the circle.
[0015] Furthermore, the number of neighborhood points is not less than 4.
[0016] Further, in step 3, the amplitude of the ordered gradient is calculated, which specifically includes the following steps:
[0017] Step 3.1 calculates the angles of the gradient vector coincident with the y-axis and other gradient vectors in sequence, and encodes the angles;
[0018] Step 3.2 combines the argument angle and the corresponding code obtained in step 3.2 to form a data set.
[0019] Furthermore, the value of the gradient angle is limited to the interval [0,π).
[0020] Further, in step 4, the gradient amplitude is mapped in an orderly manner according to the gradient code corresponding to the amplitude, including the following steps:
[0021] Step 4.1 Map the argument obtained in step 3 to the corresponding angle range using the following formula:
[0022]
[0023] Where Phi_n is the gradient vector magnitude angle calculated in step 3, d is the number of angle intervals, and b n Indicates the angle interval code corresponding to the argument Phi_n;
[0024] Step 4.2 sequentially completes the angle interval mapping calculation for all the arguments obtained in step 3 through step 4.1, and converts the data pairs in step 3 into a data pair set.
[0025] Further, in step 5, according to the argument mapping obtained in step 4, the method for establishing an ordered gradient histogram comprises the following steps:
[0026] Step 5.1: Create a histogram of the set based on the data generated in step 4.2;
[0027] Step 5.2: Based on the argument mapping information and label information of all sampling points in the feature support area of the feature point X, an ordered gradient argument histogram is established with the frequency as the horizontal axis and the argument as the vertical axis to generate a spatial ordered gradient histogram descriptor;
[0028] Step 5.3 performs image matching operations based on the local feature descriptors of the images generated in step 5.2, obtains the mapping relationship between images, and obtains a mapping matrix.
[0029] In summary, the invention has the following beneficial effects:
[0030] The present invention constructs the gradient vector of each sampling point in the support area of the local feature of the image, calculates the amplitude angle information of the ordered gradient vector of each sampling point in a certain order, maps the amplitude angle information to the corresponding sub-interval according to the corresponding label of the amplitude angle, generates an ordered gradient amplitude angle histogram, realizes the description of the local feature points of the image, completes the image matching operation, and effectively improves the effectiveness and robustness of the image matching method in the scene of illumination change; when calculating the gradient feature of the sampling point, only the amplitude angle of the gradient vector is calculated, and the amplitude of the gradient vector is not calculated, so as to reduce the influence of the amplitude of the gradient vector on the illumination change; when calculating the amplitude angle information of the gradient, the value range of the amplitude angle is set to [0, π), which can effectively deal with the grayscale inversion problem caused by the illumination change, further improve the robustness of the image matching method, and expand the applicable scenes; when performing gradient vector amplitude angle mapping, it is mapped to the corresponding sub-interval according to the label information and specific amplitude angle value of the gradient vector amplitude angle, so as to further improve the robustness of the image matching method to the illumination change. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1is a flow chart of the present invention;
[0032] Figure 2 is the sampling gradient direction coordinate system of the present invention;
[0033] Figure 3 It is the spatial ordered gradient histogram descriptor of the present invention. DETAILED DESCRIPTION
[0034] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0035] like Figures 1 to 3 As shown, the present invention discloses an image matching method based on a spatial ordered gradient histogram, which is characterized in that: the gradient features of the sampling points in the feature support area of the feature points are calculated in sequence according to the specified direction, the clockwise direction or the counterclockwise direction can be selected as the specified direction, the amplitude angle of the gradient features is mapped according to the specified order, and an ordered gradient histogram is established to complete the description of the feature points. The specified order can be the same as the aforementioned specified direction, and an image matching operation is performed to obtain a mapping relationship between images, which specifically includes the following steps:
[0036] Step 1. Input a grayscale image and perform Gaussian filtering on the image, extract feature points on the filtered image, select multiple feature points from the same image, and each feature point requires image matching using the method of the present invention.
[0037] Step 2. Taking feature point X as the center, determine the feature support area and sampling points of feature point X, and calculate the ordered gradient vector of each sampling point in the feature support area; the sampling point P of feature point X in the feature support area i The direction of the gradient is set as follows, and the obtained gradient angle is encoded:
[0038] Step 2.1 Take sampling point P i As the origin, from the feature point X to the sampling point P i The direction of the coordinate system is the y-axis.
[0039] Step 2.2 Select several sampling points P i Neighborhood point P i n , the sampling point P on the positive y-axis i The neighboring point of i 0 , other neighborhood points are sorted in the specified direction, the number of neighborhood points is not less than 4, the number of neighborhood points and the neighborhood radius can be adjusted according to the experimental requirements or actual needs, with the sampling point P i Construct the gradient vector for the center of the circle, such as Figure 2 As shown, select 8 neighborhood points P i 0 ~Pi 7 , the neighborhood points are sorted in a counterclockwise direction, according to the coordinate system shown in the figure, with sampling point P i As the center of the circle, construct 4 gradient vectors:
[0040] Step 3. Calculate the argument of the ordered gradient of all sampling points without calculating the amplitude information. Since the amplitude information is easily affected by the change of illumination, the amplitude information is not calculated in this step. Calculate the argument of the ordered gradient, specifically including the following steps:
[0041] Step 3.1 calculates the gradient vector coincident with the y-axis and the argument angles of other gradient vectors in sequence, and encodes the argument angles; in this embodiment, calculates Three gradient vectors and gradient vector The amplitude angle between 0 and 1 is limited to the interval [0,π), which further improves the robustness to illumination changes. When calculating the gradient amplitude angle information, the value range of the amplitude angle is limited to the interval [0,π). When establishing the gradient amplitude angle histogram, the amplitude information of the gradient feature is not used in the present invention. The fact that the histogram does not use the amplitude information does not affect the present invention. When the amplitude angle is mapped to the corresponding sub-interval, the frequency of the sub-interval is increased by 1. The amplitude angle is mapped to [0,π) mainly because the grayscale value of the pixel may be reversed, resulting in the amplitude angle being exactly opposite. When the value range is [0,π), the problem of amplitude angle flipping can be solved.
[0042] The gradient vector and The angle between is represented as Phi_1, encoded as Sec_1, and the gradient vector and The angle between is represented as Phi_2, encoded as Sec_2, and the gradient vector and The argument between is represented as Phi_3 and coded as Sec_3, where
[0043] Step 3.2 combines the argument angle and the corresponding code obtained in step 3.2 to form a data set, namely:
[0044] D1=(Phi_1, Sec-1); D2=(Phi_2, Sec_2); D3=(Phi_3, Sec_3).
[0045] Step 4. Map the ordered gradient amplitude of the sampling point to the ordered direction angle sub-interval, and do not use the amplitude information corresponding to the amplitude. In this step, only the gradient amplitude is mapped. When the gradient amplitude is mapped to the angle sub-interval corresponding to the amplitude, the frequency of the angle sub-interval is increased by 1.
[0046] When mapping the gradient angle, an orderly mapping is performed according to the gradient code corresponding to the angle, including the following steps:
[0047] Step 4.1 Set the number of angle intervals to be mapped to d, and map the angle obtained in step 3 to the corresponding angle interval using formula (1). n There may be cases where it is not an integer. In formula (1), the function cvFloor is used to encode the angle interval b n Round down.
[0048] Step 4.2 sequentially completes the angle interval mapping calculation for all the arguments obtained in step 3 through step 4.1, and converts the data pairs in step 3 into a data pair set, namely:
[0049] D'1=(b1,Sec_1); D'2=(b2,Sec_2); D'3=(b3,Sec_3).
[0050] Step 5. Establish an ordered gradient histogram based on the ordered gradient amplitude-angle mapping distribution obtained in step 4 to complete the description of the feature points; use the image local feature descriptor to perform image matching operations to obtain the mapping relationship between images.
[0051] According to the argument mapping obtained in step 4, the method for establishing an ordered gradient histogram comprises the following steps:
[0052] Step 5.1: Establish a histogram based on the data pair set generated in step 4.2. When establishing the histogram, it is necessary to map the angle of argument to the corresponding encoding sub-interval histogram according to the angle encoding in the data pair set. When calculating the gradient angle of argument, it is necessary to determine the angle mapping information b. i Which part of the histogram should it belong to? For example, the second element Sec_1 in D'1 indicates that the argument of D'1 belongs to the Sec_1 part of the ordered gradient argument histogram. Sec_1 indicates that the argument belongs to the first part of the histogram, and b1 indicates the specific position of the argument in the Sec_1 part. Then the argument mapping information b1 is added to Figure 3 In the histogram corresponding to Sec_1 shown, the histograms of the remaining data pair sets are established according to the above method, and the number of angle intervals of each encoding Sec is equal, and the number of angle intervals is d.
[0053] Step 5.2 Obtain the argument mapping information and label information of all sampling points in the feature support area of the feature point X according to the above method, and establish an ordered gradient argument histogram with frequency as the horizontal axis and argument as the vertical axis based on the argument mapping information and label information of all sampling points to generate the following: Figure 3 The spatial ordered gradient histogram descriptor shown.
[0054] Step 5.3 performs image matching operations based on the local feature descriptors of the images generated in step 5.2, obtains the mapping relationship between images, and obtains a mapping matrix.
[0055] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. An image matching method based on spatial ordered gradient histogram, characterized in that: The gradient features of the sampling points in the feature support area of the feature points are calculated in sequence according to the specified direction, the amplitude angles of the gradient features are mapped according to the specified order, an ordered gradient histogram is established to complete the description of the feature points, and an image matching operation is performed to obtain the mapping relationship between images, which specifically includes the following steps: Step 1. Input a grayscale image and perform Gaussian filtering on the image, and extract feature points on the filtered image; Step 2. Taking feature point X as the center of the circle, determine the feature support area and sampling points of feature point X, and calculate the ordered gradient vector of each sampling point in the feature support area; Step 3. Calculate the amplitude of the ordered gradients of all sampling points; Step 4. Map the ordered gradient amplitude angle of the sampling point to the ordered direction angle sub-interval; Step 5. Establish an ordered gradient histogram based on the ordered gradient amplitude-angle mapping distribution obtained in step 4 to complete the description of the feature points; use the image local feature descriptor to perform image matching operations to obtain the mapping relationship between images.
2. The image matching method based on spatial ordered gradient histogram according to claim 1, characterized in that: In step 2, the feature point X is at the sampling point P in the feature support area. i The direction of the gradient is set as follows, and the obtained gradient angle is encoded: Step 2.1 Take sampling point P i As the origin, from the feature point X to the sampling point P i The direction of the coordinate system is the y-axis; Step 2.2 Select several sampling points P i Neighborhood point P i n , the sampling point P on the positive y-axis i The neighboring point of i 0 , other neighboring points are sorted in the specified direction, starting with the sampling point P i Construct the gradient vector for the center of the circle.
3. The image matching method based on spatial ordered gradient histogram according to claim 2, characterized in that: The number of the neighborhood points is no less than 4.
4. The image matching method based on spatial ordered gradient histogram according to claim 1, characterized in that: Calculating the argument of the ordered gradient in step 3 specifically includes the following steps: Step 3.1 calculates the angles of the gradient vector coincident with the y-axis and other gradient vectors in sequence, and encodes the angles; Step 3.2 combines the argument angle and the corresponding code obtained in step 3.2 to form a data set.
5. The image matching method based on spatial ordered gradient histogram according to claim 4, characterized in that: The value of the gradient angle is limited to the interval [0,π).
6. The image matching method based on spatial ordered gradient histogram according to claim 1, characterized in that: In step 4, the gradient amplitude mapping is performed in an orderly manner according to the gradient coding corresponding to the amplitude, including the following steps: Step 4.1 Map the argument obtained in step 3 to the corresponding angle range using the following formula: Where Phi_n is the gradient vector magnitude angle calculated in step 3, d is the number of angle intervals, and b n Indicates the angle interval code corresponding to the argument Phi_n; Step 4.2 sequentially completes the angle interval mapping calculation for all the arguments obtained in step 3 through step 4.1, and converts the data pairs in step 3 into a data pair set.
7. The image matching method based on spatial ordered gradient histogram according to claim 1, characterized in that: In step 5, according to the argument mapping obtained in step 4, the method for establishing an ordered gradient histogram comprises the following steps: Step 5.1: Create a histogram of the set based on the data generated in step 4.2; Step 5.2: Based on the argument mapping information and label information of all sampling points in the feature support area of the feature point X, an ordered gradient argument histogram is established with the frequency as the horizontal axis and the argument as the vertical axis to generate a spatial ordered gradient histogram descriptor; Step 5.3 performs image matching operations based on the local feature descriptors of the images generated in step 5.2, obtains the mapping relationship between images, and obtains a mapping matrix.
Citation Information
Patent Citations
Local coordinate system feature description based image matching method
CN103632142A
Image local feature description method, device and equipment and medium
CN109993176A