我试图通过boost asio(没有序列化)向客户端发送kinect深度图是尝试异步还是同步更好(现在我的方法是同步):
像这样的smthg..
server:
//depthmap
const XnDepthPixel* pDepthMap = depth.GetDepthMap();
boost::asio::write (socket, boost::asio::buffer (pDepthMap, sizeof(pDepthMap))); //sizeof isnt right..
client:
XnDepthPixel* depth;
socket.read_some( boost::asio::buffer (&depth, sizeof(XnDepthPixel)* ?? )); //send sizeof(pDepthMap) before..
编辑:XnDepthPixel 的定义(也来自 OpenNI):
/** Defines the depth values type (16-bit values). **/
typedef XnUInt16 XnDepthPixel
和 XnUInt16:
/** 16-bit unsigned integer. */
typedef unsigned short XnUInt16;