Transpose CV_8UC Image
How do I transpose an image that does has a number of channels that is not covered by the standard transpose function in OpenCV?
How do I transpose an image that does has a number of channels that is not covered by the standard transpose function in OpenCV?
Manually. It's not complicated to write, it just won't be as fast.
OpenCV takes advantage of OpenCL and the intel IPP libraries when possible. Who knows, you might be able to write something as fast, but I'm betting you wouldn't have asked this question if you were.
Just create the destination with the appropriate data type and reverse numbers of rows and cols. Then for each column of the source, copy to the same row of the destination.
Besides, if you need more than 4 channels and you need speed, you should probably be using something besides OpenCV, since it's probably not image processing. I'll admit it's possible, but unlikely.
Asked: 2017-01-15 21:32:26 -0600
Seen: 417 times
Last updated: Jan 16 '17
How many of channels do you need?