I want to use drawContours function in O
vector<vector<Point> > contours;
How to assign the following (x,y) to the variable contours?
x = [194, 253, 293, 245]
y = [72, 14, 76, 125]
Can anyone help me out??
I want to use drawContours function in O
vector<vector<Point> > contours;
How to assign the following (x,y) to the variable contours?
x = [194, 253, 293, 245]
y = [72, 14, 76, 125]
Can anyone help me out??
contours
C++11 では、ベクターを簡単に初期化できます。
vector<vector<Point>> contours = {{{194, 72}, {253, 14}, {293, 76}, {245, 125}}};
contours
は等高線の であることに注意してください。vector
ここで、各等高線はvector<Point>
です。つまり、ポイントのコンテナーのコンテナーです。
Is this code can help you ?
vector<Point> firstContour;
firstContour.push_back(Point(194,72));
firstContour.push_back(Point(253,14));
firstContour.push_back(Point(293,76));
firstContour.push_back(Point(245,125));
contours.push_back(firstContour);