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 Keypoint Detector #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

CENSURE Keypoint Detector #1

wants to merge 7 commits into from

Conversation

mronian
Copy link
Contributor

@mronian mronian commented Jun 29, 2016

  • DataTypes
  • Filters
    • Box
    • Octagon
    • Star
  • Filter Response
    • Box
    • Octagon
    • Star
  • Feature Detect

@mronian mronian changed the title CENSURE Keypoint Detector (Not ready for merge yet, main function left) CENSURE Keypoint Detector (Not ready for merge yet) Jul 3, 2016
src/censure.jl Outdated
topright = I + CartesianIndex(- n - 1, n)
bottomleft = I + CartesianIndex(n, - n - 1)
bottomright = I + CartesianIndex(n, n)
A = topleft >= CartesianIndex(1, 1) ? int_img[topleft] : 0.0
Copy link
Contributor Author

@mronian mronian Jul 3, 2016

Choose a reason for hiding this comment

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

Whats the correct way to check bounds on CartesianIndex?

julia> a = CartesianIndex(2, 0)
CartesianIndex{2}((2,0))

julia> b = CartesianIndex(0, 2)
CartesianIndex{2}((0,2))

julia> a >= CartesianIndex(1, 1)
false

julia> b >= CartesianIndex(1, 1)
true

I need both the cases to be false for this to work correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found checkbounds(). I'll make the changes :)

@mronian
Copy link
Contributor Author

mronian commented Jul 3, 2016

@timholy I have some doubts which I have written inline as comments on the files. I have tried to make the code fast by looking at benchmarks and ProfileView(Thanks for that!) checked the type warning for most things.

src/censure.jl Outdated
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)
Copy link
Member

Choose a reason for hiding this comment

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

BTW, can you wrap long lines? It means I have to scroll my browser window to find the "comment" button 😄.

@mronian
Copy link
Contributor Author

mronian commented Jul 28, 2016

@timholy This is ready for review :)

src/censure.jl Outdated
[13, 5, 7, 4],
[15, 5, 10, 5]
]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix the indentation.

@mronian mronian force-pushed the censure branch 7 times, most recently from fcc9937 to ed82fc1 Compare July 28, 2016 01:54
@mronian mronian changed the title CENSURE Keypoint Detector (Not ready for merge yet) CENSURE Keypoint Detector Jul 28, 2016
@mronian
Copy link
Contributor Author

mronian commented Jul 31, 2016

@timholy I am changing the Keypoint type to be an alias of CartesianIndex{2} instead of the current type since it is easier for calculating descriptors (can be seen in the upcoming BRIEF descriptor) -

type Keypoint
    x::Integer
    y::Integer
end 

Do you have a better representation in mind?

@timholy
Copy link
Member

timholy commented Aug 1, 2016

I am changing the Keypoint type to be an alias of CartesianIndex{2} instead of the current type

That's a good idea---you'll get a lot of very nice behavior for free that way.

For future reference when you do create your own types, remember that Integer is an abstract type and that you should avoid using abstract types as fields in a type if at all possible because performance will be terrible. It's much better to use a parametric type,

type KeyPoint{T<:Integer}
    x::T
    y::T
end

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.

abstract container type. How about just Array{Int}(0)?

@timholy
Copy link
Member

timholy commented Aug 1, 2016

Aside from very small points, this seems fine to me. (I'll have to play with it to really kick the tires, but it looks very promising!)

@mronian mronian force-pushed the censure branch 2 times, most recently from 7229c7d to 1bae7e9 Compare August 17, 2016 07:31
@mronian mronian force-pushed the master branch 11 times, most recently from 6813e5a to ef86fc9 Compare August 22, 2016 14:51
@tejus-gupta
Copy link
Contributor

tejus-gupta commented Apr 28, 2017

@mronian You don't seem to be working on this. Can I finish it off?

@mronian
Copy link
Contributor Author

mronian commented Apr 28, 2017

Yeah sure. It is mostly ready, you will need to update the code to the latest Julia. I did not merge it since the docs were not there.

@tejus-gupta
Copy link
Contributor

In filter response for octagon filter,

topright = I + CartesianIndex(m_in2, - m_in2 - OF.n_in - 1)
bottomleft = I + CartesianIndex(- m_in2 - 1, m_in2 + OF.n_in)

I don't think this is correct. The error wouldn't effect the filter response though.

@mronian
Copy link
Contributor Author

mronian commented Apr 30, 2017

The filter response was correct since I had manually checked it for a few octagons and images. You can check it again to confirm. What seems to be the error in the code?

@tejus-gupta tejus-gupta mentioned this pull request Apr 30, 2017
@tejus-gupta
Copy link
Contributor

It should be
topright = I + CartesianIndex(- m_in2 - 1, m_in2 + OF.n_in)
bottomleft = I + CartesianIndex(m_in2, - m_in2 - OF.n_in - 1)

The filter response would come out correctly because in_sum=A + D - B - C. Swapping B and C wouldn't change in_sum.

@mronian
Copy link
Contributor Author

mronian commented May 24, 2017

@tejus-gupta I don't think its wrong. topright has to be obtained by decreasing the y-coordinate and increasing the x-coordinate and for bottomleft you will have to increase the y and decrease the x from the centre I.

@mronian
Copy link
Contributor Author

mronian commented May 24, 2017

Whoops. I mistook the lines you mentioned as those from the code instead of corrections. Agreed, it is incorrect. Go ahead, @tejus-gupta 😄 Sorry for the trouble!

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