- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that there is a memory leak in the implementation of the PXCProjection::CreateColorImageMappedToDepth method.
After every call, the memory usage increases, even though all the resources are being released.
Actually, if I swap CreateColorImageMappedToDepth for the other method, CreateDepthImageMappedToColor, everything runs fine with no memory leaks whatsoever.
This suggests that there is a memory leak on the method, at least on v3.3 of the SDK.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think it is a bug and we will fix it in the future release. Thanks for supporting RealSense SDK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm experiencing the same memory leak issue with CreateColorImageMappedToDepth. Any guess as to when it will be fixed? I'm able to use CreateDepthImageMappedToColor as a workaround.
...Tim...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tim,
You could use CreateDepthImageMappedToColor as that methods works fine, but it will give you an image that matches the color camera, not the depth camera, so you will end up with a smaller field of view.
That method returns a depth image aligned with the color image. Now you can just set every non zero pixel to the rgb value of its corresponding pixel in the color image (they are matched, so you can just use the same pixel coordinates).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, yes, I'm able to use CreateDepthImageMappedToColor for the moment. As you say, it gives a smaller field of view, so it'll be nice when the CreateColorImageMappedToDepth is fixed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, in theory you should be able to get the extrinsic parameter of the cameras by calibrating them yourself. You have the raw IR and the color images so you could match them, and get the KRT matrices. Once you get those, you should be able to implement the method yourself.
It would be nice to have it fixed in the SDK though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
@Hans: did you make sure that you actually call Release() on the PXCImage you receive from the CreateDepthImageMappedToColor() ?
Best,
Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just tested this on the latest SDK, R3 (v5.0), and it is working fine. No more memory leaks present in CreateColorImageMappedToDepth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have found the memory leak still persists in newest version of RealSense SDK (intel_rs_sdk_offline_package_r6_8.0.24.6528)."
When I run the provided code sample "...RSSDK/sample/DF_Projection/", and choose "CreateColorImageMappedToDepth" from the user interface, the task manager of my PC reports 100MB increase of memory consumption every second, till the used memory reaches 1.6Gb, afterwards the mapped image stops updating.
Could you please fix this in the next release or give me a link to the previous release the does not have this memory leak?
There is no memory leak in CreateDepthImageMappedToColor, but I cannot use it instead in my application, I need CreateColorImageMappedToDepth without a memory leak.
Thank you in advance,
Best regards
Anastasia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David Lu (Intel) wrote:
I think it is a bug and we will fix it in the future release. Thanks for supporting RealSense SDK.
Hi, David,
I'm using the F200 camera and I also meet the memory leak problem when I use PXCProjection:CreateColorImageMappedToDepth. My SDK version is 10.0 and my camera model is F200; My code is shown below:
Mat Camera::CreateColorMappedToDepth(PXCImage *color, PXCImage *depth){ PXCImage* colorToDepthImage = this->projection->CreateColorImageMappedToDepth(depth, color); PXCImage::ImageData colorToDepth; this->retStatus = colorToDepthImage->AcquireAccess(PXCImage::ACCESS_READ, PXCImage::PIXEL_FORMAT_RGB24, PXCImage::ROTATION_0_DEGREE, PXCImage::OPTION_ANY, &colorToDepth); if(this->retStatus < PXC_STATUS_NO_ERROR){ std::cout<<"Camera::CreateColorMappedToDepth(PXCImage *color, PXCImage *depth): Error when export data"<<endl; std::cout<<"Error Code: "<<this->retStatus<<endl; exit(0); } Mat colorToDepthMat(Size(colorToDepthImage->QueryInfo().width, colorToDepthImage->QueryInfo().height), CV_8UC3, colorToDepth.planes[0]); colorToDepthImage->Release(); return colorToDepthMat; }
"Camera" is a class I defined to obtain and process the color and depth image. I can get the image data and I can also map the color image to the depth image. But the memory increases about 100MB every second. There is the same problem for the CreatDepthImageMappedToColor.
Could you help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like CreateDepthImageMappedToColor has also a memory leak. Tested with SDK R3 and R2
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page