Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to convert between image formats in OpenCV

📅 2015-Jan-12 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

cv::Mat in_mat; // Holds RGB image
cv::Mat out_mat; // Output in BGR format
cv::cvtColor(in_mat, out_mat, CV_RGB2BGR);

Tried with: OpenCV 2.4.9 and Windows 7 Professional 64-bit