Ask Your Question
0

Transpose CV_8UC Image

asked 2017-01-15 21:32:26 -0600

atp gravatar 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?

edit retag flag offensive close merge delete

Comments

How many of channels do you need?

pi-null-mezon gravatar imagepi-null-mezon ( 2017-01-16 07:54:44 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-01-16 00:09:00 -0600

Tetragramm gravatar image

Manually. It's not complicated to write, it just won't be as fast.

edit flag offensive delete link more

Comments

It won't be a as fast as the transpose that exists within opencv? Why?

atp gravatar imageatp ( 2017-01-16 11:17:16 -0600 )edit

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.

Tetragramm gravatar imageTetragramm ( 2017-01-16 17:45:54 -0600 )edit

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.

Tetragramm gravatar imageTetragramm ( 2017-01-16 17:47:03 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-15 21:32:26 -0600

Seen: 414 times

Last updated: Jan 16 '17