下载配置darknet
下载darknet
解压后修改MakeFile文件的OPENCV=1并且执行make
运行demo
可能出现如下问题:
fatal error: darknet.h: No such file or directory
将darknet里的include文件夹复制到项目里
在项目中编写cmakelists文件
cmake_minimum_required(VERSION 3.14)
project(Test)
set(CMAKE_CXX_STANDARD 14)
# 配置opencv
set(OpenCV_DIR /usr/local/share/OpenCV)
find_package(OpenCV REQUIRED)
# 导入头文件
include_directories(include)
add_executable(Test main.cpp imprcoess.h imprcoess.cpp)
# 链接动态链接库
link_directories(/home/dong/darknet-master/libdarknet.so)
target_link_libraries(Test ${OpenCV_LIBS} /home/dong/darknet-master/libdarknet.so)
运行可能会出现如下错误
/usr/bin/ld: cannot find -llibs/libdarknet.so
感谢 zhming
解决有二:</