linux centos 安装opencv
系统:Centos 6.5
最后版本 OpenCV: 2.4.9
1、安装依赖包(很重要)
yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-help-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm
2.安装/更新CMake
yum install cmake 直接从网上安装cmake
3、安装Opencv
cmake CMakeLists.txt
make
make install
成功
4.编译
g++ `pkg-config --cflags --libs opencv` code.cpp -o drawing
5.makefile编写
########################################### #Makefile for simple programs ########################################### INC=-I./include/ -I/usr/local/include -I/usr/local/include/opencv -I/usr/local/include/opencv2 LIB=-L/usr/local/lib/ -lopencv_core -lopencv_highgui -lpthread -lrt CC=g++ CC_FLAG=-Wall -g PRG=run OBJ=main.o imagerecog.o ocr.o CC_FLAG+=`pkg-config --cflags opencv` LDFLAGS=`pkg-config --libs opencv` $(PRG):$(OBJ) $(CC) $(INC) $(LIB) -o $@ $(OBJ) $(LDFLAGS) .SUFFIXES: .c .o .cpp .cpp.o: $(CC) $(CC_FLAG) $(INC) -c $*.cpp -o $*.o .PRONY:clean clean: @echo "Removing linked and compiled files......" rm -f $(OBJ) $(PRG)
posted on 2017-10-10 19:56 zyz913614263 阅读(536) 评论(0) 编辑 收藏 举报
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步