[] SURF feature detection Opencv

[Reserved] Original Source: https://www.cnblogs.com/gfgwxw/p/9415218.html

Speeded Up Robust Features (SURF, wherein the acceleration sound)

One. Integral image

  1. What is the integral image

Integral image is a gradation image input via the accumulation operation between a pixel image obtained new media types. For the image, a gradation integral image of any point (x, y) refers to the value of the grayscale values ​​of all the points within the rectangular region of the image to the upper left corner point and composed of

  1. The role of the integral image

SURF integral image is the key to reducing the amount of calculation algorithm to improve performance to a large extent from the SURF algorithm SIFT to use thanks to the integral image

  1. The integral relationship between image and original image

. A same point:

Integral image the same size as the original image, the coordinates of each pixel with the position coordinate of the integral image corresponding to the original grayscale image.

. B differences:

The difference is that, in a case where the original image grayscale image, each pixel of the grayscale image using 8bit expressed, since the integral image pixels accumulate operations, or due to change in the image scale, the bit width of each pixel in the image integrating the points will be required to represent the balance due pixels

  1. How to get the integral image

a. the integral of pixel values

1. The establishment of coordinate system

For an original gray scale image, with the first pixel position in the image as the origin of coordinates to the right of axis positive, downward axis positive coordinate system is established.

2. Determination of the integral pixel values

The arbitrary pixel all pixel values between the coordinate origin of the rectangular region surrounded obtained by adding a new value, where we define it as the integral of pixel values.

 

b. Determine the integral image

Each pixel in the original image are obtained through calculation the pixel values ​​of the new integrated, constituting a new final integral image.

 

c. the role of the integral image

With the concept of the integral image, in the original image we can calculate the pixels within any rectangular area and. This calculation method effectively reduces the amount of calculation, because the size of the rectangular area does not affect the amount of computation. Pixels within the rectangle of any accumulated only need to use the integral of pixel values ​​of four corners of the rectangle position can be obtained by subtraction.

To calculate the rectangle of all pixels in the accumulated value just need to find the corresponding integral image , , , the value of the integral of the pixel and subtracting four positions:

 

two. Hessian matrix

0. compared with SIFT algorithm

a. SIFT algorithm is used DoG images, and uses a SURF Hessian matrix determinant approximation image

Use b. SIFT Algorithm Gaussian differential pair , and be approximated, use , and function instead of a Laplacian of Gaussian function, i.e.,

Hessian matrix obtained by the approximate estimate of the difference of Gaussians Hessian matrix

Higher order differential and discrete image function Gaussian function is equivalent to using a Gaussian filter template image filtering do do convolution operation

Its determinant

 

1. Definitions

a. an image pixel Hessian matrix

I.e. each pixel can be obtained a Hessian matrix.

Determinant is:

 

b. Hessian matrix image

Because we need to have the feature point scale independent, so the structure is performed before the Hessian matrix, needs to be Gaussian filter. Thus, after filtering is performed to calculate Hessian

Which represents the image function and the second order differential of a Gaussian function ( in pixels) convolution at. And also so similar definitions

 

 

c. Filter cartridge

Higher order differential and discrete image function Gaussian function is equivalent to using a Gaussian filter template image filtering do do convolution operation. In practice, the Gaussian second order derivative discretized filter cartridge and cutting process to obtain approximately Gaussian filter instead of the plate subjected to convolutional calculation

 

Grid gradient color depth template representative of a Gaussian filter coefficients of different weights. A Gaussian filter size and cutting templates are generated discretization box filter comprises three directions.

While the higher-order Gaussian derivative function also discretize the filter weight of each portion of the weight of the filter template is simplified, so coefficients are elements in the set

 

three. Construction scale space

The above-mentioned work is the convolution of Second template partial derivative matrix H obtained, next to build the scale space through the H matrix.

a.SIFT scale space

In SIFT, the scale space pyramid model with filtered scaling images obtained. Firstly, the SIFT the image obtained by sampling a plurality of images, each image obtained by sampling the original image for each group. To ensure the continuity of the image pyramid of the original image for each set of different Gaussian filtering, pyramid images in each group also received several filtering.

Thus obtained image pyramid divided into groups (Octave), while there are a number of layers in each group (Layer) picture composition. Obviously, the amount calculated image pyramid pyramid increases with the number of groups and number of layers increases.

b.SURF scale space

1. similarities

SURF algorithm similar scale-space consists of several groups (Octave), each group comprising a plurality of layers (Level).

2. Different points

group:

Pictures will not be sampled at SURF algorithm. SURF algorithm start size box filter begins, the size of the box filter is expanded, the size of the box filter is a Gaussian function of the second order differential of 1.2 after cutting the discrete filter and Save template. In SURF, we kept the same image, merely changing the size of the Gaussian filter window to obtain images at different scales, i.e., constitute a scale-space.

Floor:

Each layer corresponds to the relationship between the size of the filter template . Bay recommended scale space divided into four groups, each group comprising four layers.

In order to maintain the continuity of scale space, SURF algorithm scale space group some adjacent layers overlap, while the size of each filter cartridge are progressively increasing.

An image generation process determinant c.Hessian

In scale-space SURF algorithm, each group includes any layer three kinds of filter cartridge. After filtering an input image is calculated by the formula Hessian determinant can be obtained for a value of the Hessian determinant coordinate scale, all the Hessian determinant of a Hessian determinant constituting the image.

A gray image after the filtering process boxes of different sizes in a scale-space filters, Hessian determinant may generate a plurality of images, thereby forming an image pyramid.

 

four. Precise positioning of feature points

a. Non-maxima suppression process

In each group of three adjacent Hessian determinant selected image, for each value of the Hessian determinant intermediate layer may be used as the comparison point, 26 points around the selected point size comparison in the space, If the point 26 is greater than the other points, the point as a feature point. From the appeal process may be known, when the scale space is constituted by four each, non-maximal suppression only in the middle of two layers, no comparison is made between adjacent groups.

 

b. preset value Hessian determinant

Hessian determinant point is below the threshold value can not as a final feature points. When the actual selection threshold value, the threshold value changes according to the application requirements and the number of feature points accuracy. The larger the threshold, the feature points obtained better robustness. When simple image processing scenarios, which threshold can be appropriately reduced. In complex images, the number of feature points after the change of the rotated image blur or larger, the threshold test requires appropriate increase.

 

Fives. Main direction calculation

In order to have better characteristics rotation invariance, assign each feature point one main direction. In SURF, the Haar wavelet is the main direction in the circular area centered on the feature point of the radius of 6 times the characteristic dimension of the response obtained for statistical calculation.

Determining a. Direction point of interest

First, given the direction characteristics of each point of interest. We have a point of interest as the center, to 6S (S dimension corresponding to that point of interest) in a circular field of radius, the Haar wavelet 4S template of the image processing required for sizes x, y directions of the two Haar wavelet response.

As shown in FIG template Haar wavelet,

Wherein the template is calculated in response to the left in the X direction, the right side of the template is calculated in response to the y-direction, indicated in black -1, +1 represents white. After which processes round the art, is obtained for each point in the field corresponding to the x, y directions in response, and then to the point of interest centered Gaussian function ( ) for weighting these responses

To do this in a circular field of 60 degree sector area, the sum of statistical haar wavelet features within this sector region, the sector region and then rotated, then the sum of the statistical wavelet features. Wherein the sum of the maximum directional wavelet-based direction.

b. descriptor vector construct

1. SIFT algorithm

In the described SIFT key points are selected key points around the field, which in turn is divided into regions, each region statistics eight directional gradient, to give the final described vector dimension.

2.SURF algorithm

In the SURF, we select key points around a square frame, a direction of the main direction of the critical point, side length 20S. Haar wavelet characteristic which is divided into 16 regions (side length 5S), each region statistics 25 pixels in the horizontal direction and the vertical direction (direction of the square to the main frame homogeneous determined)

 

The Wavelet feature value comprises the direction and level, the absolute values of the horizontal direction and a vertical direction and a vertical direction and the sum of the absolute values of (for the polarity of the intensity variation information including descriptor, the absolute value accumulating ). Thus each region has four values, each square block has dimensions, i.e., each key is 64-dimensional descriptor, less than half of the SIFT descriptor

 

six. SURF algorithm SIFT algorithm comparison summary

(1) in generating scale space, SIFT algorithm utilizes the spatial Gaussian pyramid image difference with each other to generate different levels of a convolution. SURF algorithm are box filters of different scales the original image convolution

(2) When the feature point test, the SIFT operator is firstly non-maxima suppression image, and then removing the low-contrast point. Then removed by the edge point Hessian matrix.

SURF algorithm is the first candidate feature points detected by the Hessian matrix, and then to the point of non-maxima suppression

(3) determining the direction of the eigenvector, the SIFT algorithm statistical magnitude of the gradient in the square region histogram, find the direction of the maximum gradient magnitude corresponding. SIFT feature points determined operator may have one or more directions, which includes a main direction of the plurality of secondary direction.

SURF algorithm is in the neighborhood of a circular, horizontal detection range in each sector, the Haar wavelet response in the vertical direction, the maximum value of the sector to find the point modulus, direction and only one of the algorithm.

(4) SIFT described algorithm to generate neutrons, is the sampling points are divided into regions so that each partition seed point calculated amplitude and determine its orientation, a total dimension.

SURF algorithm generates a feature description to midnight square is divided into small squares, 25 samples of each sub-region, calculating the wavelet haar response , a total dimension.

In summary, the SURF algorithm at each step are the cumbersome work is simplified, only one main direction calculated feature points, generated feature descriptor also reduced as compared to the former dimension.

 

Seven. Reference and Acknowledgments

1. Kobayashi visual CV Workshop

2. articles HIT master's thesis

3. Bay H, Ess A, Tuytelaars T, et al. Speeded-up robust features (SURF)[J]. Computer vision and image understanding, 2008, 110(3): 346-359.

Published 14 original articles · won praise 1 · views 494

Guess you like

Origin blog.csdn.net/qq_41741344/article/details/104819494