Image matching can be used in many occasions, such as target tracking, detection, recognition, image mosaic and so on, and the core technology of corner matching is corner matching. The so-called corner matching refers to finding the corresponding relationship of characteristic pixels between two images, so as to determine the position relationship between the two images.
Corner matching can be divided into the following four steps:
1. detector extraction: find the most recognizable pixels (corners) in the two images to be matched, such as the edge points of objects with rich textures.
2. Extracting descriptors: For the detected corners, some mathematical features are used to describe them, such as gradient histogram and local random binary features. The common extraction methods of detectors and descriptors are sift, harris, surf, fast, agast, brisk, freak, brisk, brief/orb, etc.
3. Matching: the corresponding relationship of each corner in two images is judged by the descriptor of each corner, such as flann.
4. Denoising: Remove the outliers that are not correctly matched and keep the correct matching points. Commonly used methods are KDTREE, BBF, Ransac, GTM, etc.
Secondly, SIFT matching method is proposed.
In order to eliminate the key points that have no matching relationship because of image occlusion and background confusion, Lowe, the author of SIFT, proposed a SIFT matching method to compare the nearest neighbor distance and the next neighbor distance: take a SIFT key point in one image and find the first two key points with the nearest Euclidean distance in another image. Among the two key points, if the ratio of the nearest distance divided by the next nearest distance is less than a certain threshold t, the matching points will be accepted. Because of the high dimension of feature space, there may be many other mismatches at similar distances, so its ratio is relatively high. Obviously, if the proportional threshold t is lowered, the number of SIFT matching points will be reduced, but it will be more stable, and vice versa.
Lowe recommended the threshold of ratio as 0.8, but the author matched a large number of two pictures with arbitrary scale, rotation and brightness change. The results show that the ratio is 0. Four to zero. 6, there are few matching points less than 0. 4, and there are a large number of false matching points greater than 0. 6, so the author suggests that comparative value adopt the following principles:
Ratio =0. 4. Used for high-precision matching;
Ratio =0. 6: Matching points need more matching;
Ratio =0. 5: Generally speaking.
Thirdly, the common SIFT matching codes.
1, vl_ubcmatch.c of the SIFT toolbox in vlfeat are matched by ordinary Euclidean distance (this sift code is contributed by Andrea.
Vidal Di).
2.Lowe's C++ code uses Euclidean distance, but in matlab code, in order to speed up the calculation, the vector included angle is used to approximate Euclidean distance: firstly, the 128-dimensional SIFT feature vector is normalized to a unit vector (each number is divided by the square root of the sum of squares), then the cosine value of the vector included angle is obtained by point multiplication, and finally the vector included angle is obtained by using anti-cosine (acos function). Experiments show that Lowe's method is very correct and time-consuming.
Similarly, knnsearch function can also be used to find the nearest point and the next nearest point: the result obtained by knnsearch using Euclidean distance is almost the same as that obtained by lowe approximation method, which just confirms the effect of simulating Euclidean distance.
3.Rob Hess's OpenSIFT uses KDTREE to optimize matching.
4.CSDN God v_JULY_v has realized the optimization of SIFT matching with KDTREE+BBF, and eliminated the wrong matching: from K nearest neighbor algorithm and distance measurement to KDTREE and SIFT+BBF algorithm.
-The method of structure, the method of algorithm-Blog Channel-CSDN.NET.
5. There are many kinds of SIFT matching realized by features2d in 5.OpenCV: vector descriptor, BF Matcher (brute force descriptor matcher), Ferndescriptor, OnewayDescriptor, FlannBasedMatcher and so on. At present, we only know that knnsearch is used, which provides a variety of ranging methods, but we don't know the specific differences.
1 1, think about it from another angle.
Two Christians, A and B, are addicted to cigarettes while praying. A Christian asked the priest, "Can I smoke wh