我正在與Kinect和閱讀示例從DepthWithColor-D3D
,有一些代碼,但我還不明白。在Kinect SDK中解釋代碼
// loop over each row and column of the color
for (LONG y = 0; y < m_colorHeight; ++y)
{
LONG* pDest = (LONG*)((BYTE*)msT.pData + msT.RowPitch * y);
for (LONG x = 0; x < m_colorWidth; ++x)
{
// calculate index into depth array
int depthIndex = x/m_colorToDepthDivisor + y/m_colorToDepthDivisor * m_depthWidth;
// retrieve the depth to color mapping for the current depth pixel
LONG colorInDepthX = m_colorCoordinates[depthIndex * 2];
LONG colorInDepthY = m_colorCoordinates[depthIndex * 2 + 1];
如何計算的colorInDepthX
價值和colorInDepthY
如上面的代碼?
此代碼。你對什麼感到困惑? – Mikeb
嗨,我的意思是爲什麼colorInDepthX和colorInDepthY之間的差異是「+1」? –