Opencv Circle Color

This code below will draw a red circle at x,y coordinates

>>cv2.circle(frame,(x, y), 10, (0,0,255), -1)

But the right rbg code for red color should be (255,0,0). When I printed out the color name, it showed blue.

>>print webcolors.rgb_to_name((0,0,255))
>>blue

1 answer

  • answered 2018-07-11 06:14 Sreeram TP

    OpenCV uses BGR color space for representing colors. So, your color code : (0, 0, 255) will be considered as RED in the BGR color space by OpenCV.

    If you want to draw blue circle you have to pass color code as (255, 0, 0)

    For more details about the color space in OpenCV go to this link