Ask Your Question
3

Why OpenCV Using BGR Colour Space Instead of RGB

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

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
4

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

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

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

Comments

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

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

Question Tools

Stats

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

Seen: 4,276 times

Last updated: Jan 26 '13