在OPENCV 3中找不到OpenCV 2 Delaunay三角剖分功能
Cannot find OpenCV 2 Delaunay triangulation functions in OpenCV 3
我已经在Ubuntu 16上安装了OpenCV 3.2.0,并在NetBeans 8.2中使用C 开发。我正在尝试以下与OpenCV 2完美搭配的代码。
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <cv.hpp>
#include <highgui.h>
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/imgproc/imgproc_c.h>
#include <vector>
#include <set>
#include <map>
vector< Triangle > CTwoDTriangulation::delaunayDiv(const vector< Point_<T> > & vP, cv::Rect boundRect,
vector<Triangle>& triangles, int& numTriangles, bool lookRight)
{
CvSubdiv2D* subdiv;
int numPts=vP.size();
CvPoint newPoint;
CvMemStorage *storage;
storage = cvCreateMemStorage(0);
subdiv = cvCreateSubdivDelaunay2D( boundRect, storage );
for (size_t e = 0; e<numPts; e++)
{
newPoint=vP.at(e);
if (newPoint.x<(boundRect.x + boundRect.width) && newPoint.y<(boundRect.y + boundRect.height))
cvSubdivDelaunay2DInsert(subdiv, vP.at(e));
}
}
使用OpenCV 3,我会得到以下错误。
../../DraculaFiles/TwoDTriangulation.cpp:4278:60: error: there are no arguments to ‘cvCreateSubdivDelaunay2D’ that depend on a template parameter, so a declaration of ‘cvCreateSubdivDelaunay2D’ must be available [-fpermissive]
subdiv = cvCreateSubdivDelaunay2D( boundRect, storage );
我尝试键入cv ::,并查看可用的功能。但是我没有看到类似于CreateSubdivDelaunay2D。我还进行了Google搜索,以查看OpenCV 3中的CvCreateSubdivDelaunay2D的替换是什么,但找不到任何东西。
cvCreateSubdivDelaunay2D
变成了遗产(delauny三角剖分的整个c-接口也是如此),并且已被删除。对于OPENCV 3,您可以参考cv::SubDiv
类。
相关文章:
- 在OPENCV 3中找不到OpenCV 2 Delaunay三角剖分功能
- 多面体的三角剖分失败
- 如何使用每个顶点的自定义信息创建CGAL约束的delaunay三角测量
- openCV三角剖分点导致NAN值
- Java应用程序中的C 三角剖分库
- 使用CGAL在歧管上进行三角剖分
- 一个二维动态阵列的C++剖分与比较
- visual有人在C++项目中使用过Triangle/Tangle++库吗?(delaunay三角测量)
- 如何从Subdiv2D Delaunay三角测量中获取顶点索引
- OpenCV:如何进行 Delaunay 三角测量并返回邻接矩阵
- OpenCV,C++:Missing Triangles in Delaunay三角测量
- 如何在约束delaunay三角剖分中获取三角形的顶点
- 如何对简单多边形进行delaunay三角剖分并找到它'cgal中任何三角形的s邻居
- OpenCV:从Delaunay三角剖分中提取三角形
- 使用单调多边形的多边形三角剖分
- 三角剖分3D算法
- Alpha形状来自加权Delaunay三角剖分
- 使用CGAL::Constrained_Delaunay_triangulation_2对多边形进行三角剖分
- 多边形分割vs三角剖分
- 网格二维三角剖分