Ask Your Question

Why OpenCV Using BGR Colour Space Instead of RGB

asked 2013-01-26 01:50:38 -0500

Haris gravatar image

Hi all. Can any one explain why OpenCV using BGR colour space instead of RGB. We all know that RGB is the convenient colour model for most of the computer graphics and also the human visual system works in a way that is similar to an RGB colour space. Is there any reason behind OpenCV BGR colour space ?.

Thanks in advance.......

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-01-26 06:54:13 -0500

updated 2013-01-26 13:51:45 -0500

SR gravatar image

I think because the standard bitmap has the following properties.

  • Bitmaps are saved row-based.
  • When the height is positive, it is a bottom-up bitmap, that is, the last line comes first in memory.
  • A row must be aligned on a 4-byte boundary.
  • Color channel order is BGR (unless specified otherwise by BI_BITFIELDS masks).
edit flag offensive delete link more


Actually, no. OpenCV uses BGR for purely historical reasons.

rpcruz gravatar imagerpcruz ( 2016-07-18 06:39:51 -0500 )edit

Question Tools


Asked: 2013-01-26 01:50:38 -0500

Seen: 2,473 times

Last updated: Jan 26 '13