- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use RealSense R200 . I want to convert depth's 628*468 to 640*480 and to get 3D world coordinates(x,y,z) .
I cloud use CreateDepthImageMappedToColor regarding convert.
Next task isn't.
I certainly used QueryVertices. I use like:
PXCImage* depthIm = projection->CreateDepthImageMappedToColor(sample->depth,sample->color);
projection->QueryVertices(depthIm,vertices.data());
PXCImage::ImageInfo aa = sample->depth->QueryInfo();
But,vertices' x,y,z is all zero.And I confirmed aa.format is PIXEL_FORMAT_DEPTH_RAW
I try :
depthIm->AcquireAccess(Intel::RealSense::ImageAccess::ACCESS_READ, Intel::RealSense::PixelFormat::PIXEL_FORMAT_DEPTH, &ddata);
ddata.planes[0] is got data of 640*480.
I think ddata.planes[0] == vertices.z ,Right?
And I try another way:
PXCImage* depthIm = projection->CreateDepthImageMappedToColor(sample->depth,sample->color);
projection->QueryVertices(sample->depth,vertices.data());
Then , I can get vertices' x,y,z data. But 628*468.
Please response.
Thank you.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You want to get the (x,y,z) world coordinates relative to the colour image?
Check out /thread/110837 this thread where I recently got it working (in C# but hopefully C++ isn't too different).
In the final code I ended up with the z data mapped to the colour image; I then use ProjectColorToCamera to get the (x,y,z) world coordinates.
Let me know if you need any more help!
James
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for replying James.
I want to get depeth' s xy.
I have already get color image.
like this:
PXCImage *ColorIm = sample->color;
And I don't know how to use ProjectColorToCamera.
Would you tell me how to use about concrete arguments and the example?
I know ProjectColorToCamera.But I don't understand suitable argument.
mckie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To use ProjectColorToCamera we need an array of (i,j,z) points, where i and j are coordinates in the colour image, like so (following on from post # 10 /message/451113# 451113 here):
PXCMPoint3DF32[] cp = new PXCMPoint3DF32[cwidth * cheight];
PXCMPoint3DF32[] cvp = new PXCMPoint3DF32[cwidth * cheight];
for (int j = 0, k = 0; j < cheight; j++)
{
for (int i = 0; i < cwidth; i++, k++)
{
//Create 3D point with the colour (x,y) coordinates and corresponding z value
cp[k] = new PXCMPoint3DF32(i, j, mappedPixels[j * cwidth + i]);
}
}
var s = projection.ProjectColorToCamera(cp, cvp);
Now cvp contains the world coordinates, aligned to the colour image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using c++ .ProjectColorToCamera of c++ is 3 arguments.
https://www.google.co.jp/url?sa=t&source=web&rct=j&url=https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/projectcolortocamera_pxcprojection.html&ved=0ahUKEwi1hMLSzpPSAhUJyrwKHTWuAzEQFggaMAA&usg=AFQjCNFdrqlQgoEnBxkmMONHcy6cgWp4Yg https://software.intel.com/sites/landingpage/realsense/camera-sdk… It is ProjectColorToCamera of c++ manual.
I want to know related first argument.
I could understand about second and third arguments by your description .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd imagine numpoints will be the number of points you're sending it, ie, chieght*cwidth (or k as you already have it calculated)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!! You just said it.
I could solve my problem.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page