4 Replies Latest reply on Sep 17, 2017 9:37 PM by raunak

    EnhanceDepth for intel-sr300

    raunak

      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: 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