Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 2015-08-17 10:41:20 -0600

Nbb gravatar image

drawContours vector<point>

Hello forum,

I have a vector of class Object , each containing a single contour.

vector<Object> People;

Class Object {

private:
vector<Point> contour;

public:
vector<Point> get_Contour { return contour; }
};

I am having problems trying to draw the contour using the drawContours function

for (int i = 0; i < People.size(); i++)
            drawContours(display, People[i].get_Contour(), -1, Scalar(255, 255, 255), 1, 8, noArray(), 2147483647 , Point());

OpenCV Error: Assertion failed (i < 0) in cv::_InputArray::getMat_, file C:\builds\master_PackSlave-win64-vc12-shared\opencv\modules\core\src\matrix.cpp, line 1151

How its done in the tutorial is that a vector< vector< Point>> is passed. However I only have one contour, a vector< Point>. I hope I can get some help on this.