divide image into columns and give min distance for each