gishi523 / semi-global-matching

An implementation of Semi-Global Matching (SGM) on CPU with some optimizations
MIT License
64 stars 20 forks source link

Errors executing `make` #1

Closed kristijanbartol closed 6 years ago

kristijanbartol commented 6 years ago

Hi,

I cloned repo, followed your build instructions, but got errors on step executing make:

/home/kristijan/semi-global-matching/semi_global_matching.cpp:38:1: error: explicit template specialization cannot have a storage class
 static inline int HammingDistance(uint64_t c1, uint64_t c2) { return static_cast<int>(popcnt64(c1 ^ c2)); }
 ^
/home/kristijan/semi-global-matching/semi_global_matching.cpp:41:1: error: explicit template specialization cannot have a storage class
 static inline int HammingDistance(uint32_t c1, uint32_t c2) { return static_cast<int>(popcnt32(c1 ^ c2)); }
 ^
/home/kristijan/semi-global-matching/semi_global_matching.cpp: In function ‘void scanCost(const cv::Mat_<_Tp>&, const cv::Mat_<_Tp>&, cv::Mat1w&, int, int, int, int)’:
/home/kristijan/semi-global-matching/semi_global_matching.cpp:199:31: error: expected primary-expression before ‘>’ token
   const T* _census1 = C1.ptr<T>(vc);
                               ^
/home/kristijan/semi-global-matching/semi_global_matching.cpp:200:31: error: expected primary-expression before ‘>’ token
   const T* _census2 = C2.ptr<T>(vc);
                               ^
CMakeFiles/sgm.dir/build.make:62: recipe for target 'CMakeFiles/sgm.dir/semi_global_matching.cpp.o' failed
make[2]: *** [CMakeFiles/sgm.dir/semi_global_matching.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/sgm.dir/all' failed
make[1]: *** [CMakeFiles/sgm.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
gishi523 commented 6 years ago

HI,

Thank you for your information !! I got same erros, and I now fixed.

https://github.com/gishi523/semi-global-matching/compare/23046f3a16238dc4dff19e834d6ae4b93392967f...3aaeeae3778616662cc5bbd1a695b1f5467cae0e

Please check again. Regards,

kristijanbartol commented 6 years ago

Thank you for quick fix! I also had to comment out this line in semi_global_matching.cpp: CV_Assert(I1.type() == CV_8U && I2.type() == CV_8U); as I didn't manage to find appropriate images nor convert them to this format.