Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 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, no 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.

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 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, no 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.

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, no 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.