Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RealSenseDevice::GetCameraPos(Point2i screenPoint, Point3f &cameraPoint)
- {
- if(screenPoint.x >= m_nColorSize.width || screenPoint.y >= m_nColorSize.height || screenPoint.y < 0 || screenPoint.x < 0)
- {
- cameraPoint.x = -1;
- cameraPoint.y = -1;
- cameraPoint.z = -1;
- return ;
- }
- int nIndex = screenPoint.x + screenPoint.y*m_nColorSize.width;
- RealSense::PointF32 pos = m_uvmap[nIndex];
- if(pos.x != -1 && pos.y != -1)
- {
- nIndex = m_uvmap[nIndex].x*m_nDepthSize.width + m_uvmap[nIndex].y*m_nDepthSize.height * m_nDepthSize.width;
- cameraPoint.x = m_vertices[nIndex].x;
- cameraPoint.y = m_vertices[nIndex].y;
- cameraPoint.z = m_vertices[nIndex].z;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement