Skip to content
Egor Burkov edited this page Apr 10, 2018 · 12 revisions

First, install OpenCV 3.1 and Torch 7. Then:

luarocks install cv

If CMake fails to find OpenCV 3.1, help it by providing the dir:

OpenCV_DIR="<path to OpenCV 3.1 build or install root>" luarocks install cv

Sometimes you may wish to not have bindings for some modules -- for example, when you use a development (trunk) version of OpenCV, which may not be compatible with OpenCV 3.1. In that case, provide a semicolon-separated list of those via DONT_WRAP environment variable, e.g.

DONT_WRAP="xphoto;superres" luarocks install cv

Another important environment variable is WITH_CUDA that allows you to explicitly disable bindings for CUDA packages. Example:

OpenCV_DIR="/home/sir/opencv-3.1.0/install" WITH_CUDA=OFF luarocks install cv

Optionally, you can build from local source manually:

git clone https://github.com/VisionLabs/torch-opencv.git
cd torch-opencv
luarocks make cv-scm-1.rockspec

Now try running demos from project root, for example,

th demo/videocap.lua
th demo/flann.lua
th demo/SVM.lua
th demo/trackbar.lua
Clone this wiki locally