A gradient histogram feature description method based on circular neighborhood
By dividing the image feature neighborhood into multiple ring or sector areas, and calculating and accumulating gradient histograms, the existing feature description methods have solved the problem of high computational complexity and poor efficiency, and achieved more efficient feature description.
Patent Information
- Application Number
- CN202111263216.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-10-28
AI Technical Summary
The existing feature description method has high computational complexity and poor efficiency, especially the problem of calculating the gradient histogram of feature neighborhood twice before and after the main feature direction correction.
The gradient histogram feature description method based on circular neighborhoods is adopted, and the feature neighborhood is evenly divided into multiple annular or fan-shaped areas. The gradient histogram is calculated in each area, and the histogram of the entire feature neighborhood is obtained through weight accumulation. The main direction correction is achieved through displacement or number update.
The calculation complexity is reduced, the calculation efficiency is improved, and the defect of calculating gradient histograms twice before and after the main direction correction is avoided. Compared with the classic SIFT method, it has lower calculation complexity and higher efficiency.
Smart Images

Figure CN114067133B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer vision and digital image, and in particular relates to a gradient histogram feature description method based on circular neighborhood. Background Art
[0002] The local feature description of an image is one of the basic research tasks in the field of computer vision. It plays an important role in finding corresponding points in two or more images and in restoring a three-dimensional scene using two or more images. Specifically, in the application of image stitching and restoring the three-dimensional structure of a scene using two or more two-dimensional images for three-dimensional reconstruction, the basis is to find a reliable set of matching point pairs between two or more images. The computer automatically establishes the corresponding relationship between reliable matching point pairs between images, which usually depends on the local feature descriptors of the image.
[0003] However, the images with matching often have differences in shooting position, angle and illumination, which leads to scale, translation, rotation and illumination changes between image blocks, and even affine changes. One of the key properties of the local feature descriptor of the image is to remain invariant to these changes. The scale invariance of features means that when humans identify the features on an object, no matter how far or near the object is, a certain point on the object can be identified as a feature. The realization of scale invariance is generally achieved by establishing a Gaussian scale space, because the Gaussian kernel has been proven to be a transformation kernel that can achieve scale transformation. Translation and rotation invariance means that when the position and angle of the object change, certain points on the object can still be identified as feature points. In order to achieve the rotation invariance of the feature descriptor, the main direction of the feature is defined, and then the feature description in the main direction can achieve rotation invariance.
[0004] Another key property of local feature descriptors of images is distinguishability. Each feature descriptor is unique and distinguishable from other descriptors. However, the distinguishability and local invariance of feature descriptors are contradictory. A good feature descriptor should strive to find a balance between the two.
[0005] The efficiency of describing local features of images is also one of the focuses of people's attention. A good feature descriptor should not only be distinguishable and locally invariant, but also efficient.
[0006] The existing feature description methods are mainly divided into two categories, one is binary descriptor, and the other is histogram description method based on gradient calculation. Classic binary descriptors include BRISK, BRIEF, LBP and its various variants of LBP, etc. The advantages of binary descriptors are low computational complexity and high computational efficiency, but their disadvantages are slightly weak local invariance. The histogram description method based on gradient calculation mainly includes SIFT, SURF, etc. The most commonly used feature descriptor among the existing feature descriptors is SIFT feature descriptor because it has excellent local invariance and good distinguishability. The SIFT feature description process is divided into two steps: one is to calculate the gradient histogram of all pixels in the feature neighborhood, and the direction with the largest gradient change corresponds to the main direction of the feature; the second is to rotate the coordinate axis of the feature neighborhood to be consistent with the gradient direction, divide the feature neighborhood into blocks and calculate the gradient histogram in the block, and connect the gradient histograms in the block to form a SIFT feature descriptor. The biggest disadvantage of SIFT feature description is the efficiency difference caused by calculating the gradient histogram of the feature neighborhood twice before and after the main direction correction. Summary of the invention
[0007] The purpose of the present invention is to provide a gradient histogram feature description method based on circular neighborhood, which solves the problems of high computational complexity and poor efficiency of existing feature description methods.
[0008] The technical solution adopted by the present invention is a gradient histogram feature description method based on a circular neighborhood, which is specifically implemented according to the following steps:
[0009] Step 1: Read image I, grayscale image I, read feature point set {X, Y}, and select a feature point (x, y) from the feature point set. x∈X,y∈Y , select a circular area with a radius of r in the image I with point (x, y) as the center as the feature neighborhood of the feature point (x, y), denoted as H;
[0010] Step 2: Evenly divide the feature neighborhood H into m regions of the same area;
[0011] Step 3: Calculate a gradient histogram of n columns in each area of the same area, denoted as D i (j), where i∈[1,m],j∈[1,n];
[0012] Step 4: Combine the gradient histograms of m regions of the same area and add them up bit by bit with the weights to obtain the gradient histogram D of the entire feature neighborhood. H (j) The gradient histogram D of the entire feature neighborhood H The column corresponding to the highest peak in (j) is taken as the main direction of the feature, denoted as τ;
[0013] Step 5: Adjust the coordinate axis of the feature neighborhood to be consistent with the main direction of the feature point, connect the histograms of the same area in order, and form the feature descriptor Des of the feature (x, y) with a length of m*n.
[0014] The present invention is also characterized in that:
[0015] The specific process of step 2 is as follows:
[0016] Use m-1 concentric rings to divide the feature neighborhood H into m annular regions of equal area.
[0017] The specific process of step 2 is: divide the feature neighborhood H evenly into m sector-shaped areas of the same area, each sector-shaped area of the same area has an arc of 360 / m degrees, and set a number for each sector-shaped area of the same area in turn, denoted as order(i)=i, i∈[1,2,…,m].
[0018] The specific process of step 3 is as follows:
[0019] Step 3.1, in each region of the same area, divide the gradient direction range of 0 to 360 degrees into n range angles, each range angle corresponds to a column, calculate the gradient direction and gradient amplitude of all pixels in each region of the same area, and determine the column to which the pixel belongs according to the gradient direction;
[0020] Step 3.2: Add up the gradient amplitudes of all pixels in each column to obtain a gradient histogram consisting of n columns, denoted as D i (j), where i∈[1,m],j∈[1,n].
[0021] The specific process of calculating the gradient direction and gradient amplitude of all pixels in each area of the same area in step 3.1 is:
[0022] Taking the position of each pixel in the same area as (s, t), the gradient direction and gradient amplitude of each pixel are expressed as:
[0023]
[0024] In formula (1), μ(s, t) represents the gradient amplitude of each pixel, θ(s, t) represents the gradient direction of each pixel, and L(s, t) represents the grayscale value of each pixel.
[0025] The specific process of step 4 is as follows:
[0026] Step 4.1: Define weight w for each annular region of equal area i , multiply the gradient histogram of each annular area by the weight w i , denoted as D i '=D i ×i ;
[0027] Step 4.2: The gradient histogram D of m annular regions of the same area i '(i∈[1,n]) accumulates to obtain the gradient histogram D of the entire circular neighborhood H H , the size is 1*n;
[0028] Step 4.3: Gradient histogram D of the circular neighborhood H H The column with the largest gradient magnitude corresponds to the main direction τ of the feature neighborhood.
[0029] The specific process of step 4 is as follows:
[0030] Step 4.1: The weight of each sector-shaped area is equal. In the gradient histogram of m sectors-shaped areas with the same area, the amplitudes of m columns corresponding to the same range angle are accumulated to obtain the gradient histogram D of the entire circular neighborhood. H (j);
[0031]
[0032] Step 4.2: The gradient histogram D H The column corresponding to the highest peak in (j) is taken as the main direction of the feature, denoted as τ.
[0033] The specific process of step 5 is as follows:
[0034] Step 5.1: The gradient histogram D of each annular area with the same area i Shift left by τ bits to correct the main direction of the feature, denoted as H i ;
[0035] Step 5.2: The gradient histogram H of m annular regions of the same area i Connect from the inside out to form a feature descriptor D = [H1, H2, ..., H n ], whose length is n*m.
[0036] In step 5, the coordinate axis of the feature neighborhood is adjusted to be consistent with the main direction of the feature point. The specific process is: according to the main direction of the feature, the number of each sector-shaped area with the same area is updated to correct the main direction of the feature. The specific process of updating the number of each sector-shaped area with the same area is:
[0037]
[0038] In formula (3), reorder(i′) represents the updated serial number.
[0039] The beneficial effects of the present invention are:
[0040] The invention discloses a circular neighborhood-based gradient histogram feature description method. Before and after the feature main direction is calculated, the pixels contained in each area of the same area are consistent. Therefore, for the annular gradient histogram, the main direction is corrected by bitwise shifting. For the fan-shaped gradient histogram, the main direction is corrected by updating the number of the fan-shaped area. This avoids the problem of calculating the gradient histogram in the neighborhood twice before and after the main direction of the square neighborhood is corrected. At the same time, the existing square neighborhood-based feature description method has high computational complexity and poor efficiency. Compared with the classic SIFT feature description method, the circular neighborhood-based annular gradient histogram feature description method has low computational complexity and high computational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of dividing the circular neighborhood into annular regions of equal area and calculating the gradient histogram in each annular region of equal area;
[0042] Figure 2 Yes Figure 1 The histogram of the annular area with the same area is multiplied by the weight and then accumulated to obtain a schematic diagram of the main direction of the feature neighborhood;
[0043] Figure 3 is based on Figure 2 Schematic diagram of the main direction obtained by shifting the histogram in the annular region of the same area bit by bit to the left;
[0044] Figure 4 It is a schematic diagram of connecting the histograms of the same area of each annular area from the inside to the outside to form a descriptor;
[0045] Figure 5 This is a comparative diagram of feature description based on square neighborhood and circular neighborhood;
[0046] Figure 6 It is a characteristic description diagram of a gradient histogram of a sector-shaped region of the same area based on a circular neighborhood obtained by the method of the present invention. DETAILED DESCRIPTION
[0047] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] Example 1
[0049] The present invention provides a gradient histogram feature description method based on a circular neighborhood, which is specifically implemented according to the following steps:
[0050] Step 1: Read image I, grayscale image I to obtain grayscale image, read feature set {X, Y}, and take a feature point (x, y) of the feature set. x∈X,y∈Y, with (x, y) as the center, select a circular area with a radius of r pixels as the feature neighborhood of feature (x, y), denoted as H;
[0051] Step 2: Figure 1 As shown, m-1 concentric rings are used to divide the feature neighborhood H into m annular regions of equal area;
[0052] Step 3: In each region of the same area, the gradient direction range of 0 to 360 degrees is divided into n range angles, each range angle corresponds to a column, the gradient direction and gradient amplitude of all pixels in each region of the same area are calculated, and the column to which the pixel belongs is determined according to the gradient direction;
[0053] The specific process of calculating the gradient direction and gradient amplitude of all pixels in each area of the same area is:
[0054] Taking the position of each pixel in the same area as (s, t), the gradient direction and gradient amplitude of each pixel are expressed as:
[0055]
[0056] In formula (1), μ(s, t) represents the gradient amplitude of each pixel, θ(s, t) represents the gradient direction of each pixel, and L(s, t) represents the grayscale value of each pixel.
[0057] The gradient amplitudes of all pixels in each column are accumulated to obtain the gradient histogram consisting of n columns, which is recorded as D i (j), where i∈[1,m],j∈[1,n].
[0058] Step 4: Define weight w for each annular region of the same area i , multiply the gradient histogram of each annular area by the weight w i , denoted as D i '=D i × i ; The gradient histogram D of m annular regions of the same area i '(i∈[1,n]) accumulates to obtain the gradient histogram D of the entire circular neighborhood H H , size is 1*n; gradient histogram D of circular neighborhood H H The column with the largest gradient amplitude corresponds to the main direction τ of the feature neighborhood, such as Figure 3 shown.
[0059] Step 5: The gradient histogram D of each annular area with the same area i Shift left by τ bits to correct the main direction of the feature, denoted as H i ; The gradient histogram H of m annular regions of the same area iConnect from the inside out to form a feature descriptor D = [H1, H2, ..., H n ], whose length is m*n, such as Figure 4 shown.
[0060] The feature points of an image are described by using a gradient histogram feature description method based on a circular neighborhood. The image I(M,N) is read in, where M and N are the resolutions of the image, assuming that the size is 512*512. The feature set {X,Y} is read in, and one feature in the feature set {X,Y} is taken as (x,y). With feature (x,y) as the center, Figure 1 As shown, a circular neighborhood with a radius of 10 is taken. The circular neighborhood with a radius of 10 is then divided into 5 annular regions of the same area, and each annular region of the same area contains the same number of pixels.
[0061] Secondly, a gradient histogram of 18 columns is calculated in each annular area of the same area, denoted as D i(i∈[1,5]) The formula used to calculate the gradient histogram of each pixel in the annular area of the same area is:
[0062]
[0063] Then, the histogram D of the five annular regions with the same area i Multiply by the weight coefficient w i , get D i '=D i × i , where the weight coefficient w i is {0.5, 0.3, 0.1, 0.1, 0.1}. The weighted histogram D i 'Add them up and you get Figure 2 The gradient histogram D of the entire circular neighborhood is shown H , D H The size is 1*18. Take histogram D H The highest column in is taken as the main direction of the feature neighborhood, denoted as τ. Assume that the histogram D H The highest column in is 2, then τ=2.
[0064] Finally, the histogram D of each annular area with the same area i Shift left by two bits to correct the main direction of the feature, and get H i ,like Figure 3 As shown. The moved histograms of each annular area with the same area are connected from the inside to the outside to obtain a 5*18-dimensional feature descriptor D = [H1, H2, ..., H5], as shown Figure 4 shown.
[0065] according to Figure 1It can be seen that the circular neighborhood-based gradient histogram feature description method of the present invention divides the feature neighborhood into multiple annular regions of the same area, and calculates a gradient histogram in each annular region of the same area.
[0066] according to Figure 2 It can be seen that the circular neighborhood-based gradient histogram feature description method of the present invention multiplies the histograms of each annular region of the same area by a weight coefficient, and accumulates them to obtain the gradient histogram of the entire circular neighborhood.
[0067] according to Figure 3 It can be seen that the circular neighborhood-based gradient histogram feature description method of the present invention calculates the main direction of the entire circular neighborhood, and performs a bitwise left shift on the histogram of each annular region of the same area according to the feature main direction.
[0068] according to Figure 4 It can be seen that the circular neighborhood-based gradient histogram feature description method of the present invention connects the left-shifted gradient histograms of each annular region of the same area from the inside to the outside to form a feature descriptor.
[0069] according to Figure 5 It can be seen that the comparison diagram of the feature description method of the gradient histogram based on the circular neighborhood of the present invention and the feature description method based on the square neighborhood shows that the pixels contained in the neighborhood before and after the main direction calculation of the square neighborhood are different, and the pixels contained in the neighborhood before and after the main direction calculation of the circular neighborhood are consistent. Therefore, the feature description based on the circular neighborhood only needs to calculate the gradient in the neighborhood once, which improves the calculation efficiency.
[0070] Example 2
[0071] The present invention provides a gradient histogram feature description method based on a circular neighborhood, which is specifically implemented according to the following steps:
[0072] Step 1: Read image I, grayscale image I, read feature point set {X, Y}, and select a feature point (x, y) from the feature point set. x∈X,y∈Y , select a circular area with a radius of r in the image I with point (x, y) as the center as the feature neighborhood of the feature point (x, y), denoted as H;
[0073] Step 2: Evenly divide the feature neighborhood H into m sector-shaped regions of the same area, each sector-shaped region of the same area has an arc of 360 / m degrees, and set a number for each sector-shaped region of the same area in turn, denoted as order(i)=i, i∈[1,2,…,m].
[0074] Step 3: In each region of the same area, the gradient direction range of 0 to 360 degrees is divided into n range angles, each range angle corresponds to a column, the gradient direction and gradient amplitude of all pixels in each region of the same area are calculated, and the column to which the pixel belongs is determined according to the gradient direction;
[0075] The specific process of calculating the gradient direction and gradient amplitude of all pixels in each area of the same area is as follows:
[0076] Taking the position of each pixel in the same area as (s, t), the gradient direction and gradient amplitude of each pixel are expressed as:
[0077]
[0078] In formula (1), μ(s, t) represents the gradient amplitude of each pixel, θ(s, t) represents the gradient direction of each pixel, and L(s, t) represents the grayscale value of each pixel.
[0079] The gradient amplitudes of all pixels in each column are accumulated to obtain the gradient histogram consisting of n columns, which is recorded as D i (j), where i∈[1,m],j∈[1,n].
[0080] Step 4: The weight of each sector with the same area is equal. In the gradient histogram of the m sectors with the same area, the amplitudes of the m columns corresponding to the same range angle are accumulated to obtain the gradient histogram D of the entire circular neighborhood. H (j);
[0081]
[0082] The gradient histogram D H The column corresponding to the highest peak in (j) is taken as the main direction of the feature, denoted as τ.
[0083] Step 5: Adjust the coordinate axis of the feature neighborhood to be consistent with the main direction of the feature point. The specific process is: update the number of each sector-shaped area with the same area according to the main direction of the feature to correct the main direction of the feature. The specific process of updating the number of each sector-shaped area with the same area is:
[0084]
[0085] In formula (3), reorder(i′) represents the updated serial number.
[0086] And the gradient histograms of m sectors with the same area are connected in sequence according to the number of the sector areas to form a feature descriptor Des of the feature (x, y) with a length of m*n.
[0087] The feature points of an image are described by using a gradient histogram feature description method based on a circular neighborhood. The image I(M,N) is read in, where M and N are the resolutions of the image, assuming that the size is 512*512. The feature set {X,Y} is read in, and one feature in the feature point set {X,Y} is taken as (x,y). With the feature point (x,y) as the center, Figure 6 As shown in part (a) of , a circular neighborhood with a radius of 10 is taken. Then the circular neighborhood with a radius of 10 is divided into 12 sectors with the same area. The arc value of each sector with the same area is 30 degrees. And the 12 sectors with the same area are numbered [1, 2, ..., 12], as shown in Figure 6 shown.
[0088] Secondly, the gradient histograms of 12 columns are calculated in 12 sectors, denoted as D i (j), where i,j∈[1,12], i represents 12 sectors with the same area, and j represents the number of the 12 columns of the gradient histogram. The formula used to calculate the gradient histogram of each pixel in the sector with the same area is:
[0089]
[0090] Then, the gradient histograms of the 12 sectors with the same area are accumulated bit by bit to obtain the gradient histogram D of the entire circular neighborhood. H (j). Then find the gradient histogram D H The column corresponding to the highest peak in (j) is taken as the main direction of the feature. H The calculation formula of (j) is:
[0091]
[0092] Assume that the highest peak of the gradient histogram of the entire circular neighborhood corresponds to the second column, then τ = 2. Update the numbering of each sector with the same area to reorder = [11, 12, 1, ..., 10], such as Figure 6 As shown in part (b) of .
[0093]
[0094] Connect the 12 gradient histograms in the order of the sector area numbers to form the feature descriptor Des of feature (x, y), denoted as [D1, D2, …, D 12 ], the length is 12*12.
[0095] according to Figure 6It can be seen that the circular neighborhood-based gradient histogram feature description method of the present invention divides the feature neighborhood evenly into a plurality of fan-shaped regions of the same area, and calculates a gradient histogram in each fan-shaped region of the same area.
[0096] according to Figure 6 As can be seen from part (b) below, by renumbering the fan-shaped regions with the same area to correct the main direction, the problem of increased computational complexity caused by recalculating the gradient histogram of the feature neighborhood is avoided.
[0097] exist Figure 5 From the comparison, it can be seen that the traditional feature description method based on square neighborhood is mainly divided into two steps: calculating the gradient histogram in the neighborhood to obtain the main direction of the feature; then correcting the main direction of the feature, recalculating the gradient histogram of the feature neighborhood in the main direction, and forming a feature descriptor. The gradient histogram in the neighborhood needs to be calculated twice before and after the main direction correction, which is very time-consuming and labor-intensive. In the gradient histogram feature description method based on circular neighborhood of the present invention, the pixels contained in the circular neighborhood are unchanged before and after the main direction correction, and the pixels contained in each area of the same area are also unchanged, so the gradient histogram in each area of the same area will not change. The present invention corrects the main direction by updating the position of the area of the same area, and only needs to calculate the gradient histogram in the neighborhood once, which greatly improves the calculation efficiency.
Claims
1. A gradient histogram feature description method based on circular neighborhood, characterized in that: Follow the steps below to implement it: Step 1: Read the image I , the image I Grayscale processing, read in feature point set { X , Y }, take a feature point from the feature point set , in the image I Zhong Yi Dot ( x , y ) as the center and select a radius of r The circular area is used as the feature point ( x , y ), denoted as H ; Step 2: Set the feature neighborhood H Divide evenly into m Areas of the same size; Step 3: Calculate one in each area of the same area. n The gradient histogram of the column is recorded as ,in ; Step 4: m The gradient histograms of the same area are combined with the weights and added bit by bit to get the gradient histogram of the entire feature neighborhood , the gradient histogram of the entire feature neighborhood The column corresponding to the highest peak of is taken as the main direction of the feature, denoted as ; Step 5: Adjust the coordinate axis of the feature neighborhood to be consistent with the main direction of the feature point, and connect the histograms of the same area in sequence to form a feature ( x , y ) feature descriptor Des , the length is m*n ; The specific process of step 2 is: use m -1 concentric ring divides the feature neighborhood H Equal m annular regions of equal size; The specific process of step 2 is: The feature neighborhood H Divide evenly into m The arc of each sector-shaped area is 360 / m degrees, and set a number for each sector with the same area in turn, recorded as , i [1,2,…, m ]; The specific process of step 3 is as follows: Step 3.1, in each region of the same area, divide the gradient direction range of 0 to 360 degrees into n range angles, each range angle corresponds to a column, calculate the gradient direction and gradient amplitude of all pixels in each region of the same area, and determine the column to which the pixel belongs according to the gradient direction; Step 3.2: Accumulate the gradient amplitudes of all pixels in each column to obtain a gradient histogram consisting of n columns, denoted as ,in ; The specific process of calculating the gradient direction and gradient amplitude of all pixels in each area of the same area described in step 3.1 is: Take the pixel position in each area of the same area as ( s , t ), then the gradient direction and gradient amplitude of each pixel are expressed as: (1) In formula (1), Represents the gradient magnitude of each pixel, Represents the gradient direction of each pixel, Represents the gray value of each pixel; The specific process of step 4 is as follows: Step 4.1: Define weights for each annular region of equal area w i , multiply the gradient histogram of each annular area by the weight w i , denoted as ; Step 4.2: m The gradient histogram of the same area of the annular region Accumulate and get the entire circular neighborhood H The gradient histogram of D H , the size is 1* n ; Step 4.3: Circular Neighborhood H The gradient histogram of D H The column with the largest gradient magnitude corresponds to the main direction of the feature neighborhood ; The specific process of step 4 is as follows: Step 4.1: The weight of each sector with the same area is equal. m In the gradient histogram of a sector-shaped area with the same area, m The amplitudes of the columns corresponding to the same range of angles are accumulated to obtain the gradient histogram of the entire circular neighborhood. ; (2) Step 4.2: Gradient histogram The column corresponding to the highest peak of is taken as the main direction of the feature, denoted as ; The specific process of step 5 is as follows: Step 5.1: Gradient histogram of each annular area Bitwise left shift To correct the main direction of the feature, denoted as ; Step 5.2: m The gradient histogram of the same area of the annular region Connect from the inside out to form a feature descriptor , whose length is m*n ; The specific process of adjusting the coordinate axis of the feature neighborhood to be consistent with the main direction of the feature point in step 5 is: updating the number of each sector-shaped area with the same area according to the main direction of the feature to correct the main direction of the feature, and updating the number of each sector-shaped area with the same area is as follows: (3) In formula (3), Indicates the updated number.
Citation Information
Patent Citations
Method for registration on remote-sensing image based on improved SIFT feature
CN106558072A