Advertisement
lamiastella

uvmap

May 24th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. // Create the Projection instance.
  2. Projection *projection=device->CreateProjection();
  3.  
  4. // color and depth image size.
  5. ImageInfo dinfo=depth->QueryInfo();
  6. ImageInfo cinfo=color->QueryInfo();
  7.  
  8. // Calculate the UV map.
  9. PointF32 *uvmap=new PointF32[dinfo.width*dinfo.height];
  10. projection->QueryUVMap(depth, uvmap);
  11.  
  12. // Translate depth points uv[] to color ij[]
  13. for (int i=0;i<npoints;i++) {
  14.     ij[i].x=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].x*cinfo.width;
  15.     ij[i].y=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].y*cinfo.height;
  16. }
  17.  
  18. // Clean up
  19. delete[] uvmap;
  20. projection->Release();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement