1. 程式人生 > >[OpenCV]繪製填充輪廓drawContours

[OpenCV]繪製填充輪廓drawContours

複製程式碼
vector<vector<Point> > contours;
contours.push_back(currentFrameEdge);
Mat savedGrayMat = Mat::zeros(RectData[0].rows, RectData[0].cols, CV_8UC1);
//drawMaxAreaLine(savedGrayMat, currentFrameEdge);
//floodFill(savedGrayMat, Point(currentFrameEdge[0].x + 2, currentFrameEdge[0].y + 2), 255);
drawContours(savedGrayMat, contours, 0
, Scalar(255), CV_FILLED); imshow("savedGrayMat", savedGrayMat); waitKey();
複製程式碼