Skip to content

Commit 71c95af

Browse files
authored
Merge pull request #31 from JuliaImages/cs/basetest
Refactor tests to use Base.Test instead of FactCheck
2 parents 3de515a + a6378fc commit 71c95af

21 files changed

+1145
-1171
lines changed

src/ImageFeatures.jl

+39-39
Original file line numberDiff line numberDiff line change
@@ -16,50 +16,50 @@ include("houghtransform.jl")
1616

1717
export Keypoint, Keypoints, Feature, Features, Params, BRIEF, ORB, FREAK, BRISK
1818

19-
export
20-
#Core
21-
create_descriptor,
22-
hamming_distance,
23-
match_keypoints,
24-
grade_matches,
19+
export
20+
#Core
21+
create_descriptor,
22+
hamming_distance,
23+
match_keypoints,
24+
grade_matches,
2525

2626
#Local Binary Patterns
27-
lbp,
28-
modified_lbp,
29-
direction_coded_lbp,
30-
lbp_original,
31-
lbp_uniform,
32-
lbp_rotation_invariant,
33-
multi_block_lbp,
27+
lbp,
28+
modified_lbp,
29+
direction_coded_lbp,
30+
lbp_original,
31+
lbp_uniform,
32+
lbp_rotation_invariant,
33+
multi_block_lbp,
3434

3535
#Gray Level Co Occurence Matrix
36-
glcm,
37-
glcm_symmetric,
38-
glcm_norm,
39-
glcm_prop,
40-
max_prob,
41-
contrast,
42-
ASM,
43-
IDM,
44-
glcm_entropy,
45-
energy,
46-
dissimilarity,
47-
correlation,
48-
glcm_mean_ref,
49-
glcm_mean_neighbour,
50-
glcm_var_ref,
51-
glcm_var_neighbour,
36+
glcm,
37+
glcm_symmetric,
38+
glcm_norm,
39+
glcm_prop,
40+
max_prob,
41+
contrast,
42+
ASM,
43+
IDM,
44+
glcm_entropy,
45+
energy,
46+
dissimilarity,
47+
correlation,
48+
glcm_mean_ref,
49+
glcm_mean_neighbour,
50+
glcm_var_ref,
51+
glcm_var_neighbour,
5252

53-
#Corners
54-
corner_orientations,
53+
#Corners
54+
corner_orientations,
5555

56-
#BRIEF
57-
random_uniform,
58-
random_coarse,
59-
gaussian,
60-
gaussian_local,
61-
center_sample,
56+
#BRIEF
57+
random_uniform,
58+
random_coarse,
59+
gaussian,
60+
gaussian_local,
61+
center_sample,
6262

63-
#Lines and Ellipses
64-
hough_transform_standard
63+
#Lines and Ellipses
64+
hough_transform_standard
6565
end

src/brief.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ brief_params = BRIEF([size = 128], [window = 9], [sigma = 2 ^ 0.5], [sampling_ty
66
| Argument | Type | Description |
77
|----------|------|-------------|
88
| **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 |
9+
| **window** | Int | Size of sampling window |
10+
| **sigma** | Float64 | Value of sigma used for inital gaussian smoothing of image |
1111
| **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. |
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} <: Params
@@ -101,7 +101,7 @@ end
101101
sample_one, sample_two = gaussian_local(size, window, seed)
102102
```
103103
104-
Pairs `(Xi, Yi)` are randomly sampled using a Gaussian distribution where first `X` is sampled with a standard deviation of `0.04*S^2` and
104+
Pairs `(Xi, Yi)` are randomly sampled using a Gaussian distribution where first `X` is sampled with a standard deviation of `0.04*S^2` and
105105
then the `Yi’s` are sampled using a Gaussian distribution – Each `Yi` is sampled with mean `Xi` and standard deviation of `0.01 * S^2`
106106
"""
107107
function gaussian_local(size::Int, window::Int, seed::Int)
@@ -164,4 +164,4 @@ function create_descriptor{T<:Gray}(img::AbstractArray{T, 2}, keypoints::Keypoin
164164
push!(ret_keypoints, k)
165165
end
166166
descriptors, ret_keypoints
167-
end
167+
end

src/brisk.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ brisk_params = BRISK([pattern_scale = 1.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 BRISK <: Params
1111
threshold::Float64
@@ -41,7 +41,7 @@ function BRISK(; threshold::Float64 = 0.25, octaves::Int = 4, pattern_scale = 1.
4141
BRISK(threshold, octaves, pattern_scale, pattern_table, smoothing_table, orientation_weights, short_pairs, long_pairs)
4242
end
4343

44-
function _brisk_orientation{T<:Gray}(int_img::AbstractArray{T, 2}, keypoint::Keypoint, pattern::Array{SamplePair},
44+
function _brisk_orientation{T<:Gray}(int_img::AbstractArray{T, 2}, keypoint::Keypoint, pattern::Array{SamplePair},
4545
orientation_weights::Array{OrientationWeights}, sigmas::Array{Float16}, long_pairs::Array{OrientationPair})
4646
direction_sum_y = 0.0
4747
direction_sum_x = 0.0
@@ -61,14 +61,14 @@ function _brisk_tables(pattern_scale::Float64)
6161
pattern_table = Vector{SamplePair}[]
6262
smoothing_table = Vector{Float16}[]
6363
for ori in 0:brisk_orientation_steps - 1
64-
theta = ori * 2 * pi / brisk_orientation_steps
64+
theta = ori * 2 * pi / brisk_orientation_steps
6565
pattern = SamplePair[]
6666
sigmas = Float16[]
6767
for (i, n) in enumerate(brisk_num_circular_pattern)
6868
for circle_number in 0:n - 1
6969
angle = (circle_number * 2 * pi / n) + theta
7070

71-
push!(pattern, SamplePair((brisk_radii[i] * sin(angle) * pattern_scale * 0.85,
71+
push!(pattern, SamplePair((brisk_radii[i] * sin(angle) * pattern_scale * 0.85,
7272
brisk_radii[i] * cos(angle) * pattern_scale * 0.85)))
7373
push!(sigmas, brisk_sigma[i] * pattern_scale * 0.85)
7474
end
@@ -102,5 +102,5 @@ function create_descriptor{T<:Gray}(img::AbstractArray{T, 2}, features::Features
102102
push!(descriptors, descriptor)
103103
push!(ret_features, Feature(keypoint, orientation))
104104
end
105-
descriptors, ret_features
106-
end
105+
descriptors, ret_features
106+
end

0 commit comments

Comments
 (0)