Possible Duplicate:
copy data from one matrix to another
I have an array in c++ like this:
double myValue[600][800][3];
and I want to convert it into openCV multidimensional matrix or scalar form. I tried doing something like this:
double size[] = {600, 800};
cv::Mat myValue (size, 3, CV_8UC3 );
But it is wrong, could someone help me?
Buddy, you have to do basic research by looking at manual or searching web before asking a question. If you don’t do that, it is very difficult for us to give you an understandable answer.
Accessing elements of cv::Mat or matrix conversion is really basic stuff in OpenCV. Please refer to cheatsheet if you are that busy.
To answer your question, I don’t think there is a short cut to convert multidimensional array to Mat. You should loop through elements to copy the data into Mat. That’s why many people use single dimensional array to speed things up for faster image processing.