Master the matching measure of image feature descriptor (distance ratio)

Match according to SIFT: descriptors of A and B images are generated, and descriptors of each scale in the two images (all once) are matched, and 128 dimensions are matched to represent the two feature points Match. The matching strategy can use the Euclidean distance of feature vector to measure the similarity of key points in two images. Take a key point in image 1 and find the first two key points closest to Figure 2. In these two key points, if the nearest distance divided by the next closest distance is less than a certain proportion threshold, the pair of matching points are received. If the ratio threshold is reduced, the number of SIFT matching points will be reduced but more stable.

1. Distance measurement

Euclidean distance

Hamming distance

2 Matching Policy

Nearest neighbor search nearest neighbor distance ratio

SIFT feature extraction and robust matching are completed

The experimental images

Feature extraction

Robust matching

Image viewpoint transformation and Mosaic based on homography matrix are completed. The method of image fusion is discussed

Image stitching simply has the following steps:

1. Extract feature points from each image

2. Match the feature points

3. Perform image registration

It is necessary to find the transformation matrix that splices two images together based on the matching points.

This transformation is called a homography matrix. In short, if Homography is a 3×3 matrix, it can be used for many applications, such as camera attitude estimation, perspective correction and image Mosaic. If Homography is a 2D transform. It maps points from one plane (image) to another.

SIFT algorithm, in fact, the real matching results will not be particularly good, once the change in perspective is relatively large or there is no area in the image before, it is easy to produce false matching. However, in practical application, these mismatched points do not have a great impact on the final matching result, because the operation of removing mismatched point pairs is generally carried out after the matching. RANSAC is an iterative algorithm suitable for linear model.

RANSAC (Random Sample Consensus) algorithm is a simple and effective method to remove the influence of noise and estimate models. Different from common denoising algorithms, RANSAC algorithm uses as few points as possible to estimate model parameters, and then expands the influence range of model parameters as much as possible.

Four pairs of matching points are randomly selected (because at least 4 points are needed to solve the single response), the data are normalized (such normalization operation should make the center of the point set at the origin, and the average distance from the origin is), and then the results obtained from these normalized matching points are solved, and then the inverse solution H is obtained. Then comes the standard RANSAC process, which is roughly as follows: Given a set P composed of N data points, assuming that most points in the set can be generated through a model, and at least N points (N <N) can be used to fit the parameters of the model, then the following iterative method can be used to fit the parameters.

Do the following k times:

(1) Randomly select N data points from P;

(2) Use the N data points to fit a model M;

(3) For the remaining data points in P, the distance between each point and model M is calculated. If the distance exceeds the threshold, it is identified as an external point, and if the distance does not exceed the threshold, it is identified as an internal point, and the value M of the internal point corresponding to model M is recorded.

After k iterations, the model M with the largest m was selected as the fitting result.

Because the value of N is usually large in practical applications, the combination of any N data points will be large. If the above operation is performed on all combinations, the computation will be large, so the choice of K is very important. In general, the probability that all n points required by the model estimate are points is high enough. Therefore, let w be the ratio of intra-office points in N data, and z be the probability that N points selected at least once are intra-office points after k selection. Then z=1−(1−w n) k

1− WN indicates the probability that all the selected points are not intra-office points (1− WN). K indicates the probability that all the selected points are intra-office points.

Then, k=log(1−z)log(1−wn) gets the most interior points, and then uses these interior points again

4. Copy the image to a specific location in another image

5. The fusion image is processed with special overlapped boundary