stasm
stasm copied to clipboard
problem with opencv 3.0
Hi! I have use your work for compile stasm when i have opencv 2.4.8 and it work perfecly but now that i have install opencv 3.0 i dosn't able to compile stasm anymore.
when i do "make" command, it give me back this error: Scanning dependencies of target stasm [ 4%] Building CXX object CMakeFiles/stasm.dir/stasm/MOD_1/facedet.cpp.o In file included from /home/rinoavm/stasm4.1.0/stasm/MOD_1/../stasm.h:58:0, from /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp:5: /home/rinoavm/stasm4.1.0/stasm/MOD_1/../misc.h:460:9: error: variable or field ‘OpenDetector’ declared void /home/rinoavm/stasm4.1.0/stasm/MOD_1/../misc.h:460:5: error: ‘CascadeClassifier’ is not a member of ‘cv’ /home/rinoavm/stasm4.1.0/stasm/MOD_1/../misc.h:460:28: error: ‘cascade’ was not declared in this scope /home/rinoavm/stasm4.1.0/stasm/MOD_1/../misc.h:461:5: error: expected primary-expression before ‘const’ /home/rinoavm/stasm4.1.0/stasm/MOD_1/../misc.h:462:5: error: expected primary-expression before ‘const’ /home/rinoavm/stasm4.1.0/stasm/MOD_1/../misc.h:466:9: error: ‘cv::CascadeClassifier’ has not been declared /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp:11:8: error: ‘CascadeClassifier’ in namespace ‘cv’ does not name a type /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp: In member function ‘void stasm::FaceDet::OpenFaceDetector_(const char_, void_)’: /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp:22:18: error: ‘facedet_g’ was not declared in this scope /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp:22:73: error: ‘OpenDetector’ was not declared in this scope /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp: In function ‘void stasm::DetectFaces(stasm::vec_DetPar&, const Image&, int)’: /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp:48:5: error: ‘facedet_g’ was not declared in this scope /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp:58:26: error: ‘equalizeHist’ is not a member of ‘cv’ /home/rinoavm/stasm4.1.0/stasm/MOD_1/facedet.cpp:72:31: error: ‘facedet_g’ was not declared in this scope make[2]: *** [CMakeFiles/stasm.dir/stasm/MOD_1/facedet.cpp.o] Errore 1 make[1]: *** [CMakeFiles/stasm.dir/all] Errore 2 make: *** [all] Errore 2
thanks in advance
Dear rinoa89, This is a volunteer work I do on my spare time. I use stasm for my work and when I get time I try to contribute, but I'm not related in any way with the author of the library. In particular I didn't have the time yet to test my stuff or STASM against OpenCV 3.0. As soon as I get time I will post it here. Anyway, I forwarded your concern to the original author, maybe he can give you some insight. Thanks for the feedback.
Hi, Thank you very much for your work and for your help!
I won't pass a lot of time untill we try this. I will let you know if I manage to make it work.
I have the same problem. Is there any way to get STASM running with OpenCV 3.0?
I never tried STASTM with opencv 3.0, and don't know about the original author of the library. Once I do it, I will upload it here, but it is not on the roadmap soon.
I have managed to compile STASM perfectly with opencv 3.0 here
Hi there, good to hear that you were able to do it. Did you need to modify the source code or just compilation options?
I had to modify the source code, especially the headers. This is because some of the modules in opencv 3.0 has been reorganized (more info here).
My current problem is that I don't control STASM source code, thus I can't patch it. However you can submit your modifications to the original author. He usually is fast to answer.
you just modify misc.h in stasm directory. At the top of file, add "#incldue <opencv2/opencv.hpp>". In minimal.cpp and minimal2.cpp replace original #include to #incldue <opencv2/opencv.hpp>. Tested on ubuntu 16.04 x86 OpenCV 3.2
I'm having problems with function cascace.detectMultiScale(), on OpenCV versions later than 3.0... On version 2.4 it works fine... But on more recent versions, i get a segmentation fault.
Something like:
Exception thrown at 0x000007FEC2B31F72 (opencv_world340d.dll) in HairSwapping.exe: 0xC0000005: Access violation reading location 0x00000000004A8000.