Skip to content

Commit ef86fc9

Browse files
committed
fix bugs, format arguments
1 parent be04e17 commit ef86fc9

File tree

8 files changed

+32
-32
lines changed

8 files changed

+32
-32
lines changed

docs/src/function_reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ ASM
6161
IDM
6262
glcm_entropy
6363
energy
64-
contrast
6564
dissimilarity
6665
correlation
6766
glcm_mean_ref

docs/src/tutorials/freak.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Let us take a look at a simple example where the FREAK descriptor is used to mat
1313

1414
First, lets define warping functions to transform and rotate the image.
1515

16-
```@example 1
16+
```@example 3
1717
function _warp(img, transx, transy)
1818
res = zeros(eltype(img), size(img))
1919
for i in 1:size(img, 1) - transx
@@ -46,56 +46,56 @@ nothing # hide
4646

4747
Now, let us create the two images we will match using FREAK.
4848

49-
```@example 1
49+
```@example 3
5050
5151
using ImageFeatures, TestImages, Images, ImageDraw
5252
5353
img = testimage("lighthouse")
54-
img_array_1 = convert(Array{Gray}, img)
54+
img_array_1 = convert(Array{Images.Gray}, img)
5555
img_temp_2 = _warp(img_array_1, 5 * pi / 6)
5656
img_array_2 = _warp(img_temp_2, 50, 40)
5757
nothing # hide
5858
```
5959

6060
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).
6161

62-
```@example 1
62+
```@example 3
6363
keypoints_1 = Keypoints(fastcorners(img_array_1, 12, 0.35))
6464
keypoints_2 = Keypoints(fastcorners(img_array_2, 12, 0.35))
6565
nothing # hide
6666
```
6767

6868
To create the BRIEF descriptor, we first need to define the parameters by calling the [`BRIEF`](@ref) constructor.
6969

70-
```@example 1
70+
```@example 3
7171
freak_params = FREAK()
7272
nothing # hide
7373
```
7474

7575
Now pass the image with the keypoints and the parameters to the [`create_descriptor`](@ref) function.
7676

77-
```@example 1
77+
```@example 3
7878
desc_1, ret_keypoints_1 = create_descriptor(img_array_1, keypoints_1, freak_params)
7979
desc_2, ret_keypoints_2 = create_descriptor(img_array_2, keypoints_2, freak_params)
8080
nothing # hide
8181
```
8282

8383
The obtained descriptors can be used to find the matches between the two images using the [`match_keypoints`](@ref) function.
8484

85-
```@example 1
85+
```@example 3
8686
matches = match_keypoints(ret_keypoints_1, ret_keypoints_2, desc_1, desc_2, 0.1)
8787
nothing # hide
8888
```
8989

9090
We can use the [ImageDraw.jl](https://github.com/JuliaImages/ImageDraw.jl) package to view the results.
9191

92-
```@example 1
92+
```@example 3
9393
9494
grid = hcat(img_array_1, img_array_2)
9595
offset = CartesianIndex(0, 768)
9696
map(m_i -> line!(grid, m_i[1], m_i[2] + offset), matches)
97-
save("brief_example.jpg", grid); nothing # hide
97+
save("freak_example.jpg", grid); nothing # hide
9898
9999
```
100100

101-
![](brief_example.jpg)
101+
![](freak_example.jpg)

docs/src/tutorials/orb.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The *ORB* descriptor is a somewhat similar to [BRIEF](brief). It doesn’t have an elaborate sampling pattern as [BRISK](brisk) or [FREAK](freak).
22

33
However, there are two main differences between ORB and BRIEF:
4+
45
- ORB uses an orientation compensation mechanism, making it rotation invariant.
56
- ORB learns the optimal sampling pairs, whereas BRIEF uses randomly chosen sampling pairs.
67

@@ -18,7 +19,7 @@ Let us take a look at a simple example where the ORB descriptor is used to match
1819

1920
First, lets define warping functions to transform and rotate the image.
2021

21-
```@example 1
22+
```@example 2
2223
function _warp(img, transx, transy)
2324
res = zeros(eltype(img), size(img))
2425
for i in 1:size(img, 1) - transx
@@ -51,11 +52,12 @@ nothing # hide
5152

5253
Now, let us create the two images we will match using ORB.
5354

54-
```@example 1
55+
```@example 2
5556
5657
using ImageFeatures, TestImages, Images, ImageDraw
5758
5859
img = testimage("lighthouse")
60+
img_array_1 = convert(Array{Images.Gray}, img)
5961
img_temp_2 = _warp(img_array_1, 5 * pi / 6)
6062
img_array_2 = _warp(img_temp_2, 50, 40)
6163
@@ -64,29 +66,29 @@ nothing # hide
6466

6567
The ORB descriptor calculates the keypoints as well as the descriptor, unlike [BRIEF](brief). To create the ORB descriptor, we first need to define the parameters by calling the [`ORB`](@ref) constructor.
6668

67-
```@example 1
69+
```@example 2
6870
orb_params = ORB(num_keypoints = 1000)
6971
nothing # hide
7072
```
7173

7274
Now pass the image with the parameters to the [`create_descriptor`](@ref) function.
7375

74-
```@example 1
76+
```@example 2
7577
desc_1, ret_keypoints_1 = create_descriptor(img_array_1, orb_params)
7678
desc_2, ret_keypoints_2 = create_descriptor(img_array_2, orb_params)
7779
nothing # hide
7880
```
7981

8082
The obtained descriptors can be used to find the matches between the two images using the [`match_keypoints`](@ref) function.
8183

82-
```@example 1
84+
```@example 2
8385
matches = match_keypoints(ret_keypoints_1, ret_keypoints_2, desc_1, desc_2, 0.2)
8486
nothing # hide
8587
```
8688

8789
We can use the [ImageDraw.jl](https://github.com/JuliaImages/ImageDraw.jl) package to view the results.
8890

89-
```@example 1
91+
```@example 2
9092
9193
grid = hcat(img_array_1, img_array_2)
9294
offset = CartesianIndex(0, 768)

src/ImageFeatures.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export
4040
IDM,
4141
glcm_entropy,
4242
energy,
43-
contrast,
4443
dissimilarity,
4544
correlation,
4645
glcm_mean_ref,

src/brief.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ brief_params = BRIEF([size = 128], [window = 9], [sigma = 2 ^ 0.5], [sampling_ty
55
66
| Argument | Type | Description |
77
|----------|------|-------------|
8-
| `size` | `Int` | Size of the descriptor |
9-
| `window` | `Int` | Size of sampling window |
10-
| `sigma` | `Float64` | Value of sigma used for inital gaussian smoothing of image |
11-
| `sampling_type` | `Function` | Type of sampling used for building the descriptor (See [BRIEF Sampling Patterns](BRIEF Sampling Patterns)) |
12-
| `seed` | `Int` | Random seed used for generating the sampling pairs. For matching two descriptors, the seed used to build both should be same. |
8+
| **size** | Int | Size of the descriptor |
9+
| **window** | Int | Size of sampling window |
10+
| **sigma** | Float64 | Value of sigma used for inital gaussian smoothing of image |
11+
| **sampling_type** | Function | Type of sampling used for building the descriptor (See [BRIEF Sampling Patterns](#brief-sampling-patterns)) |
12+
| **seed** | Int | Random seed used for generating the sampling pairs. For matching two descriptors, the seed used to build both should be same. |
1313
1414
"""
1515
type BRIEF{F} <: DescriptorParams

src/core.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ hamming_distance(desc_1, desc_2) = mean(desc_1 $ desc_2)
3838
matches = match_keypoints(keypoints_1, keypoints_2, desc_1, desc_2, threshold = 0.1)
3939
```
4040
41-
Finds matched keypoints using the [hamming_distance](`hamming_distance`) function having distance value less than `threshold`.
41+
Finds matched keypoints using the [`hamming_distance`](@ref) function having distance value less than `threshold`.
4242
"""
4343
function match_keypoints(keypoints_1::Keypoints, keypoints_2::Keypoints, desc_1, desc_2, threshold::Float64 = 0.1)
4444
smaller = desc_1

src/freak.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ freak_params = FREAK([pattern_scale = 22.0])
55
66
| Argument | Type | Description |
77
|----------|------|-------------|
8-
| `pattern_scale` | `Float64` | Scaling factor for the sampling window |
8+
| **pattern_scale** | Float64 | Scaling factor for the sampling window |
99
"""
1010
type FREAK{S, T, O} <: DescriptorParams
1111
pattern_scale::Float64

src/orb.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ orb_params = ORB([num_keypoints = 500], [n_fast = 12], [threshold = 0.25], [harr
55
66
| Argument | Type | Description |
77
|----------|------|-------------|
8-
| `num_keypoints` | `Int` | Number of keypoints to extract and size of the descriptor calculated |
9-
| `n_fast` | `Int` | Number of consecutive pixels used for finding corners with FAST. See [`fastcorners`] |
10-
| `threshold` | `Float64` | Threshold used to find corners in FAST. See [`fastcorners`] |
11-
| `harris_factor` | `Float64` | Harris factor `k` used to rank keypoints by harris responses and extract the best ones |
12-
| `downsample` | `Float64` | Downsampling parameter used while building the gaussian pyramid. See [`gaussian_pyramid`] in Images.jl |
13-
| `levels` | `Int` | Number of levels in the gaussian pyramid. See [`gaussian_pyramid`] in Images.jl |
14-
| `sigma` | `Float64` | Used for gaussian smoothing in each level of the gaussian pyramid. See [`gaussian_pyramid`] in Images.jl |
8+
| **num_keypoints** | Int | Number of keypoints to extract and size of the descriptor calculated |
9+
| **n_fast** | Int | Number of consecutive pixels used for finding corners with FAST. See [`fastcorners`] |
10+
| **threshold** | Float64 | Threshold used to find corners in FAST. See [`fastcorners`] |
11+
| **harris_factor** | Float64 | Harris factor `k` used to rank keypoints by harris responses and extract the best ones |
12+
| **downsample** | Float64 | Downsampling parameter used while building the gaussian pyramid. See [`gaussian_pyramid`] in Images.jl |
13+
| **levels** | Int | Number of levels in the gaussian pyramid. See [`gaussian_pyramid`] in Images.jl |
14+
| **sigma** | Float64 | Used for gaussian smoothing in each level of the gaussian pyramid. See [`gaussian_pyramid`] in Images.jl |
1515
"""
1616
type ORB <: DescriptorParams
1717
num_keypoints::Int

0 commit comments

Comments
 (0)