I have installed OpenCV 3.2.0 on Ubuntu 16 and am developing using C++ in NetBeans 8.2. I am trying the following code which worked perfectly with 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));
}
}
With OpenCV 3, I get the following errors.
../../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 );
I tried typing cv:: and seeing what functions are available. But I saw nothing similar to CreateSubdivDelaunay2D. I have also done a Google search to see what has replaced cvCreateSubdivDelaunay2D in OpenCV 3 but could not find anything.