Skip to content

Instantly share code, notes, and snippets.

@blackstuend
Last active March 26, 2019 16:51
Show Gist options
  • Save blackstuend/b92a8588789da26a180de5449f27ea2c to your computer and use it in GitHub Desktop.
Save blackstuend/b92a8588789da26a180de5449f27ea2c to your computer and use it in GitHub Desktop.
安裝opencv on node.js

安裝

windows

  • 安裝cmake 隨後放到環境變數
  • 安裝 node.js 11版本以上
  • 安裝visual studio
  • 安裝visual studio 裡面的C++套件
  • 用超級使用者進到cmd (右鍵使用系統管理員使用)
$ npm install windows-build-tools -g
  • 然後用一般的cmd
$ npm config set msvs_version 2017
$ npm install node-gyp -g
$ npm install opencv4nodejs //只能在c://user/底下的一層安裝..

安裝OPENCV

  • 設置環境變數 新增一個環境變數叫OPENCV_DIR 然後內容寫C:\opencv\build\x64\vc12
  • 再去PATH 新增一個 %OPENCV_DIR%\bin

Ubuntu

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt install g++
$ sudo apt install build-essential
$ sudo apt install gcc
$ git clone https://github.com/justadudewhohacks/opencv4nodejs.git
cd opencv4nodejs

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