Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

yea, the whole thing is terribly confusing, but:

  • the image on disk (as a png or jpg) is in RGB order
  • the image in memory (as a cv::Mat) is in BGR order.

so, imread() will internally convert from rgb to bgr, and imwrite() will do the opposite, all under the hood.

just don't worry too much about it ;)