Closed abhisuri97 closed 8 years ago
Cool, glad you figured out the issue, and thanks for posting your code, I'll refer anyone who wants python code here in the future.
If you're thinking of using Python for real time processing though I'd be worried, the algorithm is currently O(n^4) in the width of the image, it only hits real time in C++ with down-scaling, I doubt it could be fast enough for real time processing in Python. The only way it might be is by implementing #3
Correct, this is no way near real time image processing.
Hello, thanks for the eyeLike @trishume, and its python implementation @abhisuri97 . I noticed a bug/typo in test_possible_centers_formula() method that could cause the issue: on the rhs of dx, the dividend should be dx instead of dy. At least according to the C++ implementation.
dx = dx / magnitude
This looks like to have solved the problem of wrong eye center for me.
Thanks @thecanadiran 👍 . I have edited the code above to reflect this.
UPDATE: This is more or less fixed. Only issue is that I have to lower threshold values for it to be accurate. I am pasting the final python code here for future reference. See below. Hello, This week I took the initiative to replicate eyeLike in python (at least the ability to detect the center of the eye given an image of the eye itself). The problem I am facing right now is that: a) The post-processing threshold is more accurate at lower levels (much lower than 0.97) b) Eye center tracking is focusing on dark regions...but they are the wrong dark objects. Example: threshold postprocessing 0.70, k_fast_width 50
threshold postprocessing 0.97, k_fast_width 50
threshold postprocessing 0.70, k_fast_width 50
threshold postprocessing 0.97, k_fast_width 50
\ The only thing I can think of is that the numpy gradient function may not yield the same results as yours. EDIT. ADDED THE GRADIENT IMPLEMENTATION. EDIT-2: VARIOUS FIXES AND ADDED MORE COMMENTS** My code for reference.