7 #ifndef IMPEM2D_OPENCV_INTERFACE_H
8 #define IMPEM2D_OPENCV_INTERFACE_H
10 #include <IMP/em2d/em2d_config.h>
13 #if IMP_EM2D_HAS_OPENCV22 || IMP_EM2D_HAS_OPENCV3
14 #include "opencv2/core/core.hpp"
15 #include "opencv2/core/version.hpp"
16 #include "opencv2/imgproc/imgproc.hpp"
17 #include "opencv2/highgui/highgui.hpp"
19 #include "opencv/cv.h"
20 #include "opencv/highgui.h"
25 IMPEM2D_BEGIN_NAMESPACE
27 typedef cv::Mat_<double> cvDoubleMat;
28 typedef cv::MatIterator_<double> cvDoubleMatIterator;
29 typedef cv::MatConstIterator_<double> cvDoubleConstMatIterator;
31 typedef cv::Mat_<int> cvIntMat;
32 typedef cv::MatIterator_<int> cvIntMatIterator;
34 typedef cv::Point_<int> cvPixel;
35 typedef std::vector<cvPixel> cvPixels;
38 IMPEM2DEXPORT
void show(
const cv::Mat &m, std::ostream &out = std::cout);
41 IMPEM2DEXPORT
void write_matrix(cv::Mat &m, std::string name);
45 void show(
const cv::Mat_<T> &m, std::ostream &out = std::cout) {
46 for (
int i = 0; i < m.rows; ++i) {
47 for (
int j = 0; j < m.cols; ++j) {
48 out << m(i, j) <<
" ";
void write_matrix(cv::Mat &m, std::string name)
Quick and dirty way of writing a OpenCV matrix to a Spider image.
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.