You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All local gradients between long pairs and then summed and the `arctangent(gy/gx)` between `y` and `x` components of the sum is taken as the angle of the keypoint. Now, we only need to rotate the short pairs by that angle to help the descriptor become more invariant to rotation.
12
-
The descriptor is built using intensity comparisons. For each short pair if the first point has greater intensity than the second, then 1 is written else 0 is written to the corresponding bit of the descriptor.
12
+
The descriptor is built using intensity comparisons. For each short pair if the first point has greater intensity than the second, then 1 is written else 0 is written to the corresponding bit of the descriptor.
13
+
14
+
## Example
15
+
16
+
Let us take a look at a simple example where the BRISK descriptor is used to match two images where one has been translated by `(50, 40)` pixels and then rotated by an angle of 75 degrees. We will use the `lighthouse` image from the [TestImages](https://github.com/timholy/TestImages.jl) package for this example.
17
+
18
+
First, lets define warping functions to transform and rotate the image.
if checkbounds(Bool, img, i_rot, j_rot) res[i, j] = bilinear_interpolation(img, i_rot, j_rot) end
43
+
end
44
+
end
45
+
res = shareproperties(img, res)
46
+
res
47
+
end
48
+
nothing # hide
49
+
```
50
+
51
+
Now, let us create the two images we will match using BRISK.
52
+
53
+
```@example 4
54
+
55
+
using ImageFeatures, TestImages, Images, ImageDraw
56
+
57
+
img = testimage("lighthouse")
58
+
img_array_1 = convert(Array{Images.Gray}, img)
59
+
img_temp_2 = _warp(img_array_1, 5 * pi / 6)
60
+
img_array_2 = _warp(img_temp_2, 50, 40)
61
+
nothing # hide
62
+
```
63
+
64
+
To calculate the descriptors, we first need to get the keypoints. For this tutorial, we will use the FAST corners to generate keypoints (see [`fastcorners`](@ref).
0 commit comments