Items with no label
3335 Discussions

EnhanceDepth for intel-sr300

jkohl1
Beginner
1,621 Views

Hi,

I have been trying to implement the EnhanceDepth method from intel docs in a c# application, to get normalized depth image from my sr300 camera.

Currently the stream captured is very dark and the depth is not normalized. From intel docs i found the EnhanceDepth method which can solve this but i'm unable to use this method in the application code.

I am not getting how i am to get depth as PXCMPhoto and then use function, after which i have to return it back to PXCMImage.

This is the c# application code i am using for viewing the color and depth frame on a button click:

"

PXCMSession session = PXCMSession.CreateInstance();

PXCMSession.ImplVersion version = session.QueryVersion();

PXCMSenseManager sm = session.CreateSenseManager();

sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 0, 0);

sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH, 0, 0);

sm.Init();

pxcmStatus status = sm.AcquireFrame(true);

PXCMCapture.Sample sample = sm.QuerySample();

PXCMImage image = sample.color;

PXCMImage dimage = sample.depth;

PXCMImage.ImageData data;

image.AcquireAccess( PXCMImage.Access.ACCESS_READ, PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, out data);

WriteableBitmap wbm = data.ToWritableBitmap(0, image.info.width, image.info.height, 96.0, 96.0);

PXCMImage.ImageData data2;

dimage.AcquireAccess(PXCMImage.Access.ACCESS_READ, PXCMImage.PixelFormat.PIXEL_FORMAT_DEPTH_RAW, out data2);

WriteableBitmap wbm2 = data2.ToWritableBitmap(0, dimage.info.width, dimage.info.height, 96.0, 96.0);

image1.Source = wbm;

image2.Source = wbm2;

image.ReleaseAccess(data);

image.ReleaseAccess(data2);

sm.ReleaseFrame();

sm.Close();

session.Dispose();

"

link to method on intel site: https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/enhancedepth_photoutils_pxcenhancedphoto.html EnhanceDepth

Please help me out in using this function. Any references to existing code samples would be appreciated as well!

If the same can be done in python then information on the same would be helpful too.

kishankk

0 Kudos
4 Replies
MartyG
Honored Contributor III
250 Views

If you view this page with the index side-panel visible then it reveals in small print at the top of the page that this is an R200 camera feature, unfortunately.

https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?enhancedepth_photoutils_pxcenhancedphoto.html Intel® RealSense™ SDK 2016 R2 Documentation

0 Kudos
jkohl1
Beginner
250 Views

Thank you for your response.

Yes i checked that. However, i was hoping that the method would be compatible with sr300 as well, since the cameras itself are quite similar to each other and one is merely in an upgrade. Are you certain that the method is not supported for sr300?

Any suggestion for alternatives to getting normalized/enhanced depth from the sr300 would be very helpful as well!

MartyG

0 Kudos
MartyG
Honored Contributor III
250 Views

I believe that EnhanceDepth is part of an R200-only set of functions called Enhanced Photography that were originally designed to be used with rear-facing R200 cameras built into tablet devices.

https://software.intel.com/en-us/articles/intel-realsense-camera-r200-enhanced-photography-code-sample Intel® RealSense™ Camera R200 Enhanced Photography Code Sample | Intel® Software

I note that you tagged the user Kishankk at the base of your original message, so have probably seen their message about dark scans, which now has replies added to it.

0 Kudos
jkohl1
Beginner
250 Views

Thank you for your inputs.

0 Kudos
Reply