Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Censure Detector #35

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Adds Feature Detection. Harris Suppression Left
  • Loading branch information
mronian authored and tejus-gupta committed Apr 30, 2017
commit 70440f8f3aba2ada8b564f40e329c5854b32190c
15 changes: 14 additions & 1 deletion src/censure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,23 @@ function filterResponse(int_imgs::Tuple, OF::OctagonFilter)

end

function checkFeature()
end

CENSURE(; smallest::Integer = 1, largest::Integer = 7, filter::Type = BoxFilter, responseThreshold::Number = 0.15, lineThreshold::Number = 10) = CENSURE(smallest, largest, filter, getFilterStack(filter, smallest, largest), responseThreshold, lineThreshold)

function censure{T}(img::AbstractArray{T, 2}, params::CENSURE)
int_img = getIntegralImage(img, params.filter_stack[1])
responses = map(f -> filterResponse(int_img, f), params.filter_stack)
responses
# minima, maxima = extrema_filter(padarray(responses, [1, 1, 1], [1, 1, 1], "replicate"), Array(3, 3, 3))
# features = map(i -> (minima[i] == responses[i] || maxima[i] == responses[i]) && ( responses[i] > params.responseThreshold ), CartesianRange(size(responses)))
features = map(i -> checkFeature(), responses)
keypoints = Array{Keypoints}([])
scales = Array{Integer}([])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

for scale in 1:(params.largest - params.smallest + 1)
rows, cols, _ = findnz(features[:, :, scale])
append!(keypoints, map((r, c) -> Keypoint(r, c), rows, cols)
append!(scales, ones(length(rows)) * scale)
end
keypoints, scales
end