How to check image planar or interleaved?
While writing function to convert image type I need to know its planar or interleaved. I read a lot in OpenCV doc, but I couldn't find. Can somebody give a snippet of code?
I think you can have a look at function cvtColor and this.
In opencv for RGB image I think that you can have only pixel in order BGRBGRBGR... I dont think it's possible to have BBBBBB .... GGGGG.... RRRRRR... for a structure like Mat. After you can split color plan
if for you planar image is equivalent to gray-scale (one channel) and interleaved image is an image coded on more channels, then you can use
Mat::channels()
if it returns more than 1, then it is interleaved.