[Python] color problem in opencv

In cv2, the channel order of color is not RGB, but BGR, so in the process of drawing (for example, the following code): (255, 0, 0) is actually blue instead of red, red should be (0, 0) , 255)

# bb的格式为:[xmin, ymin, xmax, ymax]
cv2.rectangle(img, (int(bb[0]), int(bb[1])),
                        (int(bb[2]), int(bb[3])),
                         color, 2)

Attach the three primary color schematic diagram and RGB comparison table
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_38705903/article/details/112220128