hi Bearphile! That really gives me an idea.Thanks much for that. Yes as you said the algorithm reaches a maximium recursion depth for larger sets i tried.I still have a question. if m = [[0,0,0,0],[0,1,1,0,0],[0,0,1,0,0],[0,0,0,0]]
all it does is count the number of 1's and return us the number in that cluster. But if I want the box to be considered as one cluster as [[0, 0, 0, 0, 0], +-----+ [0,|1, 1,|0, 0], | | [0,|0, 1,|0, 0], +-----+ [0, 0, 0, 0, 0]] because it could be that the 0 in between the cluster of ones is a part of the group.So the area of this boundingbox is 4 rather than 3. Do you see where I am heading -- http://mail.python.org/mailman/listinfo/python-list