# 将Texture格式的图片对象转换为numpy
def texture_to_numpy(self,data):
image=numpy.asarray(bytearray(data.pixels), dtype='uint8').reshape((data.height,data.width,4))
r_chanel=numpy.copy(image[:,:,0])
g_chanel=numpy.copy(image[:,:,1])
b_chanel=numpy.copy(image[:,:,2])
image[:, :, 0]=b_chanel
image[:, :, 1]=g_chanel
image[:, :, 2]=r_chanel
# 将numpy格式图片对象转为Texture 
def numpy_to_texture(self,frame):
# frame=cv2.imread("ddd.jpg")
buf1 = cv2.flip(frame, 0)
buf = buf1.tostring()
image_texture = Texture.create(size=(frame.shape[1], frame.shape[0]), colorfmt='bgr')
image_texture.blit_buffer(buf, colorfmt='bgr', bufferfmt='ubyte')