@@ -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"""
1616type 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)
5656end
5757
5858function 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))
0 commit comments