Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv::findContours doesn't append to the OutputArrayOfArrays

OpenCV somehow seems intelligent enough to resize my std::vector<std::vector<cv::Point>> from a size of 0 to however many contours it finds in an image _but_ it seems like it does not append to the container.

For example, I'm trying to build a set of known good contours from multiple images. Using this, I can read in contours from other images and compare the match of the contours. We have a specifically controlled environment where all of our images are of the same kinds of objects against the same background so this Just Works in practice.

But it seems like cv::findContours will _overwrite_ the output sequence instead of appending to it!

Is this a known issue? Is there a work around for this?