广州网站推广策划,中国建设部网官方网站,网站给假冒伪劣产品做推广,搜索引擎seo推广目的
这是用用QTopencv实现的一个完整的展示图片的例子#xff0c;包括了项目的配置文件#xff0c;完整的代码#xff0c;以用做初次学习opencv用。
代码
工程文件#xff1a;
QT core guigreaterThan(QT_MAJOR_VERSION, 4): QT widgetsTARGET openCv1
TEMPL…目的
这是用用QTopencv实现的一个完整的展示图片的例子包括了项目的配置文件完整的代码以用做初次学习opencv用。
代码
工程文件
QT core guigreaterThan(QT_MAJOR_VERSION, 4): QT widgetsTARGET openCv1
TEMPLATE app# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES QT_DEPRECATED_WARNINGS# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES QT_DISABLE_DEPRECATED_BEFORE0x060000 # disables all the APIs deprecated before Qt 6.0.0CONFIG c11INCLUDEPATH E:\openSource\opencv\opencv\build\include
INCLUDEPATH E:\openSource\opencv\opencv\build\include\opencv
INCLUDEPATH E:\openSource\opencv\opencv\build\include\opencv2SOURCES \main.cpp \mainwindow.cppHEADERS \mainwindow.hFORMS \mainwindow.ui#win32: LIBS -L$$PWD/../../../openSource/opencv/opencv/build/x64/vc14/lib/ -lopencv_world310
LIBS -LE:\openSource\opencv\opencv\build\x64\vc14\lib\ -lopencv_world455
#LIBS -LE:\openSource\opencv\opencv\build\x64\vc14\lib\ -lopencv_world455d# Default rules for deployment.
qnx: target.path /tmp/$${TARGET}/bin
else: unix:!android: target.path /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS target代码文件
//#include mainwindow.h
#pragma execution_character_set(utf-8)
#include QApplication
#include QDebug
#include opencv2/opencv.hpp
using namespace cv;
int main(int argc, char *argv[])
{QApplication a(argc, argv);//MainWindow w;//w.show();QString str QString::fromUtf8(E:\\temp\\lushanjing3.jpg);qDebug()str;Mat img imread(str.toStdString());//图片路径//处理前imshow(img,img);//显示图片Mat resimg;//高斯模糊cv::GaussianBlur(img,resimg,Size(5,5),0);imshow(resimg,resimg);//显示图片waitKey(2000);//等待按键return a.exec();运行情况