Quote Originally Posted by Vaphell View Post
what do you mean by list of increasing dimensions? you copy the data over for further division?
if so you can work on a single global instance of your image data and calculate only bounding boxes recursively ( so the function would use only coordinates as parameters -> cut( top_y, bottom_y, left_x, right_x ) ). Inside the function only the subset of pixels would be tested, x from leftx to rightx, y from bottomy to topy. Add results to some global list that is used to actually cut the stuff out of the input image at the end.



and yeah, all these exceptions are nasty - though nobody said that the pattern recognition is easy
I think thats what I will do. My current way of storing the crop coordinates is by using lists inside lists.

1 dimension - [(top_x, top_y, bottom_x, bottom_y)]
2 dimensions - [[(top_x, top_y, bottom_x, bottom_y), (top_x, top_y, bottom_x, bottom_y)], [(top_x, top_y, bottom_x, bottom_y), (top_x, top_y, bottom_x, bottom_y), (top_x, top_y, bottom_x, bottom_y)]]
3 dimensions - [[[(top_x, top_y, bottom_x, bottom_y)], [(top_x, top_y, bottom_x, bottom_y), (top_x, top_y, bottom_x, bottom_y)]], [[(top_x, top_y, bottom_x, bottom_y)]]]

Each dimension is added when I scan in the next direction. This was to be able to trace the route of the cropping so I can see where each section of a crop comes from but it does create a few annoying problems so I think I'll just have a 1 dimensional list containing all the boxes.

Thanks