Hi all,

Sorry to disturb you.

As we know Mat::size() will work only dimensions <= 2. Could you please tell me how can we get the dimension if it's greater than 2 ?

Thank you.

1 | initial version |

Hi all,

Sorry to disturb you.

As we know Mat::size() will work only dimensions <= 2. Could you please tell me how can we get the dimension if it's greater than 2 ?

Thank you.

2 | No.2 Revision |

Hi all,

Sorry to disturb you.

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

Thank you.

3 | No.3 Revision |

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 ~~if it's ~~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.

4 | No.4 Revision |

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.

5 | No.5 Revision |

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.

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.