I am creating a multi-dimensional MAT object, and would like to get the size of the object - e.g.,
const int sz[] = {10,10,9};
Mat temp(3,sz,CV_64F);
std::cout << "temp.dims = " << temp.dims << " temp.size = " << temp.size() << " temp.channels = " << temp.channels() << std::endl;
I believe the resulting MAT to be 10x10x9, and I'd like to confirm, but the COUT statement gives:
temp.dims = 3 temp.size = [10 x 10] temp.channels = 1
I was hoping to see either:
temp.dims = 3 temp.size = [10 x 10 x 9] temp.channels = 1
Or:
temp.dims = 3 temp.size = [10 x 10] temp.channels = 9
How can I get the dimensionality of this Mat object? I didn't see any methods in Mat::Mat or MatND
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…