Surf Analysis algorithm

Source: Internet
Author: User

Surf Analysis algorithm

One, the overall image
This concept is integral to image Viola and Jones recommendations. Random bit integral image (I. j) The value of the original image of the upper left Random point (i,j) level with the corresponding focus field value of the sum of its mathematical equation 1 is seen:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

So, when we want to calculate the integral of an area of a picture, we just need to calculate the value of the four vertices in this area in the integral image, which can be calculated by 2-step addition and 2-step subtraction. Its mathematical formula is as follows:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

Second, Hession matrix detector
1. Spot detection
Spot: An area that differs from the color and grayscale surrounding.


In a one-dimensional signal, let it be convolution with the Gauss derivative. That is the Laplace transform, there will be 0 points at the edge of the signal. For example, as seen in:


The response value of the Laplace log detector is to measure the similarity of the image. For example, it is a three-dimensional and gray-scale display of the Laplace transform of an image. The speckle size and Laplace function in the image
When the shape tends to coincide, the Laplace response of the image reaches the maximum.


The Hession matrix is a speckle detection using second-order differentiation, with matrices such as the following:


2. Hession Matrix and box filter

The Hession matrix in the image is as follows:


Their three-dimensional graphs and grayscale graphs are seen in the following examples:


Resulting We transform the template (the area in the image) and the convolution operation of the image into the operation of the box filter, for example, as seen in:


3. Simplification of hession Matrix determinant

When we use Sigma = 1.2. Gauss differential filtering, the template size is 9x9 the smallest scale spatial value of the image filtering and speckle detection, hession matrix determinant can do such as the following simplification:



Constant C does not affect the comparison of extreme points, so finally the simplified formula, such as the following, which is also the source of hession response values in surf paper:


In addition, the response value is normalized according to the filter size. To ensure that the F-norm of the arbitrary size filter is uniform.

The 0.9^2 is the relative weight of the filter response w is to balance the expression of the Hessian determinant. This is to maintain consistency between the Gaussian nucleus and the approximate Gaussian nucleus.

In theory, for different σ values and the corresponding size of the template size. The W value is different, but for the sake of simplification, it can be thought of as the same constant. use an approximate Hessian matrix determinant to represent the BLOB response value at a point x in the image. Traversing all the cell points in the image, the response image is formed at a certain scale to detect the glass spot. Using a different template size,

The pyramid image of multi-scale speckle response is formed, which can be used to search the extreme point of speckle response.

Third, 3D non-maximal value suppression

1. Scale pyramid Structure

In the surf. The Hession matrix response is obtained by increasing the size of box filter template and integrating image. Then the 3D non-maximal value is suppressed on the response image. Find a variety of different scales

Spots, here are two different pyramids, the surf pyramid belongs to another:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

A filter with 9x9 size is used as the starting filter in surf. The subsequent filter size can be calculated from the following formula:


Octave and interval in the formula start from 1. That is, when No. 0 group No. 0 layer, in the formula Octave = 1, interval = 1.

The reasons for defining the filter size in this way are as follows;


Filter response length, filter size, group index O, layer index s

The relationship between scale Sigma is as follows:


A similar approach is used to deal with several other sets of template sequences. The method is to double the filter size (6,12. 24. 38). Such The second set of filter sizes can be obtained. They are 15 respectively. 27,39,51. The filter size of the third group is 27, 51. 75,99. Assuming that the original image size is still larger than the corresponding filter size, the analysis of the scale space can be carried out in the fourth group, the corresponding template size is 51. 99,147,195. Shows the change in the filter size for the first group to the third group:


In the case of normal scale analysis, as the scale increases. The number of spots detected is rapidly decaying. Therefore, the general 3-4 groups will be able to. At the same time, in order to reduce the amount of computation. To increase the speed of calculation, it is possible to consider setting the sampling interval to 2 when filtering.
2, in order to locate the interest point in the image and the different size, we use the 3x3x3 neighborhood non-maximum value suppression:
All values less than the preset extrema are discarded, and the added extremum reduces the number of feature points detected. Finally, only a few of the strongest traits will be detected.

The detection process using a corresponding size of the scale layer image resolution of the filter to detect, with a 3x3 filter as an example, the scale layer image of 9 pixels in a Figure 2 detected feature points and their own scale layer of the remaining 8 points and above and below the two scale layer 9 points are compared, a total of 26 points. The value of the pixel point labeled ' X ' in the figure is larger than the surrounding pixels to determine the point as a feature point for that region.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

3, local maximum precision positioning

The characteristic points of sub-pixel are obtained by using 3-dimensional linear interpolation method. At the same time, those points that are less than a certain threshold value are removed.


Four, characteristic point descriptive narrative character

1, the characteristic point direction assignment

Centered on the feature point. Calculates a radius of 6s (s is the scale value of the feature point) in the neighborhood of the point in the X-, Y- direction of the Haar wavelet (Haar wavelet edge length takes 4s) response, Harr wavelet

What the template sees:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

After calculating the response value of the image in the X and y directions of the Haar wavelet, a Gaussian weighting of two values is 2S. The weighted values represent the directional components in the horizontal and vertical directions, respectively.

The Harr characteristic value reflects the gray-scale change of the image, so the main direction is to describe the area direction that the gray-scale change is particularly intense.

Next, the feature point is the center. The angle of the Π/3 is a fan-shaped slide. Calculation of the Harr wavelet response value in the window dx, dy:


The sliding of the sector form sees:


In Opensurf C + + code implementations such as the following:

  for (int i =-6, I <= 6; ++i)   {for    (int j =-6; J <= 6; ++j)     {      if (i*i + J*j <) {        gauss = Static_cast<float> (gauss25[id[i+6]][id[j+6]]);        RESX[IDX] = Gauss * Haarx (r+j*s, c+i*s, 4*s);        RESY[IDX] = Gauss * Haary (r+j*s, c+i*s, 4*s);        ANG[IDX] = Getangle (Resx[idx], resy[idx]);        ++idx;}}}  

With I,j to control the range of 6x6 centered on the feature point, (I*i + j*j < 36) The filter falls at the center of the feature point. A radius of 6s points within a circular area, and then computes Haarx with Harry and with a pre-computed Gauss

Filtering. and calculates the angle of each point.

Finally, the direction of the maximum that fan is used as the main direction of the feature point.

In the Opensurf look-up sector there is the maximum worth of direction codes such as the following:

 for (ang1 = 0; ang1 < 2*pi;    ang1+=0.15f) {ang2 = (ang1+pi/3.0f > 2*pi? ang1-5.0f*pi/3.0f:ang1+pi/3.0f);     SumX = SumY = 0.F; for (unsigned int k = 0, K < ang.size (); ++k) {//Get angle from the x-axis of the sample-point const FLO       AT & ang = Ang[k]; Determine whether the point is within the window if (ang1 < ang2 && ang1 < ang && Ang < A          NG2) {sumx+=resx[k];      SUMY+=RESY[K]; } else if (Ang2 < ang1 && ((Ang > 0 && ang < ang2) | |       (Ang > Ang1 && ang < 2*pi)))          {Sumx+=resx[k];      SUMY+=RESY[K]; }}//If the vector produced from this window was longer than all//previous vectors then this forms the new D Ominant direction if (sumx*sumx + sumy*sumy > Max) {//store largest orientation max = Sumx*sumx + su      My*sumy;    Orientation = Getangle (SumX, SumY); }  }

2. Generation of characteristic vectors of feature points

At the center of the feature point, the 20sx20s image is divided into 4x4 blocks in the main direction, and each sub-block is calculated using the Harr template of size 2S, and each chunk is counted

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">
This has the characteristic data of the 4x4x4=64 dimension. For example, as seen in:

It is not first rotated to the main direction when calculating this rectangular area. Instead, the Harr response value for each point is calculated by DX, DY, and Gaussian weighted processing. The DX and dy are rotated and converted to calculate

The formula is as follows:

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvq1hqmjiwntq1nti1ng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">

In the Opensurf implementation source code is used in the second way, through the point rotation formula. Rotate the point to the main direction and make the corresponding point of the recent neighbor interpolation, such as the following formula:



Five, matching

To speed up the matching process. Surf the matching process index faster with Laplacian (which was previously calculated Hessian was able to get in the way without taking too much time). This allows you to separate the following situations and then match them in descriptive descriptors:


References:

Http://www.cnblogs.com/ronny/p/4045979.html

Http://doc.okbase.net/ronny/archive/107771.html

Http://www.tuicool.com/articles/2i6fqq3

Http://wenku.baidu.com/view/cf0c164f2e3f5727a5e96238.html

Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Surf Analysis algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.