[Shape Matching Algorithm] Research on Shapecontext Shape Context Algorithm

Shape contexts are feature descriptors for object recognition. Serge Belongie and Jitendra Malik coined the term in their 2000 paper "Matching Shape Contexts"

The Shapecontext algorithm is to count the context information of each point in the two point sets, and compare whether the context information between each point in the two point sets is similar, and get a most approximate set of arrangements, then you can find each point in the first point set. A point corresponds to a point in the second set of points. This is the general framework of the shapecontext algorithm.

The shapecontext algorithm is divided into three steps:

  1. Calculate the context information of each point in the two-point set (when calculating SC for an image, you need to extract the inner and outer contours of the image first)
  2. Calculate the cost value between every two points of the two point sets, that is, the cost value
  3. Use the Hungarian algorithm to count the corresponding relationship of a set of point sets with the lowest overall cost value

1. Computing context information

Draw a concentric circle with each point as the center point. We set the concentric circle to have 5 layers, and divide the circle into 12 partitions, so that there are 5 * 12 = 60 grids, and then count other points in these 60 grids distribution in . In this way, an array of length 60 can be used to count the distribution of other points around the current point.
contextual information for each point
In the above figure (a) and (b) are two letters A with different fonts respectively, (c) is a grid diagram based on the rhombus stippling in (a) . (d) and (e) are the histogram data of diamond points and square points, respectively. It can be seen that their point set distributions are relatively similar, while (f) , the histogram of the points represented by triangles, is very different from the other two. It can be seen that the two points (d) and (e) can be said to be the same point in structure.

2. Calculate the cost value between every two points

When calculating the cost value between each two points, the shapecontext algorithm uses the X2 test statistic (the chi-square test statistic, the degree of deviation between the actual observed value of the statistical sample and the theoretically inferred value) , the formula is:
Chi-square test statistic formula
The cost value of every two points between the two point sets can be calculated, and k refers to the kth grid. g and h respectively represent a point in the two point sets.

Regarding the calculation of the cost value, Wikipedia introduces another kind of additional cost based on appearance that is more useful in digit recognition
extra cost

By weighting, combining these two cost functions, can be obtained
write picture description here
as the true cost equation.

3. Use the Hungarian algorithm to find the corresponding point

Just now we calculated the cost value between each two points. In fact, we have obtained an overall value for reference, but with such a huge amount of data, it is very difficult to select the point corresponding to each point. Troublesome things, so here the shapecontext algorithm uses the Hungarian algorithm, and the time complexity of the Hungarian algorithm is O(N^3).
Hungarian algorithm

Although there are more efficient algorithms. In order to have robust handling of outliers, one can add constant but considerable cost "dumb" nodes with matching cost matrices. This will cause the matching algorithm to match outliers as "dummy" if there is no real match.

The corresponding point relationship has been obtained here, and the process of model transformation is not described here. Next, Shapecontext will transform the point set to the point set through the transformation matrix. After several iterations of transformation, a shape distance is calculated:
shape distance
this is the symmetric sum of the shape context matching costs at the best matching point

Summarize

Shapecontext has great advantages . It uses the context information of points to a large extent in the process of matching point sets, which is very helpful information for finding corresponding points. And it is very robust to non-rigid matching. It does not consider the coordinate position of the point set and is not a coordinate-dependent matching algorithm.

However, shapecontext also has its shortcomings . It has too high requirements for the number of points in the point set. It requires that the number of points in the matching point set must be higher than the number of points in the fixed point set, and if the feature points of some parts of the fixed point set are less than the corresponding parts The feature points of the matching point set of , and the corresponding point matching error occurs in that part.

Learning materials:
Matlab code address:
Shapecontext Matlab version code address
Paper address:
Shapecontext paper address
Reference:
https://en.wikipedia.org/wiki/Shape_context
http://blog.csdn.net/aivin24/article/details/8846293 ?reload

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324968419&siteId=291194637