I\'m trying to use the Zbar library\'s QR code detection methods on images I extract with OpenCV\'s camera methods. Normally the QR code detection methods work with images (jpg,
A simple way is to directly swap the channels. Suppose you are trying to convert a 3-channel image file between OpenCV format and PIL format. You can just use:
img[...,[0,2]]=img[...,[2,0]]
In this way, you won't be bothered with cv2.cvtColor
as this function only works on images with certain depth.