Invert the blobs found from OpenCV

Hi everyone,

I’m working on a triangulation program that pulls blobs from video and triangulates the contour points. I’m stuck on one issue, though. I’m trying to invert the blobs so that I triangulate the points from outside of the contours, rather than the inside. I tried messing around with the ofxCvImage invert() function but I don’t think it’s exactly what I’m looking for.

Any suggestions?

Thanks,
Ian

Ian,

Have you tried inverting the pixels you detected from the camera? Perhaps if you made every black pixel white and vice versa you’d get the blobs you wanted.

http://opencv.wikispaces.com/4)+Inverting+the+Image

Apologies I don’t have a more thorough code example, if I get a chance I’ll post one up.

Yes I have, using the invert() function on the grayscale difference image. Unfortunately, opencv seems to still pick up the same blobs, even when they are black. I also tried messing around with the blob minimum area but it didn’t affect anything.