C++ 利用vlfeat库实现超像素分割面临的困难
我在超级像素分割上看到了这个答案 <>我想知道在哪里可以找到在那里讨论的新的C++ API。 事实上我是从 这是我的代码:C++ 利用vlfeat库实现超像素分割面临的困难,c++,opencv,vlfeat,C++,Opencv,Vlfeat,我在超级像素分割上看到了这个答案 我想知道在哪里可以找到在那里讨论的新的C++ API。 事实上我是从 这是我的代码: #include<opencv2/highgui/highgui.hpp> #include<opencv2/imgproc/imgproc.hpp> extern "C"{ #include<C:\\vlfeat\vl\slic.h> #include"C:\\vlfeat\vl\slic.c" } using namespace cv;
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
extern "C"{
#include<C:\\vlfeat\vl\slic.h>
#include"C:\\vlfeat\vl\slic.c"
}
using namespace cv;
int main()
{
Mat img=imread("E:\\brush.jpg");
Mat floatimg;
img.convertTo(floatimg,CV_32FC3);
Mat label(floatimg.size(),CV_32SC1);
vl_slic_segment(label.ptr<vl_uint32>(),floatimg.ptr<float>(),floatimg.cols,floatimg.rows,floatimg.channels(),15,0.1,1);
imshow("out", img);
waitKey(0);
}
如果你只是为了超级像素而使用vlfeat,你可能也可以使用Check来检查它所在的头文件是什么,你能用代码解释一下吗?例如,在OpenCV种子上,你可以检查哦。。。在OpenCV 3.1中,还有
Error 2 error C2440: '=' : cannot convert from 'void *' to 'float *' c:\vlfeat\vl\slic.c 203
Error 3 error C2440: '=' : cannot convert from 'void *' to 'vl_uint32 *' c:\vlfeat\vl\slic.c 204
Error 4 error C2440: '=' : cannot convert from 'void *' to 'float *' c:\vlfeat\vl\slic.c 205
Error 8 error C2440: 'initializing' : cannot convert from 'void *' to 'vl_uint32 *' c:\vlfeat\vl\slic.c 341
Error 9 error C2440: 'initializing' : cannot convert from 'void *' to 'vl_uindex *' c:\vlfeat\vl\slic.c 342
11 IntelliSense: a value of type "void *" cannot be assigned to an entity of type "float *" c:\vlfeat\vl\slic.c 203
12 IntelliSense: a value of type "void *" cannot be assigned to an entity of type "vl_uint32 *" c:\vlfeat\vl\slic.c 204
13 IntelliSense: a value of type "void *" cannot be assigned to an entity of type "float *" c:\vlfeat\vl\slic.c 205
14 IntelliSense: a value of type "void *" cannot be used to initialize an entity of type "vl_uint32 *" c:\vlfeat\vl\slic.c 341
15 IntelliSense: a value of type "void *" cannot be used to initialize an entity of type "vl_uindex *" c:\vlfeat\vl\slic.c 342