# coding:utf-8
import cv2
img = cv2.imread(p)
img.dtype = 'uint8'
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img.tofile(p + '.bin')
cv2.imwrite(p + '.jpg', img)
opencv读取图片采用的顺序是BGR
# coding:utf-8
import cv2
img = cv2.imread(p)
img.dtype = 'uint8'
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img.tofile(p + '.bin')
cv2.imwrite(p + '.jpg', img)
opencv读取图片采用的顺序是BGR