View my account

Best way to save snapshots

Comments

4 comments

  • MartyG

    Hi Juan Diezyanguas  I note that you asked about writing to a jpg image with C# in the past case at the link below.

    https://support.intelrealsense.com/hc/en-us/community/posts/21724705791251-Save-Raw-DepthFrame-in-c

     

    In regard to your current question in this case, C# code at the link below for another approach to saving to jpg may be a helpful reference.

    https://github.com/IntelRealSense/librealsense/issues/7307

    0
    Comment actions Permalink
  • Juan Diezyanguas

    Hi MartyC,

    Yeah, that's true. I have asked that in the past, but in the pas I was looking for distances.

    I have noticed that the CopyTo() method can copy to a byte array [stride * height] if I want the image bytes for rgb and also can copy to ushort array [width * height] if I want to get raw distance matrix.

    Is that correct?

    Regarding the link you have send it seems to be similar. It's using Marshal.Copy instead of CopyTo(), but it's using directly Jpeg encoder instead of WritableBitmat I'll try it, I supose it is a better way.

    With regards,

    0
    Comment actions Permalink
  • MartyG

    The link below may help with your CopyTo() / ushort question.

    https://github.com/IntelRealSense/librealsense/issues/4201

    0
    Comment actions Permalink
  • Juan Diezyanguas

    I have tried both ways to save Jpeg that you have send me.

    I didn't know about ImageSharp but it looks like it's a very good library to work with images.

    I have used Stopwath() to see if it's better than my way but it is slower.

    Marshall way is similar to my way but don't have rotation option (easy) so maybe my way it's good to save images.

    0
    Comment actions Permalink

Please sign in to leave a comment.