opencv 学习一安装环境
Posted kabe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了opencv 学习一安装环境相关的知识,希望对你有一定的参考价值。
参考博客
http://www.cnblogs.com/skyfsm/p/6840202.html
针对 模块计算机类型“X64”与目标计算机类型“X86”这个问题,我使用cmake 对环境的工程进行设置;主要是
....cmake311incmake.exe -D WIN32=1 -G "Visual Studio 14 Win64" 通过Win64配置环境为x64。
CMakeLists.txt文件:
Project(lesson1)
cmake_minimum_required(VERSION 3.11.0)
set(opencv_include_dir C:/opencv/build/include
C:/opencv/build/include/opencv
C:/opencv/build/include/opencv2
)
set(opencv_lib_dir C:/opencv/build/x64/vc14/lib)
if(WIN32)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
endif(WIN32)
set(source_files main.cpp
)
include_directories(./
${opencv_include_dir})
link_directories(${opencv_lib_dir})
add_executable(lesson1 ${source_files})
target_link_libraries(lesson1 opencv_world310d.lib)
envconfig.bat文件
cd /d "%~dp0"
mkdir build
mkdir install
cd build
....cmake311incmake.exe -D WIN32=1 -G "Visual Studio 14 Win64" --build ..cd ..
pause
目录结构:
opencv/cmkae311
opencv/lesson1
opencv/lesson1/CMakeLists.txt
opencv/lesson1/envconfig.bat
opencv/lesson1/main.cpp
以上是关于opencv 学习一安装环境的主要内容,如果未能解决你的问题,请参考以下文章
Python 大白从零开始 OpenCV 学习课-1.安装与环境配置
OpenCV4机器学习:OpenCV4+VS2017环境搭建与配置
Linux学习OpenCV+ROS 实现人脸识别(Ubantu16.04)