cv::findContours doesn't append to the OutputArrayOfArrays [closed]
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?
Doc is here and "contours Detected contours" in source image and that's all. There is no issue. If you want to create such array you have to write your own code
Ooh, I get it now lol.
It doesn't do any push back, it just does a rote assignment. So that's why it's overwriting and not appending. Ha, that makes good sense.
Man, I wish there was a function that did that natively but alas, writing my own will simply have to do.
Thank you for the quick reply!