Performance of the unwrapIris()
Published 11 February 2014After the performance improvement from yesterday, I wanted to try some more things, because the speed of this was still not satisfactory (I spent an hour processing 2000 images).
After the performance improvement from yesterday, I wanted to try some more things, because the speed of this was still not satisfactory (I spent an hour processing 2000 images).
I normally don’t do premature performance optimizations, and I was planning on optimizing the whole eye tracker later, when I felt I had all of the functionality I wanted, but from time to time, you still want to check your code, particularly when it’s suspiciously slow. So I did examine the code I had written so far using line_profiler (Abysmal documentation btw.) like so:
In the previous installments we’ve looked at Pupil Detection and Iris Detection. Now we’ll look at unwrapping the image of the iris from a circular pattern to a rectangular one. We will use this later for some other algorithms.
Iris detection is significantly more difficult than pupil. Mostly because it is not so well defined, pupil is just a black disk essentially as far as a grayscale image is concerned, but the outer edge of the iris is not nearly as sharp as the outer edge of the pupil is. Also, there is a much higher probability of glints and reflections in the iris, since it is larger than the pupil and this can complicate the detection further. And on top of all that the upper and lower eyelids often cover up portions of the iris, which means that detecting the iris as a circle is going to be either difficult or impossible.
Pupil Detection will be the basis of my eye tracker. In the end it will rely on accurate and robust pupil detection, but for now a simple detector will do. Later I will revisit the detection when the basics of the other components are done.