1 | initial version |
imshow
expects BGR images. If the result is messed up, I think the problem is with the VideoCapture. Maybe VideoCapture gives RGB? Anyway you can use cv::cvtColor to convert between BGR and RGB.
cv::cvtColor(rgbMat, bgrMat, cv::COLOR_RGB2BGR);
cv::cvtColor(bgrMat, rgbMat, cv::COLOR_BGR2RGB);
2 | No.2 Revision |
imshow
expects BGR images. If the result is messed up, I think the problem is with the VideoCapture. Maybe VideoCapture gives RGB? Anyway you can use cv::cvtColor cv::cvtColor
to convert between BGR and RGB.
cv::cvtColor(rgbMat, bgrMat, cv::COLOR_RGB2BGR);
cv::cvtColor(bgrMat, rgbMat, cv::COLOR_BGR2RGB);
Disclaimer: I only have experience with OpenCV on desktop.