Ask Your Question

Revision history [back]

With this code :

Mat Mask = Mat(100, 100, CV_8UC1, cv::Scalar(0));
const vector<Point> obj_corners = { Point(10, 20), Point(10, 40), Point(40, 40), Point(40, 10) };
const vector< vector<Point> >  co_ordinates = { obj_corners };
drawContours(Mask, co_ordinates, 0, Scalar(255), CV_FILLED);
imshow("rrrrr", Mask);
waitKey();

image description

With this code :

Mat Mask = Mat(100, 100, CV_8UC1, cv::Scalar(0));
const vector<Point> obj_corners = { Point(10, 20), Point(10, 40), Point(40, 40), Point(40, 10) };
const vector< vector<Point> >  co_ordinates = { obj_corners };
drawContours(Mask, co_ordinates, 0, Scalar(255), CV_FILLED);
imshow("rrrrr", Mask);
waitKey();

image descriptionimage description