OpenCV is the most popular library for computer vision and image processing. I started using it for my master (it was a beta version 0.98) thesis and I am stil using it.

nitially, I did not understand why the images were loaded as BGR and not RGB. Then after having reading few articles, I came back with an answer. Basically, BGR was the common color format used among camera manufacturers and software providers (e.g., in Windows when you have to specify a color you have to use the following color format 0x00bbggrr).

The red channel was considered one of the least important color channels, so was listed last, and many bitmaps use BGR format for image storage.

However, in the recent decades, the standard has changed and most image software and cameras use RGB format, which is why, in programs, it’s good practice to initially convert BGR images to RGB before analyzing or manipulating any images.