So my goal here is to take an image input and get out a list of the shapes contained in it as an output. Of course, the shapes will not be anything like triangle or square , but just lists of contiguous pixels of like values. My first attempt used a recursive algorithm which roamed the image through paths of like-colored pixels, and added all the ones it could get to to the shape list. This worked for small images, but quickly exceeded the max. recursion depth for larger images.
My current attempt is Iterative, but doesn t want to work. http://pastebin.com/seLbnGE4
Are there any better ways to do it, or are there modules or methods which already exist which would fit my needs?