stasm icon indicating copy to clipboard operation
stasm copied to clipboard

problem with opencv 3.0

Open rinoa89 opened this issue 11 years ago • 11 comments

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

rinoa89 avatar Feb 18 '14 21:02 rinoa89

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.

juan-cardelino avatar Feb 19 '14 14:02 juan-cardelino

Hi, Thank you very much for your work and for your help!

rinoa89 avatar Feb 19 '14 17:02 rinoa89

I won't pass a lot of time untill we try this. I will let you know if I manage to make it work.

juan-cardelino avatar Feb 19 '14 17:02 juan-cardelino

I have the same problem. Is there any way to get STASM running with OpenCV 3.0?

prouast avatar Jul 09 '15 00:07 prouast

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.

juan-cardelino avatar Mar 04 '16 12:03 juan-cardelino

I have managed to compile STASM perfectly with opencv 3.0 here

cornyachtsorry avatar Mar 04 '16 14:03 cornyachtsorry

Hi there, good to hear that you were able to do it. Did you need to modify the source code or just compilation options?

juan-cardelino avatar Mar 08 '16 09:03 juan-cardelino

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).

cornyachtsorry avatar Mar 08 '16 10:03 cornyachtsorry

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.

juan-cardelino avatar Apr 18 '16 23:04 juan-cardelino

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

xiaoxiaozhu5 avatar Jun 08 '17 03:06 xiaoxiaozhu5

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.

ririya avatar Mar 02 '18 00:03 ririya