I am trying to build an character recognition program using Python. I am stuck on sorting the contours. I am using this page as a reference.
I managed to find the c
contours.sort(key=lambda r: round( float(r[1] / nearest))) will cause similar effect like (int(nearest * round(float(r[1])/nearest)) * max_width + r[0])
contours.sort(key=lambda r: round( float(r[1] / nearest)))
(int(nearest * round(float(r[1])/nearest)) * max_width + r[0])