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
Copy file name to clipboardExpand all lines: docs/src/index.md
+15-5Lines changed: 15 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,25 @@
2
2
3
3
## Introduction
4
4
5
-
The ideal keypoint detector finds salient image regions such that they are repeatably detected despite change of viewpoint and more generally it is robust to all possible image transformations. Similarly, the ideal keypoint descriptor captures the most important and distinctive information content enclosed in the detected salient regions, such that the same structure can be recognized if encountered.
5
+
[ImageFeatures](https://github.com/JuliaImages/ImageFeatures.jl) is a
6
+
package for identifying and characterizing "keypoints" (salient
7
+
features) in images. Collections of keypoints can be matched between
8
+
two images. Consequently, keypoints can be useful in many
9
+
applications, such as object localization and image registration.
10
+
11
+
The ideal keypoint detector finds salient image regions such that they
12
+
are repeatably detected despite change of viewpoint and more generally
13
+
it is robust to all possible image transformations. Similarly, the
14
+
ideal keypoint descriptor captures the most important and distinctive
15
+
information content enclosed in the detected salient regions, such
16
+
that the same structure can be recognized if encountered.
6
17
7
18
## Installation
8
19
9
-
Installing the package is extremely easy with julia's package manager -
20
+
Installing the package is extremely easy with julia's package manager -
Copy file name to clipboardExpand all lines: docs/src/tutorials/brief.md
+16-32Lines changed: 16 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,46 +12,30 @@ In ImageFeatures.jl we have five methods to determine the vectors `X` and `Y` :
12
12
13
13
As with all the binary descriptors, BRIEF’s distance measure is the number of different bits between two binary strings which can also be computed as the sum of the XOR operation between the strings.
14
14
15
-
BRIEF is a very simple feature descriptor and does not provide scale or rotation invariance (only translation invariance). To achieve those, see [ORB](orb), [BRISK](brisk) and [FREAK](freak).
15
+
BRIEF is a very simple feature descriptor and does not provide scale or rotation invariance (only translation invariance). To achieve those, see [ORB](orb.md), [BRISK](brisk.md) and [FREAK](freak.md).
16
16
17
-
## Example
17
+
## Example
18
18
19
19
Let us take a look at a simple example where the BRIEF descriptor is used to match two images where one has been translated by `(100, 200)` pixels. We will use the `lena_gray` image from the [TestImages](https://github.com/timholy/TestImages.jl) package for this example.
20
20
21
21
22
-
First, let us define a warping function to transform the image.
23
-
24
-
```@example 1
25
-
function _warp(img, transx, transy)
26
-
res = zeros(eltype(img), size(img))
27
-
for i in 1:size(img, 1) - transx
28
-
for j in 1:size(img, 2) - transy
29
-
res[i + transx, j + transy] = img[i, j]
30
-
end
31
-
end
32
-
res = shareproperties(img, res)
33
-
res
34
-
end
35
-
nothing # hide
36
-
```
37
-
38
22
Now, let us create the two images we will match using BRIEF.
39
23
40
24
```@example 1
25
+
using ImageFeatures, TestImages, Images, ImageDraw, CoordinateTransformations
41
26
42
-
using ImageFeatures, TestImages, Images, ImageDraw
43
-
44
-
img = testimage("lena_gray_512")
45
-
img_array_1 = convert(Array{Images.Gray}, img)
46
-
img_array_2 = _warp(img_array_1, 100, 200)
27
+
img = testimage("lena_gray_512");
28
+
img1 = Gray.(img);
29
+
trans = Translation(-100, -200)
30
+
img2 = warp(img1, trans, indices(img1));
47
31
nothing # hide
48
32
```
49
33
50
34
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).
Copy file name to clipboardExpand all lines: docs/src/tutorials/brisk.md
+18-50Lines changed: 18 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,74 +1,42 @@
1
-
The *BRISK* descriptor has a predefined sampling pattern as compared to [BRIEF](brief) or [ORB](orb). Pixels are sampled over concentric rings. For each sampling point, a small patch is considered around it. Before starting the algorithm, the patch is smoothed using gaussian smoothing.
1
+
The *BRISK* descriptor has a predefined sampling pattern as compared to [BRIEF](brief.md) or [ORB](orb.md). Pixels are sampled over concentric rings. For each sampling point, a small patch is considered around it. Before starting the algorithm, the patch is smoothed using gaussian smoothing.
Two types of pairs are used for sampling, short and long pairs. Short pairs are those where the distance is below a set threshold distmax while the long pairs have distance above distmin. Long pairs are used for orientation and short pairs are used for calculating the descriptor by comparing intensities.
6
6
7
7
BRISK achieves rotation invariance by trying the measure orientation of the keypoint and rotating the sampling pattern by that orientation. This is done by first calculating the local gradient `g(pi,pj)` between sampling pair `(pi,pj)` where `I(pj, pj)` is the smoothed intensity after applying gaussian smoothing.
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.
11
+
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
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
13
14
-
## Example
14
+
## Example
15
15
16
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
17
18
-
First, lets define warping functions to transform and rotate the image.
18
+
First, let us create the two images we will match using BRISK.
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
21
53
-
```@example 4
54
-
55
-
using ImageFeatures, TestImages, Images, ImageDraw
22
+
using ImageFeatures, TestImages, Images, ImageDraw, CoordinateTransformations
56
23
57
24
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)
25
+
img1 = Gray.(img)
26
+
rot = recenter(RotMatrix(5pi/6), [size(img1)...] .÷ 2) # a rotation around the center
27
+
tform = rot ∘ Translation(-50, -40)
28
+
img2 = warp(img1, tform, indices(img1))
61
29
nothing # hide
62
30
```
63
31
64
32
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