How to check image planar or interleaved?

asked 2015-07-10 03:51:40 -0500

Davit gravatar image

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?

edit retag flag offensive close merge delete


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

LBerger gravatar imageLBerger ( 2015-07-10 04:20:14 -0500 )edit

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.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-07-10 04:21:02 -0500 )edit