First time here? Check out the FAQ!

Ask Your Question
2

Opencv 2.4.9 Viz module not there.

asked Apr 29 '14

MRDaniel gravatar image

Hi.

I downloaded opencv-2.4.9.exe and linked with Visual Studio 2012.

In the source, i cannot find the viz module.

I followed this tutorial, changing values to 249 for OpenCV.

http://opencv-srf.blogspot.co.nz/2013/05/installing-configuring-opencv-with-vs.html

Any clues?

Preview: (hide)

Comments

did you include the correct header file (opencv2/viz/...)? Because the standard opencv.hpp doesn't include it yet as you can see here

StevenPuttemans gravatar imageStevenPuttemans (Apr 29 '14)edit

it's a 3.0 feature only.

berak gravatar imageberak (Apr 29 '14)edit
3

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!

StevenPuttemans gravatar imageStevenPuttemans (Apr 29 '14)edit
1

ehum, right.sorry.

berak gravatar imageberak (Apr 29 '14)edit
1

Intellisense cannot find the include that we want. I am working from the tutorial sample with that include line.

MRDaniel gravatar imageMRDaniel (Apr 29 '14)edit

@StevenPuttemans Is it QT related?

MRDaniel gravatar imageMRDaniel (Apr 29 '14)edit

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.

StevenPuttemans gravatar imageStevenPuttemans (Apr 29 '14)edit
1

@berak : its just a matter of checking first then replying :P I almost made the same mistake ^_^

StevenPuttemans gravatar imageStevenPuttemans (Apr 29 '14)edit

I'll post the link. I'm building trunk from source, hopefully that'll work out. :)

MRDaniel gravatar imageMRDaniel (Apr 29 '14)edit

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

StevenPuttemans gravatar imageStevenPuttemans (Apr 29 '14)edit

2 answers

Sort by » oldest newest most voted
5

answered May 5 '14

Anatoly gravatar image

updated May 5 '14

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.

Preview: (hide)

Comments

how do i enable compilation as static library ? I cannot find that optin

Nbb gravatar imageNbb (Aug 30 '16)edit

Sorry, this doesn't help me on windows, with vtk and successfull cmake for it, there still no opencv_viz.dll after building ALL_BUILD.

stiv-yakovenko gravatar imagestiv-yakovenko (Sep 17 '17)edit

@stiv-yakovenko post a new question if you don't use opencv 2.4.9

LBerger gravatar imageLBerger (Sep 17 '17)edit

for opencv 3 it should be not path-to-build-directory-of-VTK, but vtk cmake file folder

stiv-yakovenko gravatar imagestiv-yakovenko (Sep 17 '17)edit

this post is too old path on windows now should be -DVTK_DIR:PATH=......./install/vtk/lib/cmake/vtk-8.1

LBerger gravatar imageLBerger (Sep 17 '17)edit
1

answered May 5 '14

Andrey Pavlenko gravatar image

The new viz module exists in OpenCV-2.4.9 sources but was not included into pre-built libraries since it depends on VTK that assumes redistribution of pre-built VTK with the package.

For those who needs the viz module we suggest building OpenCV-2.4.9 from sources with -DWITH_VTK=ON CMake option. (Use -DVTK_DIR=/your/vtk/build/path to help CMake finding VTK).

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Apr 29 '14

Seen: 20,431 times

Last updated: May 05 '14