How to build 'opencv_viz' module.
For Ubuntu
- sudo apt-get isntall libvtk5-dev
- cmake -DWITH_VTK=On <path-to-opencv-sources> //cmake will find vtk automatically
- make.
For windows
- Download VTK sources from www.vtk.org.
- Open CMake-Gui and configure VTK for Visual Studio.
- Enable compilation as static library option & reconfigure
- 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.
did you include the correct header file (opencv2/viz/...)? Because the standard opencv.hpp doesn't include it yet as you can see here
it's a 3.0 feature only.
euhm viz is added as 2.4.9 looking at the changelog which clearly states that "New VTK-based 3D visualization module viz stabilized and back-ported to 2.4 branch." So this is actually a bug and this should be fixed!
ehum, right.sorry.
Intellisense cannot find the include that we want. I am working from the tutorial sample with that include line.
@StevenPuttemans Is it QT related?
no it is not :) the viz interface is based on the VTK package for 3D modelling. Problem is that with the integration of viz module inside the 2.4 branch, errors were solved BUT they didn't think of fixing all headers to be properly included. Saw you opened a bug report. Link it to this topic and wait until someone starts fixing those headers or do so yourself. The files are there, the correct references in other files not! A dumb way could be to include all the source and header files of the viz module in your project, but don't think this will work .. worth a try tough.
@berak : its just a matter of checking first then replying :P I almost made the same mistake ^_^
I'll post the link. I'm building trunk from source, hopefully that'll work out. :)
Won't solve it, just looked at the 2.4 branch, it seems that headers are not included at the correct places. However I haven't got the knowledge where it should all be added :D