标签:
Qt 安装
PC 端 下载安装即可 https://mirrors.ustc.edu.cn/qtproject/official_releases/qt
树莓派:Qt开发套件和opencv安装
sudo apt-get install qt4-dev-tools
sudo apt-get install libopencv-dev
PC上开发好后考到树莓派上,修改pro的链接库和头文件目录
TEMPLATE = app CONFIG += console CONFIG -= app_bundle CONFIG -= qt SOURCES += main.cpp INCLUDEPATH += /usr/include INCLUDEPATH += /usr/include/opencv # debug LIBS += -L/usr/lib -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_video include(deployment.pri) qtcAddDeployment()
测试程序
#include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main(int argc, char **argv) { Mat im = imread(argv[1]); Mat gray; cvtColor(im, gray, CV_RGB2GRAY); imwrite ("gray.jpg",gray); return 0; }
qmake Rpi.pro
make
多出了gray.jpg这幅图像。
成功
标签:
原文地址:http://www.cnblogs.com/yuliyang/p/4569573.html