Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV: How construct MatND from Mat or Set MatND use vector of Mat

Tags:

opencv

From documentation, the MatND actually is Mat. I want to use it as a N-Way array(tensor). Even the api provide constructor to build an empty MatND, the documentation didn't give a way to build MatND form Mat or set MatND use Mat. Is there a way to easily set MatND or build MatND from Mat without per element operation.

like image 847
emailhy Avatar asked Nov 06 '22 06:11

emailhy


1 Answers

From the doc: "MatND is now obsolete; consider using Mat instead." That being said, I was able to run this with no problem (is this what you are asking?):

MatND test;
while ((int)key != 27) {

    capture >> frame;

    test = MatND(frame);

    imshow("test", test);
    key = waitKey(1);

}
like image 56
Radford Parker Avatar answered Nov 09 '22 14:11

Radford Parker