iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpenCV.H
Go to the documentation of this file.
1 /*! @file
2  @author Randolph Voorhies (voorhies@usc.edu)
3  @copyright GNU Public License (GPL v3)
4  @section License
5  @verbatim
6  // ////////////////////////////////////////////////////////////////////////
7  // The iLab Neuromorphic Robotics Toolkit (NRT) //
8  // Copyright 2010-2012 by the University of Southern California (USC) //
9  // and the iLab at USC. //
10  // //
11  // iLab - University of Southern California //
12  // Hedco Neurociences Building, Room HNB-10 //
13  // Los Angeles, Ca 90089-2520 - USA //
14  // //
15  // See http://ilab.usc.edu for information about this project. //
16  // ////////////////////////////////////////////////////////////////////////
17  // This file is part of The iLab Neuromorphic Robotics Toolkit. //
18  // //
19  // The iLab Neuromorphic Robotics Toolkit is free software: you can //
20  // redistribute it and/or modify it under the terms of the GNU General //
21  // Public License as published by the Free Software Foundation, either //
22  // version 3 of the License, or (at your option) any later version. //
23  // //
24  // The iLab Neuromorphic Robotics Toolkit is distributed in the hope //
25  // that it will be useful, but WITHOUT ANY WARRANTY; without even the //
26  // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
27  // PURPOSE. See the GNU General Public License for more details. //
28  // //
29  // You should have received a copy of the GNU General Public License //
30  // along with The iLab Neuromorphic Robotics Toolkit. If not, see //
31  // <http://www.gnu.org/licenses/>. //
32  // ////////////////////////////////////////////////////////////////////////
33  @endverbatim */
34 
35 
36 #ifndef INCLUDE_NRT_IMAGEPROC_LIBRARYCONVERSIONS_OPENCV_H
37 #define INCLUDE_NRT_IMAGEPROC_LIBRARYCONVERSIONS_OPENCV_H
38 
41 
42 // It seems that opencv2.3 does not include opencv.hpp anymore, so here it is:
43 #ifndef __OPENCV_ALL_HPP__
44 #define __OPENCV_ALL_HPP__
45 
46 #include <opencv2/core/core_c.h>
47 #include <opencv2/core/core.hpp>
48 #include <opencv2/imgproc/imgproc_c.h>
49 #include <opencv2/imgproc/imgproc.hpp>
50 #include <opencv2/video/tracking.hpp>
51 #include <opencv2/video/background_segm.hpp>
52 #include <opencv2/objdetect/objdetect.hpp>
53 #include <opencv2/calib3d/calib3d.hpp>
54 #include <opencv2/ml/ml.hpp>
55 #include <opencv2/highgui/highgui_c.h>
56 #include <opencv2/highgui/highgui.hpp>
57 #include <opencv2/contrib/contrib.hpp>
58 
59 #endif
60 
61 // If you have OpenCV 2.4 and SIFT is missing, note that OpenCV moved SIFT to the nonfree library:
62 #ifndef NRT_SKIP_NONFREE_OPENCV
63 #if CV_MAJOR_VERSION == 2 && CV_MINOR_VERSION >= 4 && CV_SUBMINOR_VERSION > 5
64 #include <opencv2/nonfree/features2d.hpp>
65 #else
66 #include <opencv2/features2d/features2d.hpp>
67 #endif
68 #endif // NRT_SKIP_NONFREE_OPENCV
69 
70 namespace nrt
71 {
72  /*! \defgroup imageopencv Functions for Image conversions to OpenCV
73 
74  Inter-operatibility functions to convert back and forth between NRT's Image class and OpenCV or other libraries,
75  thereby allowing one to use the many available OpenCV and other algorithms from within NRT.
76 
77  \ingroup imageconversion
78  \see imageconversion */
79 
80  /*! @{ */ // **********************************************************************
81 
82  //! Copy an OpenCV IplImage to an nrt::Image
83  template<class PixType> inline
84  Image<PixType> copyIpl2Image(IplImage const * const iplimage);
85 
86  //! Copy an nrt::Image to an OpenCV IplImage
87  /*! \warning The user is responsible for free()'ing the resulting IplImage*/
88  template<class PixType> inline
89  IplImage* copyImage2Ipl(Image<PixType> const img);
90 
91  //! Copy a cv::Mat to an nrt::Image
92  template<class PixType> inline
93  Image<PixType> copyCvMat2Image(cv::Mat iplimage);
94 
95  //! Copy an nrt::Image to a cv::Mat
96  template<class PixType> inline
97  cv::Mat copyImage2CvMat(Image<PixType> const img);
98 
99  /*! @} */ // **********************************************************************
100 }
101 
102 // Include implementation specific details
104 
105 #endif // NRT_IMAGEPROC_LIBRARYCONVERSIONS_OPENCV_H
106