I have an image like this

Now I have the centroid of the bounding box and I want to sort them in row-wise order as in images 3 and 5 are changed.
How to solve it
I have used euclidian distance and python OpenCV
| 1 | initial version |
I have an image like this

Now I have the centroid of the bounding box and I want to sort them in row-wise order as in images 3 and 5 are changed.
How to solve it
I have used euclidian distance and python OpenCV