# How to get Size for N (N>2) dimensional Mat

Hi all,

Sorry to disturb you.

As we know Mat::size() will work only the dimension of Mat is not greater than 2. Could you please tell me how we can get the size if the dimension is greater than 2 ?

For example, if I create a Mat by Mat(3, (int[]) {3,4,5}, CV_64F), we can get its dimension via Mat::dims or Mat::size.p[-1], but how can we get its size, i.e. {3,4,5} ?

Thank you.

**SOLVED**

Use Mat::size and cast it into const int*, then we can get an array to indicate the length of each dimension.