Guys, I\'m looking for a bit of assistance. I\'m a newbie programmer and one of the problems I\'m having at the minute is trying to convert a black & white .jpg
.jpg
data = numpy.asarray(im)
Notice:In PIL, img is RGBA. In cv2, img is BGRA.
My robust solution:
def cv_from_pil_img(pil_img): assert pil_img.mode=="RGBA" return cv2.cvtColor(np.array(pil_img), cv2.COLOR_RGBA2BGRA)