Skip to content

Instantly share code, notes, and snippets.

@FlandreDaisuki
Last active February 18, 2016 17:52
Show Gist options
  • Save FlandreDaisuki/26a3b58f148a189e4bbf to your computer and use it in GitHub Desktop.
Save FlandreDaisuki/26a3b58f148a189e4bbf to your computer and use it in GitHub Desktop.
#include <iostream>
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat imageMe = imread("img/a.jpg");
if (!imageMe.data)
{
std::cout << "Image not loaded";
return -1;
}
namedWindow("Display Image", WINDOW_AUTOSIZE);
imshow("Display Image", imageMe);
waitKey(0);
return 0;
}

安裝程式

  1. OpenCV
  2. VisualStudio2015

設定環境變數

  1. OPENCV_DIR:C:\opencv\build\x86\vc12;
  2. PATH:%OPENCV_DIR%\bin;

Visual Studio 2015 專案設定

專案屬性

  1. C/C++ ==> 其他的include目錄:$(OPENCV_DIR)\..\..\include
  2. 連結器 ==> 一般 ==> 其他資料庫連結:$(OPENCV_DIR)\lib
  3. 連結器 ==> 輸入 ==> 其他相依性:
opencv_ts300.lib
opencv_ts300d.lib
opencv_world300.lib
opencv_world300d.lib

組態

Release mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment