Egor Burkov edited this page Oct 29, 2016 · 9 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>" 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

Optionally, you can build from local source manually:

git clone
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