Passing multi dimensional array to opencv Mat
What is the correct way to pass a multi dimensional array into an opencv 3d mat vs a 3 channel matrix ? Is the following code below correct ?
int size[3] = {100, 100, 100};
cv::Mat a = cv::Mat(3, size, CV_64FC1, arr->data);
cv::Mat b = cv::Mat(cv::Size(image.cols, image.rows), CV_64FC(100), arr->data);
It is not possible like this : data order are not the same. Opencv likes 2d data but not 3d data
thanks. i have also seen the way multi channel images are stored in http://docs.opencv.org/2.4/doc/tutori... also. Is there a simple solution so I dont have to write my own function to iterate through the 3D matrix ? I guess ill try writing my own function first to verify that it is working.
If it is like your matlab post (4 plans must go into 4channels) you can simply divide your image in 4 mat and then use merge to make a 4 channel image