I am developing application to track small animals in Petri dishes (or other circular containers). Before any tracking takes place, the first few frames are used to define areas
Within the current algorithm, the biggest thing that sticks out is the for(int t=5; t<400; t=t+2)
loop. Trying recording score values for some test images. Graph score(t)
versus t
. With any luck, it will either suggest a smaller range for t
or be a smoothish curve with a single maximum. In the latter case you can change your loop over all t
values into a smarter search using Hill Climbing methods.
Even if it's fairly noisy, you can first loop over multiples of, say, 30, and for the best 1 or 2 of those loop over nearby multiples of 2.
Also, in your score function, you should disqualify any results with overlapping circles and maybe penalize overly spaced out circles.