I\'m struggling with zeroing elements of 3D matrix with opencv. I can zero all elements in 2D matrix like following way:
meta = new Mat(Mat::zeros(cluster,3
I remind you the documentation, you can use this constructor:
C++: Mat::Mat(int ndims, const int* sizes, int type, const Scalar& s)
passing cv::Scalar(0) should be good for your purposes.
int sizes[] = { 100, 100, 100 };
cv::Mat *matrix = new cv::Mat(3, sizes, CV_32FC1, cv::Scalar(0));
This should make a 3D matrix, a sort of cube with edge 100.