我用运行wince的摄像头通过插座传输图像:( 相机中的图像只是使用realloc为给定的x*y大小创建的浮动数组
另一方面,我用python接收这些图像。 我有代码在工作
img_dtype = np.float32
img_rcv = np.empty((img_y, img_x),
dtype = img_dtype)
p = sck.recv_into(img_rcv,
int(size_bytes),
socket.MSG_WAITALL)
if size_bytes != p:
print "Mismatch between expected and received data amount"
return img_rcv
我对numpy创建数组的方式有点困惑,我想知道这个img峎u rcv是否与recv_into的工作方式兼容。在
我的问题是:
答案是:
安全
是的,通过buffer interface
是的,从某种意义上说,你有一块可以使用的内存块
否
相关问题 更多 >
编程相关推荐