I searched to convert an IplImage* to Mat, but all answers were about the conversion to cvMat.
How, can I do it? and what is the difference between Mat and cvMat?
Thanks in advance
I searched to convert an IplImage* to Mat, but all answers were about the conversion to cvMat.
How, can I do it? and what is the difference between Mat and cvMat?
Thanks in advance
Check out the Mat documentation.
The recommended way is the
cv::cvarrToMat
functioncv::Mat
- is base data structure for OpenCV 2.xCvMat
- is old C analog ofcv::Mat
here is a good solution
cv::Mat or Mat, both are same.
Mat has a operator CvMat() so simple assignment works
Convert Mat to CvMat
Convert CVMat to Mat
Convert Mat to IplImage*
> For Single Channel
> For Three Channel
Hope this helps you. Cheers :)
For the records: taking a look at core/src/matrix.cpp it seems that, indeed, the constructor
cv::Mat(IplImage*)
has disappeared.But I found this alternative: