Difference between revisions of "Documentation/Nightly/Extensions/OpenCVExample"

From Slicer Wiki
Jump to: navigation, search
Line 26: Line 26:
  
 
This extension provides an example on how to build and run against the OpenCV package provided by the  
 
This extension provides an example on how to build and run against the OpenCV package provided by the  
[[Documentation/{{documentation/version}}/Extensions/SlicerOpenCV | SlicerOpenCV extension]]. It includes a C++ CLI module that loads, operates on, and saves PNG images.
+
[[Documentation/{{documentation/version}}/Extensions/SlicerOpenCV | SlicerOpenCV extension]]. [http://opencv.org/ OpenCV] (Open Source Computer Vision Library) is an open source computer vision and machine learning software library.
 +
 
 +
This extension includes a C++ CLI module that loads, operates on, and saves PNG images.
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
Line 44: Line 46:
 
{{documentation/{{documentation/version}}/module-section|Similar Modules}}
 
{{documentation/{{documentation/version}}/module-section|Similar Modules}}
  
The [https://github.com/SBU-BMI/SlicerPathology Slicer Pathology] extension also uses the SlicerOpenCV extension  
+
The [https://github.com/SBU-BMI/SlicerPathology Slicer Pathology] extension also uses the [[Documentation/{{documentation/version}}/Extensions/SlicerOpenCV | SlicerOpenCV extension]].
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->

Revision as of 19:58, 11 April 2016

Home < Documentation < Nightly < Extensions < OpenCVExample


For the latest Slicer documentation, visit the read-the-docs.


Introduction and Acknowledgements

Extension: OpenCVExample
Acknowledgments: This work was supported by a supplement to the Quantitative Image Informatics project via the NIH-National Cancer Institute Grant U24 CA180918-03 as well as U24 CA180924 Tools to Analyze Morphology and Spatially Mapped Molecular Data with Stony Brook University.
Author: Nicole Aucoin (SPL)
Contact: Nicole Aucoin, <email>nicole@bwh.harvard.edu</email>

Quantitative Image Informatics for Cancer Research  
Surgical Planning Laboratory (SPL)  

Module Description

OpenCVExample.png

This extension provides an example on how to build and run against the OpenCV package provided by the SlicerOpenCV extension. OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library.

This extension includes a C++ CLI module that loads, operates on, and saves PNG images.

Use Cases

  • This module can be used as a template by extension developers who wish to use the algorithms provided by OpenCV.

Tutorials

Panels and their use

The ExampleOpenCV extension provides the Blend Vector Volumes CLI as a stand alone module, but the extension does not provide an overall GUI.

Similar Modules

The Slicer Pathology extension also uses the SlicerOpenCV extension.

References


Information for Developers


Use this extension as a template on how to include OpenCV provided by the SlicerOpenCV module:

  • In your extension's top level CMakeList.txt:
    • Specify that it depends on SlicerOpenCV:
 set(EXTENSION_DEPENDS "SlicerOpenCV")
    • Include the SlicerOpenCV extension by including this line after the find_package for Slicer:
 find_package(SlicerOpenCV REQUIRED)
  • In your extension's module CMakeLists.txt file:
    • Define OpenCV_DIR by finding the package that SlicerOpenCV provided:
 find_package(OpenCV 3.1 REQUIRED)
    • The header include path is defined as:
 get_filename_component(OpenCV_INCLUDE_DIR ${OpenCV_DIR}/../../include ABSOLUTE)
    • Add ${OpenCV_INCLUDE_DIR} to the MODULE_INCLUDE_DIRECTORIES list
    • Link against the OpenCV libraries by adding ${OpenCV_LIBS} to the MODULE_TARGET_LIBRARIES