Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i don't think, there's a straightforward way to do this at all.

first, you can't simply put a CvChain into a cv::Mat. even if you manage to extract the contents via c-api macros (shudder), this chain consists of a cvPoint, and freeman-chain bytes, so 2 totally different datatypes, which can't go into a single Mat.

then, each of your contours will have a different length, which is not acceptable input for machine learning.

i don't think, there's a straightforward way to do this at all.

first, you can't simply put a CvChain into a cv::Mat. even if you manage to extract the contents via c-api macros (shudder), this chain consists of a cvPoint, and freeman-chain bytes, so 2 totally different datatypes, which can't go into a single Mat.

then, each of your contours will have a different length, which is not acceptable input for machine learning.

image description