A feature point matching-based difference map registration method
By using a difference map registration method based on feature point matching, the problem of mismatch in image registration with large color differences is solved, a more accurate image transformation matrix is generated, and the precision and accuracy of image registration are improved.
Patent Information
- Application Number
- CN202411152637.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Existing technologies suffer from feature point mismatch when registering images with large color differences, resulting in inaccurate transformation matrices.
A difference map registration method based on feature point matching is adopted. Through feature extraction, Euclidean distance calculation, geometric transformation relationship analysis and clustering, an accurate image transformation matrix is generated, erroneous point pairs are eliminated, and the accuracy of the transformation matrix is improved.
It significantly improves the accuracy of image registration, especially under complex conditions such as noise, brightness variations, or geometric deformation, reducing registration errors and improving the accuracy of the transformation matrix.
Smart Images

Figure CN119090926B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image matching, in particular to a difference image registration method based on feature point matching. BACKGROUND
[0002] Image matching refers to corresponding similar or identical contents between two images through certain matching algorithm, and the corresponding relationship is usually represented by image transformation matrix. Commonly used image matching algorithms are mainly divided into gray-based matching and feature-based matching. Gray-based matching measures color difference between two images, and the smaller the difference is, the higher the matching degree is. Feature-based matching extracts features in images first, and then establishes matching corresponding relationship between features of two images. Common feature matching primitives include point, line, region and other salient features.
[0003] For registration of difference images, color information cannot be used in registration because there is a great difference in color between two images, and only texture information or feature point information of images can be used for matching. The industry usually adopts the method of calculating affine transformation by feature point matching. First, feature points are extracted to generate feature descriptors, and then feature point matching is performed to calculate image transformation matrix by least square method. When using feature point matching, there is inevitably a situation of feature point mismatching because of limited information of feature points. The current scheme calculates the transformation matrix with the smallest error under the condition of allowing error matching points. When there are many error matching feature points or the number of feature points used for matching is small, the generated transformation matrix is not accurate enough. SUMMARY
[0004] The purpose of the present application is to design an image registration algorithm that can accurately register images with a great difference in color.
[0005] The technical solution of the present application is to provide a difference image registration method based on feature point matching, which comprises:
[0006] S1. Extracting feature points and descriptors of the first image and the second image using a feature extraction algorithm;
[0007] S2. Calculating the Euclidean distance of the descriptors between the first image and the second image to determine the similarity of the feature points and match the feature point pairs in the two images;
[0008] S3. Analyzing the geometric transformation relationship of the matched point pairs to generate an image transformation matrix;
[0009] S4. Transforming the second image to an image with the same content as the first image by the image transformation matrix.
[0010] In any of the technical solutions above, further, step S3 comprises:
[0011] S31, calculate the scaling ratio S of the first image relative to the content on the second image x and S y , wherein S x is a horizontal scaling value, and S y is a vertical scaling value; according to the known transformation relationship between the two images, there is the following relationship between any two pairs of matched point pairs:
[0012] D1 2 = (X1 i -X1 j ) 2 +(Y1 i -Y1 j ) 2 ;
[0013] D1 2 =S x 2 *(X2 i -X2 j ) 2 +S y 2 *(Y2 i -Y2 j ) 2 ;
[0014] (X1 i , Y1 i ), (X1 j , Y1 j ) are the positions of any two feature points in the first image; (X2 i , Y2 i ), (X2 j , Y2 j ) are the positions of any two feature points in the second image; (X1 i , Y1 i ) and (X2 i , Y2 i ) are a pair of matched feature points, (X1 j , Y1 j ) and (X2 j , Y2 j ) are a pair of matched feature points; D1 is the distance between two feature points (X1 i , Y1 i ) and (X1 j , Y1 j ) in the first image) between the two feature points, the second image is transformed according to the scaling ratio to make the distance between the two feature points equal to Dl, and the fusion of the above two equations is converted into a linear fitting problem of solving the slope k and the intercept b:
[0015]
[0016] The matching feature point pairs in the first image and the second image are calculated according to the following formula to obtain the points (x, y) on the fitting straight line:
[0017]
[0018] The combination of all the two feature point pairs in the first image and the second image constitutes many points on the fitting straight line; the fitting straight line obtains k and b, and thus obtains the scaling ratio S x and S y , and excludes the feature point pairs not on the fitting straight line;
[0019] S32, according to the scaling ratio of the image calculated in step S31, the points (X2 i , Y2 i ) on the second image are scaled and corrected to (X2 i *S x , Y2 i *S y ), (X2 j , Y2 j ) to (X2 j *S x , Y2 j *S y ); according to the corrected points, the rotation angle A of each two feature point pairs is calculated;
[0020] The angle A1 of the straight line starting from (X1 i , Y1 i ) and ending at (X1 j , Y1 j ) in the first image is calculated, and the angle A2 of the straight line starting from (X2 i *S x , Y2 i *S y ) and ending at (X2 j *S x , Y2 j *S y ) is calculated; and thus the angle difference A = A1-A2 of the two lines is calculated;
[0021] Calculate the rotation angle A of all two pairs of feature points in two images, the rotation angle range is (-π, π], calculate the histogram according to a certain step length, the angle corresponding to the highest peak value of the histogram is the rotation angle to be calculated, and the feature point pairs corresponding to the angles outside the peak value are excluded;
[0022] S33, according to the scaling value and the rotation angle calculated in S31 and S32, correct the feature points in the second image to the position (X2 i ′, Y2 i ′):
[0023] X2 i ′=X2 i *S x *cos(A)-Y2 i *S y *sin(A);
[0024] Y2 i ′=X2 i *S x *sin(A)+Y2 i *S y *cos(A);
[0025] Calculate the translation value (T ix , T iy ) of each feature point:
[0026] T ix =X2 i ′-X1 i ;
[0027] T iy =Y2 i ′-Y1 i ;
[0028] The translation value is a two-dimensional vector, which is divided into different clusters by using the clustering method according to the spatial distance, so that the vector distance in the same cluster is as close as possible, and the vector distance between different clusters is as far as possible, that is, the vectors in the same cluster are gathered together, and the vectors between different clusters are separated as far as possible; Then, the average value of the vector group with the most vectors is the translation position (T x , T y ) of the image;
[0029] S34, calculate the image transformation matrix M, the formula is:
[0030]
[0031] In any of the above technical solutions, further, step S2 comprises:
[0032] Let the descriptor of a feature point in the first image be:
[0033] R i = (r i1 , r i2 ,..., r i128 ) ;
[0034] The descriptor of a feature point in the second image is:
[0035] S i = (s i1 , s i2 ,..., s i128 ) ;
[0036] The formula for calculating the Euclidean distance d(R i , S i ) between the two descriptors is:
[0037]
[0038] The Euclidean distance is a measure of feature point matching;
[0039] For each feature point, find the most similar matching point in the other image, for each feature point descriptor R i in the first image, find two descriptors S i and S p in the second image that have the smallest Euclidean distance with R i , and these two points are the preliminary matching points of R i in the second image;
[0040] Screen the matching points through the nearest neighbor ratio test, the specific steps are as follows:
[0041] Calculate the distance ratio of the nearest neighbor matching point and the second nearest neighbor matching point Set a ratio threshold, if the ratio is less than the threshold, the matching point is considered reliable; the lower the ratio, the greater the distance difference between the matching point and the second matching point, and the more reliable the matching result; if the ratio is higher than the threshold, the matching point may be a false match and is removed; in this way, the feature point matching pairs with higher reliability are finally left.
[0042] In any of the technical solutions above, further, step S1 comprises:
[0043] S11, construct a scale space of the image and detect extreme points in the scale space;
[0044] The construction of scale space is usually carried out by using a Gaussian pyramid, and the image is smoothed at different scales to generate a series of images with different resolutions. After each layer of image is subjected to Gaussian blur processing, the size is reduced to form a pyramid structure. The expression of the Gaussian pyramid scale space L(x, y, σ) is:
[0045] L(x, y, σ) = G(x, y, σ) * I(x, y);
[0046] wherein G(x, y, σ) is a scale-variable Gaussian kernel function, I(x, y) is an original image, and σ represents a scale size;
[0047] On the generated Gaussian pyramid, difference operation is performed on the Gaussian blurred images of adjacent scales to obtain a Gaussian difference image (DoG), forming a Gaussian difference pyramid. The DoG can be approximated as a Laplacian operator in the scale space, which is used to detect extreme points in the image.
[0048] In each layer of the Gaussian difference pyramid, each pixel point is compared with its 26-neighborhood pixels in the scale space and the two-dimensional image space. If the point is the maximum or minimum value in all these neighborhoods, it is considered as a potential feature point.
[0049] S12, after detecting the potential feature points, further positioning them is carried out;
[0050] This step includes eliminating unstable feature points and determining the sub-pixel level position of each feature point, and the specific method is as follows:
[0051] Through Taylor series expansion, the extreme point is interpolated and fitted at the sub-pixel level to obtain a more accurate position, which significantly improves the positioning accuracy of the feature point.
[0052] For extreme points with low contrast, they are easily disturbed by noise, so they need to be removed. By comparing the contrast threshold of the feature points, those unstable key points are removed.
[0053] The principal curvatures of the DoG function are large at the edges, which are easy to generate unstable feature points. The ratio of the principal curvatures is used to screen the key points, and those low-stability feature points across the edges are removed.
[0054] S13, a direction is assigned to each key point, so that the extracted feature points have rotational invariance.
[0055] In the neighborhood of the feature point, the gradient amplitude and direction of each pixel point are calculated, and the gradient direction histogram in the neighborhood of the feature point is counted. The horizontal axis of the gradient direction histogram is the gradient direction, and the vertical axis is the cumulative value of the gradient amplitude.
[0056] The gradient direction histogram is divided into 36 10-degree intervals, and the peak value of the histogram is the main direction of the feature point; if there are multiple peak values, multiple directions can be assigned to the feature point to enhance the robustness of the algorithm;
[0057] S14, after determining the position, size and direction of the feature point, a descriptor is finally generated for each feature point, and the descriptor is used to represent the local image information of the feature point, so that it has stable matching performance in different images;
[0058] According to the main direction of the feature point, the coordinate axes of the neighborhood of the feature point are rotated, so that the descriptor has rotation invariance; the neighborhood of the feature point is divided into 4*4 grids, and the gradient histograms of 8 directions are calculated in each grid to form a 128-dimensional feature vector, that is, a 128-dimensional descriptor.
[0059] The beneficial effects of the present application are:
[0060] The technical solution in the present application can significantly improve the accuracy of image registration, especially in the presence of noise, brightness change or geometric deformation and other complex conditions, and performs particularly superiorly; compared with the prior art, the present application effectively removes the mismatched feature point pairs, reduces the registration error, improves the accuracy of the transformation matrix, and greatly improves the registration effect. BRIEF DESCRIPTION OF DRAWINGS
[0061] The advantages of the above and additional aspects of the present application will become apparent and easily understood in connection with the following description of embodiments, in conjunction with the accompanying drawings, in which:
[0062] Figure 1 is a flowchart of a feature point matching-based difference map registration method according to an embodiment of the present application;
[0063] Figure 2 is a schematic diagram of a matching feature point pair of a feature point matching-based difference map registration method according to an embodiment of the present application;
[0064] Figure 3 is a histogram of key point direction assignment of a feature point matching-based difference map registration method according to an embodiment of the present application;
[0065] Figure 4 is a histogram of block-in gradient calculation of a feature point matching-based difference map registration method according to an embodiment of the present application;
[0066] Figure 5 is a raw image of an embodiment of a feature point matching-based difference map registration method according to an embodiment of the present application;
[0067] Figure 6is a feature point matching-based difference map registration method according to an embodiment of the present application Figure 5 Unscreened feature point pair matching result
[0068] Figure 7 is a feature point matching-based difference map registration method according to an embodiment of the present application Figure 5 Image alignment effect using unscreened feature point pairs
[0069] Figure 8 is a feature point matching-based difference map registration method according to an embodiment of the present application Figure 5 Image alignment effect using screened feature point pairs
[0070] Figure 9 is a feature point matching-based difference map registration method according to an embodiment of the present application Figure 5 Screened feature point pair matching result
[0071] Figure 10 is a feature point matching-based difference map registration method according to another embodiment of the present application
[0072] Figure 11 is a feature point matching-based difference map registration method according to an embodiment of the present application Figure 10 Feature point pair matching result before and after screening
[0073] Figure 12 is a feature point matching-based difference map registration method according to an embodiment of the present application Figure 10 Image alignment effect using feature point pairs before and after screening DETAILED DESCRIPTION
[0074] In order to enable a more complete understanding of the above-mentioned objects, features and advantages of the present application, the present application will be described in further detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0075] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application, but the present application can also be implemented in other ways different from those described herein, and therefore, the scope of protection of the present application is not limited by the specific embodiments disclosed below.
[0076] As shown in the Figure 1 The present embodiment provides a feature point matching-based difference map registration method, which comprises:
[0077] S1, using a SIFT algorithm to extract feature points of two images.
[0078] The SIFT algorithm is also called scale-invariant feature transform algorithm, and feature extraction is completed through the following steps:
[0079] S11, construct a scale space of the image, and detect extreme points in the scale space.
[0080] The construction of the scale space is usually carried out by using a Gaussian pyramid, and the image is smoothed at different scales to generate a series of images with different resolutions. After each layer of image is subjected to Gaussian blur processing, the size is reduced to form a pyramid structure. The expression of the Gaussian pyramid scale space L(x, y, σ) is:
[0081] L(x, y, σ) = G(x, y, σ) * I(x, y);
[0082] Wherein, G(x, y, σ) is a scale-variable Gaussian kernel function, I(x, y) is the original image, and σ represents the scale size.
[0083] On the generated Gaussian pyramid, difference operation is performed on the Gaussian blurred images of adjacent scales to obtain a Gaussian difference image (DoG), forming a Gaussian difference pyramid. DoG can be approximated as a Laplacian operator in the scale space, which is used to detect extreme points in the image.
[0084] In each layer of image of the Gaussian difference pyramid, each pixel point is compared with its 26-neighborhood pixels in the scale space and the two-dimensional image space; if the point is the maximum or minimum value in all these neighborhoods, it is considered as a potential feature point.
[0085] S12, after detecting the potential feature points, further positioning is carried out.
[0086] This step includes eliminating unstable feature points and determining the sub-pixel level position of each feature point, and the specific method is as follows:
[0087] Through Taylor series expansion, the extreme point is interpolated and fitted at the sub-pixel level to obtain a more accurate position, which significantly improves the positioning accuracy of the feature point.
[0088] For extreme points with low contrast, they are easily disturbed by noise, so they need to be removed; by comparing the contrast threshold of the feature points, those unstable key points are removed.
[0089] The principal curvatures of the DoG function at the edge are large, which is easy to generate unstable feature points; the ratio of the principal curvatures is used to screen the key points, and those low-stability feature points across the edge are removed.
[0090] S13, assign a direction to each key point, so that the extracted feature points have rotational invariance.
[0091] In the neighborhood of the feature point, the gradient amplitude and direction of each pixel point are calculated, as shown in the following formula: Figure 3 The gradient direction in the neighborhood of the feature point is counted into a histogram, the horizontal axis of the gradient direction histogram is the gradient direction, and the vertical axis is the cumulative value of the gradient amplitude.
[0092] The gradient direction histogram is divided into 36 intervals (10° per interval), and the peak value of the histogram is the main direction of the feature point. If there are multiple peak values, multiple directions can be assigned to the feature point to enhance the robustness of the algorithm.
[0093] S14, after determining the position, scale and direction of the feature point, a descriptor is finally generated for each feature point, which is used to represent the local image information of the feature point and has stable matching performance in different images.
[0094] According to the main direction of the feature point, the coordinate axes of its neighborhood are rotated to make the descriptor have rotation invariance; as shown in the following formula: Figure 4 The neighborhood of the feature point is divided into a 4x4 grid, and the gradient histogram of 8 directions is calculated in each grid to form a 128-dimensional SIFT feature vector, i.e. a 128-dimensional descriptor.
[0095] In order to reduce the influence of light changes, the generated descriptor vector is normalized. The final descriptor has invariance and can match the same feature points in different images.
[0096] S2, the Euclidean distance of the SIFT descriptor between the two images is calculated to judge the similarity of the feature points and match the feature point pairs in the two images.
[0097] Let the descriptor of a feature point in the first image be:
[0098] R i =(r i1 ,r i2 ,…,r i128 );
[0099] The descriptor of a feature point in the second image is:
[0100] S i =(s i1 ,s i2 ,…,s i128 );
[0101] The Euclidean distance d(R i ,S i ) between the two descriptors is calculated by the following formula:
[0102]
[0103] The smaller the Euclidean distance is, the more similar the two feature points are in the descriptor space. Therefore, this distance can be used as a measure of feature point matching.
[0104] For each feature point, find the most similar matching point in the other image, for each feature point in the first image, describe the descriptor R i , find the two descriptors S i in the second image with the smallest Euclidean distance p , these two points are the preliminary matching points of R i in the second image.
[0105] In order to reduce the false matching, the matching points are screened by the nearest neighbor ratio test, the specific steps are as follows:
[0106] Calculate the distance ratio of the nearest neighbor matching point and the second nearest neighbor matching point Set a ratio threshold, if the ratio is less than the threshold, the matching point is considered to be reliable; the lower the ratio is, the greater the distance difference between the matching point and the second matching point is, and the matching result is more reliable; if the ratio is higher than the threshold, the matching point may be a false match and should be removed. In this way, the final remaining feature point matching pairs are of high reliability.
[0107] In the preliminary matching pairs, there may still be a small amount of false matching points, therefore, before applying the final matching point pairs, it is necessary to further verify the global consistency of these matching point pairs under geometric transformation: use the matching point pairs to fit a global geometric transformation model, such as affine transformation or perspective transformation model. Use algorithms such as RANSAC (Random Sample Consensus) to process; check whether the matching pairs meet the fitted transformation model, remove the matching pairs that do not meet the geometric consistency, to further improve the accuracy of matching; after the above steps, the final remaining feature point pairs are the matching point pairs between the two images. These matching point pairs can be used for further image registration or other subsequent processing operations.
[0108] S3, generating an image transformation matrix using the improved algorithm.
[0109] As shown in Figure 2 , (X1 i , Y1 i ), (X1 j , Y1 j ) are the positions of any two feature points in the first image; (X2 i , Y2 i ), (X2 j , Y2 j ) are the positions of any two feature points in the second image; (X1 iY1 i ) and (X2 i , Y2 i ) are a pair of matched feature points. j Y1 j ) and (X2 j , Y2 j ) are a pair of matched feature points.
[0110] S31, calculating the scaling ratio S of the first image relative to the content on the second image x and S y , wherein S x is the horizontal scaling value, and S y is the vertical scaling value. According to the known transformation relationship between the two images, there is the following relationship between any two pairs of matched points:
[0111] D1 2 = (X1 i - X1 j ) 2 + (Y1 i - Y1 j ) 2 ;
[0112] D1 2 = S x 2 *(X2 i - x2 j ) 2 + S y 2 *(Y2 i - Y2 j ) 2 ;
[0113] D1 is the distance between two feature points in the first image, the distance between the feature points (X1 i , Y1 i ) and (X1 j , Y1 j ), and the distance between two feature points in the second image is equal to D1 after the feature points are transformed according to the scaling ratio. The fusion of the above two formulas is converted into a linear fitting problem of solving the slope k and the intercept b:
[0114]
[0115] Two pairs of matched feature points in the first image and the second image are calculated as points (x, y) on the fitting straight line according to the following formula:
[0116]
[0117] The combination of all the two feature point pairs on the first image and the second image constitutes points on a fitting straight line. The fitting straight line obtains k and b, and thus obtains the scaling ratio S x and S y , and excludes those feature point pairs not on the fitting straight line.
[0118] S32, according to the scaling ratio of the image calculated in step S31, the points (X2 i , Y2 i ) on the second image are scaled and corrected to become (X2 i *S x , Y2 i *S y ), (X2 j , Y2 j ) become (X2 j *S x , Y2 j *S y ). According to the corrected points, the rotation angle A of each two feature point pairs is calculated.
[0119] The angle A1 of the straight line starting from (X1 i , Y1 i ) and ending at (X1 j , Y1 j ) is calculated in the first image, and the angle A2 of the straight line starting from (X2 i *S x , Y2 i *S y ) and ending at (X2 j *S x , Y2 j *S y ) is calculated; thus the angle difference A=A1-A2 of the two lines is calculated.
[0120] The rotation angles A of all the two feature point pairs in the two images are calculated, the rotation angle range is (-π, π], the histogram is calculated according to a certain step length according to all the rotation angles, the angle corresponding to the highest peak value of the histogram is the rotation angle to be calculated, and the feature point pairs corresponding to the angles outside the peak value are excluded.
[0121] S33, according to the scaling value and the rotation angle calculated in S31 and S32, the feature points in the second image are corrected to positions (X2 i ′, Y2 i ′):
[0122] X2 i ′=X2 i *S x *cos(A)-Y2 i *Sy *sin(A);
[0123] Y2 i ′=X2 i *S x *sin(A)+Y2 i *S y *cos(A);
[0124] Calculate the translation value (T ix , T iy ) of each feature point:
[0125] T ix =X2 i ′-X1 i ;
[0126] T iy =Y2 i ′-Y1 i ;
[0127] The translation values are two-dimensional vectors, and the feature points are divided into different clusters by using the clustering method according to the spatial distance, so that the vector distance in the same cluster is as close as possible, and the vector distance between different clusters is as far as possible, that is, the vectors in the same cluster are gathered together, and the vectors between different clusters are separated as much as possible; then the average value of the group of vectors with the most number of vectors is the translation position (T x , T y ) of the image.
[0128] S34, calculate the image transformation matrix M, the formula is:
[0129]
[0130] S4, transform the second image to the image aligned with the content of the first image through the image transformation matrix.
[0131] In another embodiment of the application, two images are selected for matching to show the matching effect:
[0132] As shown in Figure 5 , the two selected images are shown, the left side is the first image, and the right side is the second image, as shown in Figure 6 , the feature points with higher matching degrees in the two images are taken, the endpoints of each line segment are the feature points matched in the two images, which are called feature point pairs.
[0133] Figure 6The eight feature point positions are marked by the middle red boxes, and the feature points in the red boxes with the same label are a matched pair; it can be seen that the four pairs of feature points are false matches although the matching degree meets the requirement, if an image transformation matrix is generated using the feature point pairs containing false matches, and the second image is geometrically transformed according to the transformation matrix, the second image cannot be aligned with the first image, Figure 7 , Figure 7 , Figure 7 , Figure 5 , ,
[0134] According to the algorithm in the present application, the transformation matrix is calculated after the false matched feature point pairs are removed according to the known conditions of image transformation, and then Figure 5 , Figure 5 , Figure 8 , Figure 7 , ,
[0135] , Figure 9 , Figure 6 , Figure 6 , ,
[0136] , Figure 10 , Figure 11 , Figure 12 , ,
[0137] , ,
[0138] , ,
[0139] , ,
[0140] , ,
[0141] , ,
[0142] The steps in the present application can be adjusted in sequence, combined and deleted according to actual requirements.
[0143] The units in the device of the present application can be combined, divided and deleted according to actual requirements.
[0144] Although the present application has been disclosed in detail with reference to the accompanying drawings, it is understood that these descriptions are merely exemplary and are not intended to limit the application of the present application. The scope of protection of the present application is defined by the appended claims, and can include various modifications, improvements and equivalent solutions made to the application without departing from the scope and spirit of the present application.
Claims
1. A method for registering a difference map based on feature point matching, characterized by, The method comprises: S1, using a feature extraction algorithm to extract feature points and descriptors of the first and second images; S2, calculating the Euclidean distance of the descriptors between the first and second images to determine the similarity of the feature points and match the feature point pairs in the two images; S3, analyzing the geometric transformation relationship of the matched point pairs to generate an image transformation matrix; S4, transforming the second image to an image aligned with the content of the first image through the image transformation matrix; The step S3 comprises: S31, calculating a scaling ratio of the first image relative to the content on the second image and wherein is a horizontal scaling value, is a vertical scaling value; according to a known transformation relationship between the two images, the following relationship exists between any two pairs of matched points: ; ; 、 are positions of any two feature points in the first image; 、 are positions of any two feature points in the second image; and are a pair of matched feature points, and are a pair of matched feature points; is the distance between two feature points and in the first image, and is the distance between two feature points in the second image after scaling the feature points, and the fusion of the above two equations is transformed into a linear fitting problem of solving the slope and the intercept ; The matched feature point pairs of two of the first image and the second image are calculated on the fitting straight line according to the following formula : ; The combination of all two feature point pairs on the first image and the second image constitutes points on a fitting straight line; the fitting straight line is obtained and , so as to obtain a scaling ratio and , and to exclude feature point pairs not on the fitting straight line; S32, the points on the second image are scaled according to the scaling ratio of the image calculated in step S31 The scaling correction is made to become , The scaling correction is made to become The rotation angle of each pair of feature points is calculated according to the corrected points ; the angle of a straight line calculated in the first image with as a starting point and with as an end point , the angle of a straight line calculated with as a starting point and with as an end point ; thus calculating the angle difference of the two lines ; Calculate the rotation angle of all two pairs of feature points in two images , the rotation angle range is , calculate the histogram of all rotation angles according to a certain step, the angle corresponding to the highest peak value of the histogram is the rotation angle to be calculated, and the feature point pairs corresponding to the angles outside the peak value are excluded; S33, rectify the feature points in the second image to positions : ; ; calculating a translation value for each feature point : ; ; The translation values of these two-dimensional vectors are clustered according to spatial distance, and the feature points are divided into different clusters by using a clustering method, so that the vector distance within the same cluster is as close as possible, and the vector distance between different clusters is as far as possible, that is, the vectors within the same cluster are gathered together, and the vectors between different clusters are separated as much as possible; then the average value of the group of vectors with the most number of vectors is the translation position of the image ; S34, computing the image transformation matrix with the formula: 。 2. The feature point matching based difference map registration method of claim 1, wherein, The step S2 comprises: Let the descriptor of a feature point in the first image be: ; The descriptor of a feature point in the second image is: ; Euclidean distance between two descriptors The formula is: ; The Euclidean distance is a measure of feature point matching; finding the most similar matching point in the other image for each feature point, for each feature point in the first image, a descriptor finding in the second image the two descriptors with the smallest Euclidean distance to it and these two descriptors are the preliminary matching points in the second image; The matched points are filtered through a nearest neighbor ratio test, and the specific steps are as follows: Computing a distance ratio of the nearest neighbor match point to the second nearest neighbor match point A ratio threshold is set, and if the ratio is less than the threshold, the match point is considered reliable; the lower the ratio, the greater the difference in distance between the match point and the second match point, and the more reliable the match; if the ratio is higher than the threshold, the match point is likely a false match and is removed; in this way, the final feature point match pairs with higher reliability are left.
3. The feature point matching based difference map registration method of claim 1, wherein, The step S1 comprises: S11, constructing a scale space of the image and detecting extreme points in the scale space; The construction of the scale space is usually carried out by using a Gaussian pyramid, and the image is smoothed at different scales to generate a series of images with different resolutions, and each layer of image is processed by Gaussian blur, Downsizing forms a pyramid structure, Gaussian pyramid scale space The expression is: ; wherein, is a scale-variant Gaussian kernel function, is the original image, denotes a scale size; On the generated Gaussian pyramid, difference operation is performed on the Gaussian blurred images of adjacent scales to obtain Gaussian difference images DoG, forming a Gaussian difference pyramid; DoG is approximately a Laplacian operator in the scale space, which is used to detect extreme points in the image; In each layer of the Gaussian difference pyramid, each pixel point is compared with its 26-neighborhood pixels in the scale space and two-dimensional image space; if the point is the maximum or minimum value in all these neighborhoods, it is considered as a potential feature point; S12, after detecting the potential feature points, further positioning them; This step includes eliminating unstable feature points and determining the sub-pixel level position of each feature point, and the specific method is as follows: Through Taylor series expansion, the extreme point is interpolated and fitted at the sub-pixel level to obtain a more accurate position, which significantly improves the positioning accuracy of the feature point; For extreme points with low contrast, they are easily disturbed by noise, so they need to be removed; by comparing the contrast threshold of the feature points, those unstable key points are removed; The principal curvatures of the DoG function are large at the edges, which are easy to generate unstable feature points; the key points are screened by using the ratio of the principal curvatures to remove those low-stability feature points across the edges; S13, assigning a direction to each key point to make the extracted feature points have rotational invariance; In the neighborhood of the feature point, the gradient amplitude and direction of each pixel point are calculated, and the gradient direction histogram in the neighborhood of the feature point is counted, and the horizontal axis of the gradient direction histogram is the gradient direction and the vertical axis is the cumulative value of the gradient amplitude; The gradient direction histogram is divided into 36 intervals of 10°, and the peak value of the histogram is the main direction of the feature point; if there are multiple peak values, multiple directions are assigned to the feature point to enhance the robustness of the algorithm; S14, after determining the position, scale and direction of the feature point, a descriptor is finally generated for each feature point, which represents the local image information of the feature point and makes it have stable matching performance in different images; According to the main direction of the feature point, the coordinate axis of the neighborhood of the feature point is rotated, so that the descriptor has rotation invariance; the neighborhood of the feature point is divided into 4*4 grids, and the gradient histogram of 8 directions in each grid is calculated to form a 128-dimensional feature vector, i.e. a 128-dimensional descriptor.
Citation Information
Patent Citations
Multi-source remote sensing image registration method based on improved PIIFD feature description
CN117115214A