Multidimensional DCT with OpenCV
I have a 3D matrix (2 spatial dimensions, 1 temporal dimension). Its size is 32 x 32 x 64. I would like to calculate the 3D DCT of this matrix. The documentation hints that this may be possible:
DCT_ROWS performs a forward or inverse transform of every individual row of the input matrix. This flag enables you to transform multiple vectors simultaneously and can be used to decrease the overhead (which is sometimes several times larger than the processing itself) to perform 3D and higher-dimensional transforms and so forth.
But it doesn't go beyond that. How do I do a higher-dimensional DCT? I can think of a way of doing this by combining 1D DCTs (in one direction) and rotation (transposition?) of the 3D matrix, but I don't see an easy way to rotate the matrix. Can somebody point me in the right direction?
can you allow to "flatten" (reshape) your 2d images to 1d ? (do you need the 2d-information?)
then it would be possible to arrange a Mat with 64 rows and 32x32 cols, and do a dct on that (using the mentioned DCT_ROWS flag).
I'm not sure, but I might be able to do that. Thank you for your suggestion.