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
Open

Conversation

tejus-gupta
Copy link
Contributor

Added StarFilter to #1

Copy link
Member

@timholy timholy left a 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}
Copy link
Member

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}
Copy link
Member

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")
Copy link
Member

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])
Copy link
Member

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])
Copy link
Member

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}([])
Copy link
Member

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}([])
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.


end

end
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants