1. the invariant moment method is a classic feature extraction method.
2. Moment-changing is not affected by the rotation and size ratio change, so it can be used for two-dimensional or three-dimensional objects. However, these immutations are not enough to distinguish all shapes, and they are very memorable to noise.
3. However, we can see that the calculation of Hu Moment requires the calculation of the existing Area of the entire image. The calculation is large, which is not conducive to real-time processing.
1. A template is a known small image. template matching is to search for a target in a large image. It is known that the target has the same size as the template, direction, image. A certain algorithm can be used to locate the target in the graph and determine its coordinate position.
(The larger the search image, the slower the matching speed; the smaller the template, the faster the matching speed)
2. Template match: http://hi.baidu.com/liudong861106/blog/item/5d66bb14d99c350c972b43ab.html
Template matching means that the template image is used to compare the similarity with the overlapping areas of the image in sequence by sliding, and the region with the highest similarity is used as the matching target area. In opencv, cvmatchtemplate is used to slide the entire image,
And save the comparison result to result (the mapped image of the comparison result. Single Channel, 32-bit floating point number.) parameter. Then, use the cvminmaxloc function to find the global maximum value and the matching position max_loc represented by the maximum value in the result.
3. The so-called template matching is to find the most similar area of a template image (patch) in an image: http://blog.csdn.net/yang_xian521/article/details/6942194
4. Template image: known images or images in known patterns are called template images. The image to be detected is called a matching image. Image matching is the process of searching for a sub-image that matches the template image on the matching image. In practice,
Such as Rotation Transformation, object occlusion, proportional change, and projection transformation make the template image and matching image rotate and twist, which makes the situation very complicated.
Cvmatchshapse (): Compares Hu moments to determine similarity. This is because Hu Moment has the same feature.
Cvmatchtemplate () template: Two images, one. The template size is 2. Large images have the highest similarity. Comparison of similarity with overlapping areas by means of sliding
Common Features of matching are edge, contour, straight line, point of interest, color, texture, etc. We can match Images Based on these things.
There are many ways to match images. There are two types of matching features:
1. Matching methods based on image gray information: normalized cross-correlation matching, template matching, Fast Fourier algorithm, projection matching, sequential similarity detection matching, mean absolute difference matching, and image immutable moment matching.
2. Image feature-based matching method: This method is used to extract the scaled, rotated, and grayscale features from the original image and the transformed image for matching. In the source image, features commonly used include edge, area, line endpoint, line intersection, and Area Center.
, Curvature discontinuous points, among which edge and region boundary are the most common. They can be obtained by edge detection and region segmentation. In the transform domain, Fourier transformation can be used, discrete Yuxuan transform and power-shift transform divide the image into a set of coefficients to obtain the feature points.
Generally, because feature-based methods do not depend on pixel values directly, they often need complicated image processing to extract features, which is not conducive to hardware implementation.
Cvcalcemd2 (): Land moving distance (EMD) algorithm. Calculate the minimum working distance between two weighted point sets. You can also measure the similarity between two distributions.
Examples of Methods: http://blog.sina.com.cn/s/blog_98eef7830100wxl8.html opencv common function lookup: http://blog.sina.com.cn/s/blog_98eef7830100wxkh.html
Learning opencv: contour matching
1. Moment: the simplest way to compare two outlines is to compare their contour moments. Moment is a rough feature obtained by performing integral or sum operations on all vertices in the contour.
Normalized moment: Objects of different sizes but with the same shape have the same value. The normalized moment is smaller than 1, so the larger the index, the smaller the calculation result.
Cvmatchshapes () allows us to simply provide two objects, then calculate their moments and compare them according to the standards we provide. These objects can be images or outlines. If you provide images, this function calculates the moment for you before the comparison process.
2. Level matching: Profile tree
Once a tree is created, two outlines can be effectively compared. This process starts by defining the correspondence between Two Tree nodes and then comparing the characteristics of the corresponding nodes. The final result is the similarity between the two trees.
Before comparison, we first use the cvapproxpoly () function to sort the outlines into a state where the initial triangle is not affected by rotation.
3. Matchtemplate match