I just found out that the OpenCV package that installed from sudo apt install libopencv-dev
is opencv4
which is located in \usr\include
. And under that opencv4
folder, guess what we have? Yes, the opencv2
folder.
So to overcome this problem when you change the OPENCV= 1
on Makefile and show up **fatal error** opencv2/core/version.hpp: No such file or directory
All the thing you need to do is just change on the line 45, 46
45 LDFLAGS+= `pkg-config --libs opencv` -lstdc++
46 COMMON+= `pkg-config --cflags opencv`
to
LDFLAGS+= `pkg-config --libs opencv4` -lstdc++
COMMON+= `pkg-config --cflags opencv4`
Conclusion: Just install OpenCV by sudo apt-get install libopencv-dev
, change opencv
on line 45, 46 on Makefile to opencv4
.
No package 'opencv' found · Issue #2280 · pjreddie/darknet · GitHub