jimmie33 / Hierarchy_Ensemble

9 stars 5 forks source link

Template argument deduction/substitution failed #1

Closed euwern closed 8 years ago

euwern commented 8 years ago

I tried to compile the program using Opencv 3.0 and I get a bunch of template argument deduction/substitution failed error. (see one of the error below)

Can you shed some light on how to fix the error?

In file included from /usr/local/include/opencv2/core.hpp:58:0,
                 from /usr/local/include/opencv2/opencv.hpp:48,
                 from /home/user1/Downloads/jimmie33-Hierarchy_Ensemble-9ba3e16/tracker.h:31:
/usr/local/include/opencv2/core/types.hpp:960:14: note: template<class _Tp> cv::Complex<_Tp> cv::operator*(const cv::Complex<_Tp>&, const cv::Complex<_Tp>&)
 Complex<_Tp> operator * (const Complex<_Tp>& a, const Complex<_Tp>& b)
              ^
/usr/local/include/opencv2/core/types.hpp:960:14: note:   template argument deduction/substitution failed:
/home/user1/Downloads/jimmie33-Hierarchy_Ensemble-9ba3e16/tracker.h:147:74: note:   ‘cv::MatCommaInitializer_<float>’ is not derived from ‘const cv::Complex<_Tp>’
   kf.correct(*(Mat_<float>(2,1)<<win.x+0.5*win.width,win.y+0.5*win.height));
jimmie33 commented 8 years ago

Please try using OpenCV 2.X to compile it.

euwern commented 8 years ago

I realise that opencv changes their GPU module in 3.0.

I have uninstall opencv 3.0 and download the source code of opencv.2.4.11 http://opencv.org/downloads.html.

can you share your opencv installation cmake flag so that I can replicate your environment?

jimmie33 commented 8 years ago

I cannot find it right now, but I used the default CMake file included in the opencv package with minor changes, like enabling ffmpeg etc. As long as the opencv can read videos and images, the flags should not matter.

euwern commented 8 years ago

hi jimmie33,

I managed to install opencv2.4.11, the compile fails at the following: Can you tell me what causes munkres.h.o file not recognized?? how can i fix it?

[ 82%] Building CXX object CMakeFiles/Hierarchy_Ensemble.dir/tracker.cpp.o
[ 88%] Building CXX object CMakeFiles/Hierarchy_Ensemble.dir/appTemplate.cpp.o
[ 94%] Building CXX object CMakeFiles/Hierarchy_Ensemble.dir/multiTrackAssociation.cpp.o
[100%] Building CXX object CMakeFiles/Hierarchy_Ensemble.dir/main.cpp.o
Linking CXX executable Hierarchy_Ensemble
CMakeFiles/Hierarchy_Ensemble.dir/munkres.h.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[2]: *** [Hierarchy_Ensemble] Error 1
make[1]: *** [CMakeFiles/Hierarchy_Ensemble.dir/all] Error 2
make: *** [all] Error 2
jimmie33 commented 8 years ago

The linking should not involve munkre.h.o. Can you past the MakeFile generated using CMake?

euwern commented 8 years ago

Here's the generated makefile. (I just renamed the filename extension so that I could upload to this comment). Makefile.txt

jimmie33 commented 8 years ago

I updated the CMakeList.txt file. It should work now.

euwern commented 8 years ago

Thank you. with the new CMakeLists.txt file I am able to compile and run the program successfully.