Detailed explanation of SIFT feature matching algorithm for image processing

SIFT feature matching

This paper focuses on the SIFT algorithm in terms of local feature invariant feature points. The SIFT algorithm has relatively good robustness, and at the same time, it can adapt to different scales, different rotation angles and has high matching accuracy. This article mainly introduces each step of the SIFT algorithm.

Four steps of SIFT algorithm

  1. Construct a high-resolution differential pyramid .
  2. Detection of extreme points in the scale space.
  3. Check the candidate extreme points and delete the extreme points that do not meet the requirements.
  4. Determines the orientation of the keypoint.
  5. Generate keypoint descriptors.

`

Step 1: Construct a Gaussian Difference Pyramid

After downsampling the image, the image pyramid is obtained , and different specifications are made for each size of the image pyramid ( σ \sigmaσ different) Gaussian filtering to geta Gaussian pyramid. For convenience here, we call it a group with the same size, and use different σ \sigmain the groupThe σ Gaussian kernel blurring we call it the layer. The difference Gaussianpyramid is obtained by subtracting adjacent layers within each group in the.
According to the empirical value of the author of David Lowe, the number of constructed pyramid groups islog 2 ( min ( M , N ) ) − 3 log_2(min(M,N))-3log2(min(M,N))3 to confirm. Among them, M and N represent the length and width of the original image. The number of layers can be determined byS = n + 3 S=n+3S=n+3 , where n represents the number of pictures for which features are to be extracted. The reason here will be mentioned in the extreme point detection below.

Step 2: Select candidate extreme points

Here, the extreme point is searched in the scale space, which is determined by comparing the size of 26 adjacent points in the space. Here, since the two layers at the edge lack one layer for comparison, two layers are added to the differential pyramid, which is why the number of layers in step 1 is increased by three (2+1).

Step 3: Screen the candidate extreme points

Why filter here? The answer is that these are all discrete points, and the discrete points are sampled by continuous functions. Therefore, the extreme points on the discrete domain are not necessarily extreme points in the true sense, so some screening mechanisms are required To filter out these extreme points that do not meet the requirements.
The main purpose is to remove low-contrast points and unstable edge response points. For low-contrast points, the Taylor ternary second-order expansion at the extreme point can be used to obtain the derivative so that the derivative is equal to zero to solve the original function, and then filter according to the contrast screening conditions. Unstable edge response points can be judged and screened through the Hessian matrix.

Determine the main direction of the key point

Here, the feature point is used as the center of the circle, and the radius of 1.5 times the scale of the image in the Gaussian pyramid is used to make a circle. 1.5 times σ \sigmaAfter σ performs Gaussian filtering (mainly because the weight close to the feature point is large, and the weight far away from the feature point is small), the direction and weight of the gradient in the circle are counted. Determine the main direction according to the weight.
insert image description here

Construct Keypoint Descriptor

First, rotate the coordinate system to the main direction to divide the area.
insert image description here
To divide the region, a total of 16 regions are required, and each region contains 16 sub-regions. After the statistics of the gradient weights of the sub-regions are completed, each region contains an 8-dimensional vector, so the 16 regions constitute a total of 128 dimension vector. Then, the matching is completed according to the principle that the two vectors in the vector space are closest to each other. The matching algorithm can use the k-nearest neighbor algorithm for matching.
insert image description here

Guess you like

Origin blog.csdn.net/qq_45919032/article/details/127945214