- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have Intel RealSense F200 camera, trying to Map Depth to Color Coordinates using UV Mapping, through the following code.
CodeSnippet:--
PXCMCapture.Sample sampleCD = senseMgr.QuerySample();
PXCMImage depth= sampleCD.depth;
PXCMImage color= sampleCD.color;
PXCMProjection projection=device.CreateProjection();// Create the PXCMProjection instance.
// color and depth image size.
PXCMImage.ImageInfo dinfo=depth.QueryInfo();
PXCMImage.ImageInfo cinfo=color.QueryInfo();
// Calculate the UV map.
PXCMPointF32[] uvmap=new PXCMPointF32[dinfo.width*dinfo.height];
projection.QueryUVMap(depth, uvmap);
// Translate depth points dBuffRaw[] to color depthToColor[]
float depthToColor[]= new float[dBuffRaw.length];
for (int y=0; y < dHeight-1; y++)
{
for (int x=0; x < dWidth - 1; x++)
{
for (int i=0;i<dBuffRaw.length;i++) {
depthToColor.x=uvmap[(int)dBuffRaw.y*dinfo.width+(int)dBuffRaw.x].x*cinfo.width;
depthToColor.y=uvmap[(int)dBuffRaw.y*dinfo.width+(int)dBuffRaw.x].y*cinfo.height;
}
}
}
I am getting error "x cannot be resolved or is not a field" "y cannot be resolved or is not a field" on above bold lines.
regards,
Himanshu
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You've set up depthToColor[] as a float array. Presumably you want it to be a PXCMPointF32[] array instead? That's the only obvious problem I can see. If you fix that and it still doesn't work I'll take a closer look for you.
Let me know how you get on!
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks James for your prompt reply......I got the solution.....

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page