# img = Image.frombytes('RGB', (frame.shape[1], frame.shape[2]), frame.transpose(1,2,0).tostring()) #For some reason there is no frombytes in UBUNTU 12 04
img=Image.frombuffer('RGB',(frame.shape[1],frame.shape[2]),frame.transpose(1,2,0).tostring(),'raw',"RGB",0,1)#This call seems weird, but I follow the instructions from here (http://pillow.readthedocs.org/en/3.0.x/reference/Image.html#PIL.Image.frombuffer). Following these instructions I don't get a warning