-
Notifications
You must be signed in to change notification settings - Fork 29
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
base: master
Are you sure you want to change the base?
Censure Detector #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much more in @mronian's area of expertise, but it's looking promising to me.
smallest :: Int | ||
largest :: Int | ||
filter_type :: Type{F} | ||
filter_stack :: Array{F} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify dimensionality or make it a parameter, Array{F,N}
. Otherwise it's an abstract type and will deliver slow performance.
|
||
smallest :: Int | ||
largest :: Int | ||
filter_type :: Type{F} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this needs to be a field. You could define
eltype{F}(::Type{CENSURE{F}}) = F
eltype(censure::CENSURE) = eltype(typeof(censure))
response_matrix = reshape(hcat(responses...), size(img)..., size(responses)...) | ||
minima, maxima = extrema_filter(convert(Array{Float64}, padarray(response_matrix, [1, 1, 1], [1, 1, 1], "replicate")), [3, 3, 3]) | ||
features = map(i -> (minima[i] == response_matrix[i] || maxima[i] == response_matrix[i]) && ( response_matrix[i] > params.response_threshold ), CartesianRange(size(response_matrix))) | ||
(grad_x, grad_y) = imgradients(img, "sobel", "replicate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably deprecated
int_img = _get_integral_image(img, params.filter_stack[1]) | ||
responses = map(f -> _filter_response(int_img, f), params.filter_stack) | ||
response_matrix = reshape(hcat(responses...), size(img)..., size(responses)...) | ||
minima, maxima = extrema_filter(convert(Array{Float64}, padarray(response_matrix, [1, 1, 1], [1, 1, 1], "replicate")), [3, 3, 3]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is deprecated
cov_yy = grad_y .* grad_y | ||
for i in 1:params.largest - params.smallest + 1 | ||
gamma = (1 + (params.smallest + i - 1) / 3.0) | ||
filt_cov_xx = imfilter_gaussian(cov_xx, [gamma, gamma]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated
|
||
features[:, :, i] = map((xx, yy, xy, f) -> (xx + yy) ^ 2 > params.line_threshold * (xx * yy - xy ^ 2) ? false : f, filt_cov_xx, filt_cov_yy, filt_cov_xy, features[:, :, i]) | ||
end | ||
keypoints = Array{Keypoint}([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abstract type? keypoints = Vector{Keypoint}(0)
or keypoints = Keypoint[]
.
features[:, :, i] = map((xx, yy, xy, f) -> (xx + yy) ^ 2 > params.line_threshold * (xx * yy - xy ^ 2) ? false : f, filt_cov_xx, filt_cov_yy, filt_cov_xy, features[:, :, i]) | ||
end | ||
keypoints = Array{Keypoint}([]) | ||
scales = Array{Integer}([]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
|
||
end | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will users call censure
directly? If so there needs to be a test. We should make sure that all filter types are tested, too.
Added StarFilter to #1