1. 两者对比(假设原图像RGB)
Step1 | cv2.imread | RGB -> BGR |
Step2 | cv2.imencode | BGR -> RGB bytes |
Step3 | cv2.imdecode | RGB bytes -> BGR |
- cv2.VideoCapture(0).read() 读取 BGR 图像
- PIL.Image 操作过程中不改变 Red 和 Blue 的位置
2. cv2操作 BGR 和 RGB 转换
# eg. when image is in RGB format
b, g, r = cv2.split(image)
image = cv2.merge([r, g, b])
如果我的陈述存在疏漏还请不吝赐教,感激不尽!
如果觉得有用就请点个赞吧,创作动力!