Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Channel order in OpenCV

📅 2014-Oct-23 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Sometimes, you may need to access the memory of a cv::Mat or an IplImage directly. If the image contains M channels, then it becomes important to know how the pixels of these M channels are stored in the image memory. According to OpenCV documentation here: