如何在c++中初始化OpenCV中的轮廓
How to initialize contour in OpenCV in C++
我想在0
中使用drawContours函数 vector<vector<Point> > contours;
如何将以下(x,y)分配给变量轮廓?
x = [194, 253, 293, 245]
y = [72, 14, 76, 125]
有谁能帮我吗? 在c++ 11中,你可以很容易地初始化你的contours
向量:
vector<vector<Point>> contours = {{{194, 72}, {253, 14}, {293, 76}, {245, 125}}};
注意contours
是轮廓的vector
,其中每个轮廓都是vector<Point>
。这是一个包含点的容器
这段代码能帮到你吗?
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);
相关文章:
- 如何在OpenCV中存储部分轮廓点喜欢新矢量中的左侧,该类型为<vector<vector<Point>>
- Opencv 时刻没有成员命名 m00,同时试图确定轮廓的中心
- OpenCV : findcontours() , 太多的外部轮廓
- 查找从轮廓到点OPENCV C 的距离
- 在 OpenCV 和 C++ 中查找距轮廓中心最近的黑色像素
- 排序矩形轮廓OPENCV
- 如何使用 OpenCv 从图像中"cut"轮廓?
- OpenCV c++ 断言失败调用绘制轮廓
- 过滤不需要的轮廓-C 的OPENCV
- 在OpenCV中使用遮罩和ROI计算轮廓内浮器的图像像素值(例如平均值)
- OpenCV C++:按轮廓区域对轮廓进行排序
- 在OpenCV C/C++中只过滤出一个轮廓
- 如何在 OpenCv 中使用 HSV 阈值和轮廓从图像中提取皮肤
- OpenCV查找近距离物体的轮廓
- 将 OpenCV 轮廓从 JNI C++ 函数传递到 Android 中的 Java
- 如何将 OpenCV 轮廓平滑添加到现有缓冲区
- 在C++中订购 OpenCv 轮廓
- OpenCV轮廓时刻
- 从Blob检测中提取OpenCV轮廓阵列
- 我如何计算手指的数量?(openCV +轮廓检测)