# Revision history [back]

It would help if you could attach your images with strange colors... It is also interesting which YUV format are you talking about.

My guess is that you should process Y, U and V planes independently. OpenCV doesn't know about YUV format, so cvTranspose may corrupt image. For example, if you format is YUV420p - planar format, where all planes are separated and U and V are twice smaller than Y (in each direction), then you should call cvTranspose three times. If you're working with YUV420sp format, U and V are interleaved, and you should call cvTranspose two times, if I'm not mistaken.

So, OpenCV functions usually work properly with 8UC1 (grayscale), 8UC3 (RGB or BGR, etc) formats. But YUV are not natively supported, so you should call OpenCV functions on individual planes sometimes.

It would help if you could attach your images with strange colors... It is also interesting which YUV format are you talking about.

My guess is that you should process Y, U and V planes independently. OpenCV doesn't know about YUV format, so cvTranspose may corrupt image. For example, if you your format is YUV420p - planar format, where all planes are separated and U and V are twice smaller than Y (in each direction), then you should call cvTranspose three times. If you're working with YUV420sp format, U and V are interleaved, and you should call cvTranspose two times, if I'm not mistaken.

So, OpenCV functions usually work properly with 8UC1 (grayscale), 8UC3 (RGB or BGR, etc) formats. But YUV are is not natively supported, so you should call OpenCV functions on individual planes sometimes.