Ask Your Question

Revision history [back]

Basic matrix operations producing null pointer members

Please bear with me, I'm totally new to OpenCV.

cv::Mat_<double> A (lengthOfArray1, 1, array1);
cv::Mat_<double> B (lengthOfArray1, 1, array2);
cv::Mat_<double> C = A - B;

The problem is that what I get for C is an array with the right dimensions but a null pointer data, refcount, datastart, dataend, datalimit, and allocator. array1 is the same size as array2. I must be doing something silly.

Basic matrix operations producing null pointer members

Please bear with me, I'm totally new to OpenCV.OpenCV. array1 and array2 primitive arrays of doubles, of the same length.

cv::Mat_<double> A (lengthOfArray1, 1, array1);
cv::Mat_<double> B (lengthOfArray1, 1, array2);
cv::Mat_<double> C = A - B;

The problem is that what I get for C is an array with the right dimensions but a null pointer data, refcount, datastart, dataend, datalimit, and allocator. array1 is the same size as array2. I must be doing something silly.