OpenCV Module in Slicer3

From NAMIC Wiki
Revision as of 02:44, 19 August 2009 by Hliu (talk | contribs)
Jump to: navigation, search
Home < OpenCV Module in Slicer3

Steps to Build and Use OpenCV Module

My operating system

The following Linux system is my desktop where this tutorial is based on:
Ubuntu 8.04 - the Hardy Heron - released in April 2008.
Linux brainlab-desktop 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686 GNU/Linux

Test camera

  1. My camera is Logitech QuickCam Pro for Noteboks
  2. If you don't have a tool called "luvcview," you can get it using this command "sudo apt-get install luvcview"
  3. Plug in the camera to any usb port on your computer
  4. Run luvcview


In a few seconds you should see video displayed in luvcview

Compile Slicer3

  • To include OpenCV module into your Slicer3 build, open this file:

Slicer3/slicer_variables.tcl
and set ::USE_OPENCV to "ON"

Test the system

Video from a camera is displayed in the second window of OpenCV module in Slicer3.
  1. Plug in your camera into any usb port
  2. Bring Slicer up
  3. Go to the modules list in Slicer3 interface
  4. Pick OpenCV module
  5. Press the button "second window on"

You should see video from the camera in a few seconds.

Future Work

  1. The latest OpenCV library supports svn and CMake. I have built it into the list of Slicer external libraries. When you compile Slicer3, you will automatically get OpenCV library compiled. However, the compilation of OpenCV module in Slicer trunk failed against the library. We need to figure out what caused the failure of that compilation in order to automate the build of OpenCV module.
  2. More testing of the functionality in OpenCV module.

Bug Fixes

  • There is a bug in OpenCV related to V4L2 devices:
    • Here is the bugtrac with information: [[1]]
      • Somehow this is related to bttv 878 cards. OpenCV seem not to be able to handle all output of the card correctly
    • Here is the fix [[2]]
      • Apply the changes of revision 1609 to the file # opencv/src/highgui/cvcap_v4l.cpp