zoukankan      html  css  js  c++  java
  • Compile OpenCV 2.4.2 for Win 7 (64 bit) by using CMake+VS 2010

    Tested on: VS 2010 + Win 7 (64 bit)

    (1) Download OpenCV 2.4.2 (link)

    (2) Unzip opencv2.4.2.exe to a directory, take mine for example: E:\OpenCV_src

    图像 1

    (3) Download and Install Cmake (for windows platform, win32  installer) since you need compile OpenCV by yourself when using Win 7 (64 bit). (link)

    (4) Run cmake-gui.exe. The settings are shown in the figure. Push “Configure” button and select “Vusal Studio”, then Generate.

    图像 2

    (5) Find Opencv.sln in E:\OpenCV, then open it with VS 2010.

    (6) Solution Explorer – Solution OpenCV, Rught Click, “Rebuild Solution”. If no errors, select “INSTALL” and “Build”.

    (7) Set Environment Variables.

    Path: E:\OpenCV\install\bin;E:\OpenCV\install\include;E:\OpenCV\install\lib;

    TBB: E:\OpenCV_src\opencv\build\common\tbb\intel64\vc10;

    At last, test the following codes in Debug mode and x64 platform!

    btw, put the image file ppl.jpg in the code folder.

    #include "stdafx.h"
    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
     
    #pragma comment( lib, "opencv_core242d.lib ")
    #pragma comment( lib, "opencv_highgui242d.lib" )
     
    using namespace cv;
     
    int _tmain(int argc, _TCHAR* argv[])
    {
        namedWindow( "show_image", WINDOW_AUTOSIZE );
        Mat src = imread( "ppl.jpg" );
        while(1)
        {
            imshow( "show_image", src );
            char c = waitKey(0);
            if( 27 == c )
                return 0;
        }
        return 0;
    }
  • 相关阅读:
    6.Mysql之MGR的限制和局限性
    5.Mysql之MGR原理浅谈02
    2.shell之cut详解
    1.Shell编程的基本语法01
    4.Mysql之MGR浅谈01
    3.Mysql之MHA实战(03)
    2.Mysql之高可用架构MHA(02)
    1.数据库的三大范式是什么?
    1.Mysql之主从复制浅谈01
    6.Mydumper和Myloader备份恢复
  • 原文地址:https://www.cnblogs.com/youth0826/p/2635684.html
Copyright © 2011-2022 走看看