Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get pixel format of a Mat()?

I need to detect the pixel format of a cv::Mat() object, BGR or RGB or BGRA or RGBA or YUV or some else.

I know OpenCV use BGR/BGRA by default, but you can use cvtColor to change it, what I need is going to detect the pixel format for any cv::Mat() object.

Thanks a lot.