I have the following piece of code:
imgs = glob.glob(\'/home/chipin/heart/tray.png\')
current_img = io.imread(imgs[0])
cv2.imwrite(\'/home/chipin/heart/01.pn
The image on input (as a png) is in RGB order but the image in memory (as a cv::Mat) is in BGR order.
Use cv2.imread() for input. So, imread() will internally convert from rgb to bgr and imwrite() will do the opposite, all under the hood.
Here's how you do it:
current_img = cv2.imread('/home/chipin/heart/tray.png')
cv2.imwrite('/home/chipin/heart/01.png', current_img)