Skip to content

Commit be1b929

Browse files
authored
Merge pull request #27 from JuliaImages/teh/orb_perf
Fix non-leaftype in ORB and turn off coverage in tests
2 parents 9712b52 + 422805d commit be1b929

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ notifications:
1010
script:
1111
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
1212
- julia -e 'Pkg.add("Distributions")' # Needed for Docs and Tests
13-
- julia -e 'Pkg.add("TestImages")' # Needed for Docs
13+
- julia -e 'Pkg.add("TestImages")' # Needed for Docs
1414
- julia -e 'Pkg.add("ImageMagick")' # Needed for Docs
15-
- julia -e 'Pkg.add("Images")' # Needed for Docs
16-
- julia -e 'Pkg.clone("https://github.com/JuliaImages/ImageDraw.jl")' # Needed for Docs
15+
- julia -e 'Pkg.add("Images")' # Needed for Docs
16+
- julia -e 'Pkg.clone("https://github.com/JuliaImages/ImageDraw.jl")' # Needed for Docs
1717
- julia -e 'Pkg.clone(pwd()); Pkg.build("ImageFeatures")'
18-
- julia -e 'Pkg.test("ImageFeatures",coverage=true)'
18+
- julia -e 'Pkg.test("ImageFeatures", coverage=false)'
1919
after_success:
20-
- if [ $TRAVIS_OS_NAME = "linux" ]; then
21-
julia -e 'cd(Pkg.dir("ImageFeatures")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';
22-
fi
20+
# - if [ $TRAVIS_OS_NAME = "linux" ]; then
21+
# julia -e 'cd(Pkg.dir("ImageFeatures")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';
22+
# fi
2323
- julia -e 'Pkg.add("Documenter")'
2424
- julia -e 'cd(Pkg.dir("ImageFeatures")); include(joinpath("docs", "make.jl"))'

src/orb.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ orb_params = ORB([num_keypoints = 500], [n_fast = 12], [threshold = 0.25], [harr
66
| Argument | Type | Description |
77
|----------|------|-------------|
88
| **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`] |
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`] |
1111
| **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 |
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 <: Params
1717
num_keypoints::Int
@@ -33,7 +33,7 @@ function create_descriptor{T<:Gray}(img::AbstractArray{T, 2}, params::ORB)
3333
patch = ones(31, 31)
3434
orientations_stack = map((image, keypoints) -> corner_orientations(image, keypoints, patch), pyramid, keypoints_stack)
3535
harris_response_stack = map(image -> harris(image, k = params.harris_factor), pyramid)
36-
descriptors = BitArray[]
36+
descriptors = BitVector[]
3737
ret_keypoints = Keypoint[]
3838
harris_responses = Float64[]
3939
scales = Float64[]
@@ -46,7 +46,7 @@ function create_descriptor{T<:Gray}(img::AbstractArray{T, 2}, params::ORB)
4646
append!(harris_responses, harris_response_stack[i][ret_key])
4747
append!(scales, ones(length(ret_key)) * floor(Int, (params.downsample ^ (i - 1))))
4848
end
49-
49+
5050
if params.num_keypoints < length(descriptors)
5151
first_n_indices = selectperm(harris_responses, 1:params.num_keypoints, rev = true)
5252
return descriptors[first_n_indices], ret_keypoints[first_n_indices], scales[first_n_indices]
@@ -56,13 +56,13 @@ function create_descriptor{T<:Gray}(img::AbstractArray{T, 2}, params::ORB)
5656
end
5757

5858
function create_descriptor{T<:Gray}(img::AbstractArray{T, 2}, keypoints::Keypoints, orientations::Array{Float64}, params::ORB)
59-
descriptors = BitArray[]
59+
descriptors = BitVector[]
6060
ret_keypoints = Keypoint[]
6161
for (i, k) in enumerate(keypoints)
6262
orientation = orientations[i]
6363
sin_angle = sin(orientation)
6464
cos_angle = cos(orientation)
65-
descriptor = BitArray([])
65+
descriptor = BitVector([])
6666
for (y0, x0, y1, x1) in orb_sampling_pattern
6767
pixel0 = CartesianIndex(floor(Int, sin_angle * y0 + cos_angle * x0), floor(Int, cos_angle * y0 - sin_angle * x0))
6868
pixel1 = CartesianIndex(floor(Int, sin_angle * y1 + cos_angle * x1), floor(Int, cos_angle * y1 - sin_angle * x1))

test/REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
FactCheck
22
TestImages
33
@linux ImageMagick
4+
@windows ImageMagick
45
@osx QuartzImageIO
56
Distributions

0 commit comments

Comments
 (0)