You don't have javascript enabled. Good luck! :(

This is a test

You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the _posts directory that follows the convention YYYY-MM-DD-name-of-post.ext and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.

Jekyll also offers powerful support for code snippets:

def print_hi(name)
  puts "Hi, #{name}"
end
print_hi('Tom')
#=> prints 'Hi, Tom' to STDOUT.

Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo. If you have questions, you can ask them on Jekyll Talk.

  Dec 25, 2017     WenYuan     OpenCV  UPDATE: Jun 5, 2018

Ubuntu 18.04 安裝 OpenCV 與建置 C++ 編譯環境

跟著以下步驟, 將指令複製貼上執行, 就可以在你的 Ubuntu 上建置編譯 OpenCV C/C++ 的環境

注意: 這只適用在 Linux Debian 以及 MacOS 系統上,Windows 不適用哦!

1. 更新系統

$ sudo apt-get update
$ sudo apt-get upgrade


2. 下載 OpenCV 的相依套件

$ sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install python3.5-dev python3-numpy libtbb2 libtbb-dev
$ sudo apt-get install libjpeg-dev libpng-dev libtiff5-dev libjasper-dev libdc1394-22-dev libeigen3-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common libtbb-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libavutil-dev libavfilter-dev libavresample-dev


3. 下載 OpenCV

$ sudo su
$ cd /opt
$ git clone https://github.com/Itseez/opencv.git
$ git clone https://github.com/Itseez/opencv_contrib.git


4. 編譯與安裝 OpenCV

因為要編譯 OpenCV 以及建置環境, 所以這個環節需要一點時間

$ cd opencv
$ mkdir release
$ cd release
$ mkdir my_build_dir
$ cd my_build_dir
$ cmake -D BUILD_TIFF=ON -D WITH_CUDA=OFF -D ENABLE_AVX=OFF -D WITH_OPENGL=OFF -D WITH_OPENCL=OFF -D WITH_IPP=OFF -D WITH_TBB=ON -D BUILD_TBB=ON -D WITH_EIGEN=OFF -D WITH_V4L=OFF -D WITH_VTK=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib/modules /opt/opencv/
$ make -j4
$ make install
$ ldconfig
$ exit
$ cd ~


5. 查看你的 OpenCV 版本

$ pkg-config --modversion opencv


6. 寫個簡單的程式來編譯看看

/* A simple example */
#include "opencv2/opencv.hpp"

using namespace cv;

int main(void){
    Mat srcImg = imread("picture.jpg");
    
    imshow("srcImg", srcImg);
    waitKey(0);
    
    return 0;
}
  • 編譯與執行
$ g++ main.cpp -o output `pkg-config --cflags --libs opencv`
$ ./output

上面的 main.cpp 請改成你自己程式的名稱


Reference