As i am struggling to fine tune HoughCircles for my application, i want to see method code which opencv is using for circle detection. Quality of detecting circle for good image also very bad. I want to check how circles are sorted. Kindly do the needful or provide some reference.