linux下搭建opencv 4.5开发环境及Demo
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
1.centos
2.官网下载源码
https://github.com/opencv/opencv/tagshttps://github.com/opencv/opencv/tags3.解压
unzip opencv-4.5.5.zip
cd opencv-4.5.5
4.配置
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/data1/xxx/workspace/opencv/output ..
其中,CMAKE_BUILD_TYPE指定Release或者Debug
CMAKE_INSTALL_PREFIX指定编译以后,安装的目录
.. (点点)指定opencv源码更目录
更多配置选项,参考官网:
由于本机已经存在了ffmpeg的老版本,导致编译报错,不想动老版本,于是把ffmepg禁用掉
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/data1/xxx/workspace/opencv/output -D WITH_FFMPEG=OFF ..
5.编译
make
make install
6.hello opencv
cd ..
mkdir demo
cd demo
vim cvdemo.cpp
//cvdemo.cpp
#include "opencv2/opencv.hpp"
int main()
{
printf("hello opencv!\r\n");
return 0;
}
build:
g++ -g -Wall -std=c++11 cvdemo.cpp -o cvdemo -I../output/include/opencv4/ -L../output/lib64 -lopencv_ml -lopencv_core
执行
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data1/moon/workspace/opencv/output/lib64/
~/workspace/opencv/mixdemo$ ./cvdemo
hello opencv!




A beautiful web dashboard for Linux
最近提交(Master分支:5 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)