Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create the Projection instance.
- Projection *projection=device->CreateProjection();
- // color and depth image size.
- ImageInfo dinfo=depth->QueryInfo();
- ImageInfo cinfo=color->QueryInfo();
- // Calculate the UV map.
- PointF32 *uvmap=new PointF32[dinfo.width*dinfo.height];
- projection->QueryUVMap(depth, uvmap);
- // Translate depth points uv[] to color ij[]
- for (int i=0;i<npoints;i++) {
- ij[i].x=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].x*cinfo.width;
- ij[i].y=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].y*cinfo.height;
- }
- // Clean up
- delete[] uvmap;
- projection->Release();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement