BertaBescos / DynaSLAM

DynaSLAM is a SLAM system robust in dynamic environments for monocular, stereo and RGB-D setups
https://bertabescos.github.io/DynaSLAM/
Other
830 stars 201 forks source link

Help: virtual functions are pure within ‘DynaSLAM::NumpyAllocator’: #79

Closed katey24 closed 2 years ago

katey24 commented 2 years ago

@BertaBescos Hi,I am a masters student and I have read your paper and trying to implement your code for DynaSlam. It is very impressive code! When trying to run your code, I have fail in the following way as below. I have spent many days researching on the pure virtual classes in MatAllocator with no success. Please help me solve this. Opencv 4.5.5 Python version 2.7 Error:

/home/cate/DynaSLAM/src/Conversion.cc:214:16: error: cannot declare variable ‘DynaSLAM::g_numpyAllocator’ to be of abstract type ‘DynaSLAM::NumpyAllocator’ 214 | NumpyAllocator g_numpyAllocator; | ^~~~ /home/cate/DynaSLAM/src/Conversion.cc:82:7: note: because the following virtual functions are pure within ‘DynaSLAM::NumpyAllocator’: 82 | class NumpyAllocator : public MatAllocator | ^~~~~~

katey24 commented 2 years ago

I answer the question by myself :) by replacing in the conversion.cc file. Changed int accessflags to AccessFlag flags.

UMatData allocate(int dims, const int sizes, int type, void data, size_t step, int flags, UMatUsageFlags usageFlags) const with UMatData allocate(int dims, const int sizes, int type, void data, size_t step, AccessFlag flags, UMatUsageFlags usageFlags) const

AND bool allocate(UMatData u, int accessflags, UMatUsageFlags usageFlags) const with bool allocate(UMatData data, AccessFlag accessflags, UMatUsageFlags usageFlags) const