最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

在Qt Creator中使用Opencv 2

来源:动视网 责编:小OO 时间:2025-10-02 18:46:25
文档

在Qt Creator中使用Opencv 2

在QtCreator中使用Opencv2.3分类: 数字图像处理 Qt2012-04-1817:21 104人阅读 评论(0) 收藏 举报打开Qt项目中的.pro文件,添加如下代码INCLUDEPATH+=D:\\OpenCV\\opencv\\build\include\\opencv2\D:\\OpenCV\\opencv\\build\include\\opencv\D:\\OpenCV\\opencv\\build\includeCONFIG(release,debug|release
推荐度:
导读在QtCreator中使用Opencv2.3分类: 数字图像处理 Qt2012-04-1817:21 104人阅读 评论(0) 收藏 举报打开Qt项目中的.pro文件,添加如下代码INCLUDEPATH+=D:\\OpenCV\\opencv\\build\include\\opencv2\D:\\OpenCV\\opencv\\build\include\\opencv\D:\\OpenCV\\opencv\\build\includeCONFIG(release,debug|release
在Qt Creator中使用Opencv 2.3

分类: 数字图像处理 Qt2012-04-18 17:21 104人阅读 评论(0) 收藏 举报

打开Qt项目中的.pro文件,添加如下代码

INCLUDEPATH +=D:\\OpenCV\\opencv\\build\include\\opencv2 \

D:\\OpenCV\\opencv\\build\include\\opencv \

D:\\OpenCV\\opencv\\build\include

CONFIG(release,debug|release)

{

    LIBS += D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_calib3d231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_contrib231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_core231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_features2d231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_flann231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_gpu231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_highgui231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_imgproc231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_legacy231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_ml231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_objdetect231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_ts231.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_video231.lib

}

CONFIG(debug,debug|release)

{

    LIBS +=D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_calib3d231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_contrib231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_core231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_features2d231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_flann231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_gpu231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_highgui231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_imgproc231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_legacy231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_ml231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_objdetect231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_ts231d.lib \

D:\\OpenCV\\opencv\\build\\x86\\vc10\\lib\\opencv_video231d.lib

}

注意,你的代码中的路径要根据OpenCV的具体安装路径做改变。

测试程序

#include 

#include 

using namespace std;

using namespace cv;

int main(int argc, char *argv[])

{

    QCoreApplication a(argc, argv);

    const char* imagename = ;

        //从文件中读入图像

        Mat img = imread(imagename);

        //如果读入图像失败

        if(img.empty())

        {

            fprintf(stderr, "Can not load image %s\\n", imagename);

            waitKey();

            return -1;

        }

        //显示图像

        imshow("image", img);

        //此函数等待按键,按键盘任意键就返回

        waitKey();

    

    return a.exec();

}

文档

在Qt Creator中使用Opencv 2

在QtCreator中使用Opencv2.3分类: 数字图像处理 Qt2012-04-1817:21 104人阅读 评论(0) 收藏 举报打开Qt项目中的.pro文件,添加如下代码INCLUDEPATH+=D:\\OpenCV\\opencv\\build\include\\opencv2\D:\\OpenCV\\opencv\\build\include\\opencv\D:\\OpenCV\\opencv\\build\includeCONFIG(release,debug|release
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top