即時試圖通過升壓ASIO(不serializtion) 是它不如試試非同步或同步Kinect的深度圖發送到客戶端(目前我的方法IST同步):如何通過boost asio發送OpenNI深度圖給客戶端?
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;
異步或同步無關緊要。您需要將XnDepthPixel對象轉換爲字節流。你能用XnDepthPixel的定義來編輯問題嗎? –
好的.. def。是增加.. – ddd