16 #ifndef mitkCvMatFromVnlMatrix_h
17 #define mitkCvMatFromVnlMatrix_h
22 #include <vnl/vnl_matrix.h>
43 const vnl_matrix<T>* _VnlMatrix,
45 m_VnlMatrix(_VnlMatrix),
53 template <
class T_CvType,
class T_VnlType>
54 static void Cast(
const vnl_matrix<T_VnlType>& vnlMat, cv::Mat& cvMat )
57 cvMat = cv::Mat(vnlMat.rows(), vnlMat.cols(), cv::DataType<T_CvType>::type);
58 for(
unsigned int i=0; i<vnlMat.rows(); ++i)
60 for(
unsigned int j=0; j<vnlMat.cols(); ++j)
62 cvMat.at<T_CvType>(i,j) = static_cast<T_CvType>( vnlMat(i,j) );
74 Cast<T, T>( *m_VnlMatrix, *m_CvMat );
80 const vnl_matrix<T>* m_VnlMatrix;
88 #endif // mitkCvMatFromVnlMatrix_h
DataCollection - Class to facilitate loading/accessing structured data.
static void Cast(const vnl_matrix< T_VnlType > &vnlMat, cv::Mat &cvMat)
#define endodebugvar(var)
CvMatFromVnlMatrix(const vnl_matrix< T > *_VnlMatrix, cv::Mat *_CvMat)