4.1 Tag Distribution Based on Image Matching
111
E(u, v) =
x,y
w(x, y)
I (x + u, y + v) − I (x, y)
2
(4.1)
Among them, w(x, y) is the window function and I (x, y) is the gray value. In order
to do corner detection, the algorithm maximizes this function E(u, v). Expanding
Eq. (4.1) by Taylor and omitting higher order terms, the final equation is:
E(u, v) ≈
u v
M
u
v
(4.2)
Among them,
M =
x,y
w(x, y)
I x I x I x I y
I x I y I y I y
(4.3)
Among them, I x and I y are the derivatives of the image in the x and y directions,
respectively.
The algorithm defines a score function, which determines whether a window
contains a corner as Eq. (4.4):
R = min(λ 1 , λ 2 )
(4.4)
In Eq. (4.4), λ 1 and λ 2 are the characteristic values of M . If the value of formula
(4.4) is greater than the minimum threshold value, it is regarded as an angle.
After extracting the feature points, the algorithm calculates the gradient of the
abscissa and ordinate directions of the image and calculates the gradient direction
value of each pixel position accordingly. The gradient of the pixels in the image is:
G x (x, y) = H (x + 1, y) − H (x − 1, y)
G y (x, y) = H (x, y + 1) − H (x, y − 1)
(4.5)
In Eq. (4.5), G x (x, y) represents the horizontal gradient at pixel (x, y) in the input
image, G y (x, y) represents the vertical gradient, and H (x, y) represents its pixel value.
The gradient magnitude and gradient direction at pixel (x, y) are:
G(x, y) =
G x (x, y)
2
+ G y (x, y)
2
(4.6)
α(x, y) = tan
−1
G y (x, y)
G x (x, y)
(4.7)
With the above calculation formula, the algorithm divides the image into several
image blocks, and each block is divided into several cells. The gradient histogram is
constructed in the unit of cell to form 2D vector, the gradient histogram is normalized
111
E(u, v) =
x,y
w(x, y)
I (x + u, y + v) − I (x, y)
2
(4.1)
Among them, w(x, y) is the window function and I (x, y) is the gray value. In order
to do corner detection, the algorithm maximizes this function E(u, v). Expanding
Eq. (4.1) by Taylor and omitting higher order terms, the final equation is:
E(u, v) ≈
u v
M
u
v
(4.2)
Among them,
M =
x,y
w(x, y)
I x I x I x I y
I x I y I y I y
(4.3)
Among them, I x and I y are the derivatives of the image in the x and y directions,
respectively.
The algorithm defines a score function, which determines whether a window
contains a corner as Eq. (4.4):
R = min(λ 1 , λ 2 )
(4.4)
In Eq. (4.4), λ 1 and λ 2 are the characteristic values of M . If the value of formula
(4.4) is greater than the minimum threshold value, it is regarded as an angle.
After extracting the feature points, the algorithm calculates the gradient of the
abscissa and ordinate directions of the image and calculates the gradient direction
value of each pixel position accordingly. The gradient of the pixels in the image is:
G x (x, y) = H (x + 1, y) − H (x − 1, y)
G y (x, y) = H (x, y + 1) − H (x, y − 1)
(4.5)
In Eq. (4.5), G x (x, y) represents the horizontal gradient at pixel (x, y) in the input
image, G y (x, y) represents the vertical gradient, and H (x, y) represents its pixel value.
The gradient magnitude and gradient direction at pixel (x, y) are:
G(x, y) =
G x (x, y)
2
+ G y (x, y)
2
(4.6)
α(x, y) = tan
−1
G y (x, y)
G x (x, y)
(4.7)
With the above calculation formula, the algorithm divides the image into several
image blocks, and each block is divided into several cells. The gradient histogram is
constructed in the unit of cell to form 2D vector, the gradient histogram is normalized
