alessandroferrari / BING-Objectness

Python implementation of BING Objectness method from "BING: Binarized Normed Gradients for Objectness Estimation at 300fps".
62 stars 20 forks source link

Make error: NumpyAllocator and cvMat.refcount #2

Open lihongchun2007 opened 9 years ago

lihongchun2007 commented 9 years ago

When making the code, i get several errors about NumpyAlloctor and cvMat.refcount. My machine is running on ubuntu 14.04.1, and opencv is from official repository, maybe opencv 2.4.

I think is problem is caused by wrong version of opencv. What version of opencv you are using?

The first kind of error is

/home/traffic/caffe/R-CNN-Object-detection-master/BING-Objectness/source/cpp/custom_liblinear_wrapper/py_liblinear.cpp:171:16: error: cannot declare variable ‘g_roicropping_numpyAllocator’ to be of abstract type ‘NumpyAllocator’
 NumpyAllocator g_roicropping_numpyAllocator;

Parent class of NumpyAllocator is MatAllocator, which is an abstract class. I check the source code of my opencv, NumpyAllocator has not implement several virtual function of MatAllocator. So NumAllocator is still an abstract class, can not be instantiated.

The second kind of error is

/home/traffic/caffe/R-CNN-Object-detection-master/BING-Objectness/source/cpp/custom_liblinear_wrapper/py_liblinear.cpp:252:11: error: ‘class cv::Mat’ has no member named ‘refcount’
         m.refcount = *refcountFromPyObject(o);

In source code of my opencv, refcount is not a member of cv::Mat. It is wrapped in UMatData* u, which is member of cv::Mat.

alessandroferrari commented 9 years ago

Are you sure about OpenCV version? Current version on master branch is 3.0 now

lihongchun2007 commented 9 years ago

Sorry, it's my mistake. I actually have two versions of opencv installed my machine. Still trying to solve the problem.

So you are using 3.0?

alessandroferrari commented 9 years ago

I have tried only with 2.4 (few tags), never tried with OpenCV 3. Which version are you using?

lihongchun2007 commented 9 years ago

i think it's using opencv 3.

alessandroferrari commented 9 years ago

Ok, I do not know whether the python wrapping would work the same in OpenCV 3. Let me know if you figure out.

lihongchun2007 commented 9 years ago

Successfully compile the source code in another machine, ubuntu 14.04 and opencv.24.

alessandroferrari commented 9 years ago

Ok, thank you. Now I know it is not compatible with OpenCV 3.