16 #ifndef mitkVnlMatrixFromCvMat_h
17 #define mitkVnlMatrixFromCvMat_h
19 #include <vnl/vnl_matrix.h>
39 const cv::Mat* _CvMat,
40 vnl_matrix<T>* _VnlMatrix):
42 m_VnlMatrix(_VnlMatrix)
50 template <
typename TCvMat,
typename TVnlMat>
51 void ToVnlMatrix( vnl_matrix<TVnlMat>& vnlMat,
const cv::Mat& mat )
53 vnlMat.set_size( mat.rows, mat.cols );
54 for(
int i=0; i<mat.rows; ++i)
55 for(
int j=0; j<mat.cols; ++j)
56 vnlMat(i,j) =
static_cast<TVnlMat
>( mat.at<TCvMat>(i,j) );
70 const cv::Mat* m_CvMat;
74 vnl_matrix<T>* m_VnlMatrix;
78 #endif // mitkVnlMatrixFromCvMat_h
#define endoAccessCvMat(function, T, arg1, arg2)
DataCollection - Class to facilitate loading/accessing structured data.
VnlMatrixFromCvMat(const cv::Mat *_CvMat, vnl_matrix< T > *_VnlMatrix)
void ToVnlMatrix(vnl_matrix< TVnlMat > &vnlMat, const cv::Mat &mat)