Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Conversion between multichannel and multidimensional matrices

Is there a direct way to convert from a multichannel matrix to a multidimensional matrix (and vice versa)?

For example, in the following code snippet, how could I convert A such that it has the same shape as B?

const int sizes[3] = {50, 50, 3};
cv::Mat A = Mat::zeros(3, sizes, CV_64F);
cv::Mat B = Mat::zeros(50, 50, 3);

Conversion between multichannel and multidimensional matrices

Is there a direct way to convert from a multichannel matrix to a multidimensional matrix (and vice versa)?

For example, in the following code snippet, how could I convert A such that it has the same shape as B?

const int sizes[3] = {50, 50, 3};
cv::Mat A = Mat::zeros(3, sizes, CV_64F);
cv::Mat B = Mat::zeros(50, 50, 3);
3, CV_64F);

Conversion between multichannel and multidimensional matrices

Is there a direct way to convert from a multichannel matrix to a multidimensional matrix (and vice versa)?

For example, in the following code snippet, how could I convert A such that it has the same shape as B?

const int sizes[3] = {50, 50, 3};
cv::Mat A = Mat::zeros(3, A(3, sizes, CV_64F);
cv::Mat B = Mat::zeros(50, B(50, 50, 3, CV_64F);

Conversion between multichannel and multidimensional matrices

Is there a direct way to convert from a multichannel matrix to a multidimensional matrix (and vice versa)?

For example, in the following code snippet, how could I convert A such that it has the same shape as B?

const int sizes[3] = {50, 50, 3};
cv::Mat A(3, sizes, CV_64F);
cv::Mat B(50, 50, 3, CV_64F);
CV_64FC(3));