conversion between CvMat* and cv::Mat
how can I convert CvMat*
to cv::Mat
?
cvarrToMat Converts CvMat, IplImage , or CvMatND to Mat.
Fixed the conversions using new syntax.
CvMat* A = cvCreateMat(10, 10, CV_32F);
cvSetIdentity(A);
IplImage A1;
cvGetImage(A, &A1);
Mat B (A);
Mat B1 (A1);
IplImage C = B.operator IplImage();
CvMat C1 = B1.operator CvMat();
// now A, A1, B, B1, C and C1 are different headers
// for the same 10x10 floating-point array.
// note that you will need to use "&"
// to pass C & C1 to OpenCV functions, for example:
printf("%g\n", cvNorm(&C1, 0, CV_L2));
Asked: 2015-06-30 07:38:18 -0600
Seen: 3,719 times
Last updated: Jun 30 '15
OpenCV DescriptorMatcher matches
Conversion between IplImage and MxArray
Video On Label OpenCV Qt :: hide cvNamedWindows
Problems using the math.h class with OpenCV (c++, VS2012)
How to reduce false positives for face detection
Area of a single pixel object in OpenCV
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04
Can't compile .cu file when including opencv.hpp
Using OpenCV's stitching module, strange error when compositing images
I would suggest not using CvMat... Where do you need it?