How to extract 'row' of element from a 3D mat ?
I have an array of 48 matrices, each of size 49 x 49. I can merge them to form a 3D cube of size 48 x 49 x 49. How can I extract a 'row' of elements along the 3rd dimension to form a vector of 48 elements? I have tried using a for loop but I was wondering if there is a more elegant way of doing it. The Mat.col or Mat.row function only applies in 2D
Up till 4 dimensions deep there is the Vec3b and Vec4b elements, but they do not work for 48 channels deep so I am afraid a for loop is what you need.
@StevenPuttemans - not true. you can have up to 255 channels (and use CV_8UC(255) and typedef your own Vec255b)
but the problem is rather: there is no such thing as a row in a 3d volume
He means a pixel through all 48 dimensions, which can be seen as a row right. Then creating that Vec255b is exactly what he is looking for!
idk. @Nbb, maybe you should tell us, how you mean it, or what it would be used for ;)