how to make marching squares proceed after it finds the first contour?
the contours in the image am working on are going to change quite often and because am in an embedded environment(android/ios) i would like a fast performance solution above all. and using an external library isn't an option.
i tried connected component labeling but never got it to work as i have a PNG which isn't black and white (isn't thresholded) and if am not mistaken the CCL only works on black and white (binary) images.
i thought about saving the blob information to another vector and check if the newly found pixels fall within the earlier found blobs but i don't think that's fast enough as the vector gets filled with more and more blobs it gets more and more expensive to check every blob inside the vector.
which leaves me with my almost finished current approach which is erasing the contours i find and repeat until there's nothing left? but that's my currently used approach which seems expensive too.
and if there is no fast solution then can anyone suggest a different approach...even if that means a different algorithm.
Mark1: i chose marching squares because i only need the outline of the contours even if there are holes in theme.