Ask Your Question

Anatoly's profile - activity

2017-08-04 08:48:51 -0600 received badge  Good Answer (source)
2015-03-16 10:19:11 -0600 received badge  Nice Answer (source)
2014-11-02 13:56:44 -0600 received badge  Teacher (source)
2014-05-05 08:58:47 -0600 received badge  Editor (source)
2014-05-05 08:57:36 -0600 answered a question Opencv 2.4.9 Viz module not there.

How to build 'opencv_viz' module.

For Ubuntu

  1. sudo apt-get isntall libvtk5-dev
  2. cmake -DWITH_VTK=On <path-to-opencv-sources> //cmake will find vtk automatically
  3. make.

For windows

  1. Download VTK sources from www.vtk.org.
  2. Open CMake-Gui and configure VTK for Visual Studio.
  3. Enable compilation as static library option & reconfigure
  4. open generated Visual studio project and compile it for Release & Debug

Note: it's recommended to compile VTK statically, because in this case 'opencv_viz.dll' will be ~15 Mb in size and fully self-contained (i.e. no external dependencies at all).

Build OpenCV with VTK.

  • set WITH_VTK= On in CMake-Gui
  • set VTK_DIR = path-to-build-directory-of-VTK
  • compile OpenCV

Note: it is recommended to point build directory, not install directory.

Note: if you have several VTKs in your system and wrong version is found, you may force concrete version via setting VTK_DIR environment variable to proper path.

For Macos

It's possible, I made it! And I tested it for OS X 10.9 with VTK 6.2 from vtk development repository. I don't remember my steps that's why don't publish them here.

2014-05-05 08:32:23 -0600 commented question Opencv 2.4.9 Viz module not there.

@StevenPuttemans

  1. 'opencv_viz' is optional and will never be included in 'opencv2/opencv.hpp'. Use '#include opnecv2/viz/vizcore.hpp' instead.

  2. You may download and compile VTK from sources for VS 2012 (32bit). I recommend you to compile and link VTK statically. In this case 'opencv_viz.dll' will be ~15Mb in size and fully self-contained (no external dependencies!)