自己编译ncnn,yolov3示例,cmake

cmake_minimum_required(VERSION 3.0)
project(yolov3)
aux_source_directory(. SRC_LIST)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/)

find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})

include_directories(/home/gear/big_disk_c/wangjd/ncnn/build/install/include/ncnn)


set(ncnn_DIR "/home/gear/big_disk_c/wangjd/ncnn/build/install/lib/cmake/ncnn" CACHE PATH "Directory that contains ncnnConfig.cmake")
find_package(ncnn REQUIRED)

add_executable(yolov3 ${SRC_LIST})

target_link_libraries(yolov3 ${OpenCV_LIBS} ncnn )

基本上两点,导入opencv和ncnn的头文件,链接opencv和ncnn的动态库

自己编译ncnn,yolov3示例,cmake_第1张图片
自己编译ncnn,yolov3示例,cmake_第2张图片
在这里插入图片描述

你可能感兴趣的:(opencv,计算机视觉)