0

I am trying to use the Intel Real Sense SDK to acquire some guided frames and then I am trying to stitch them using the Intel Stitching algorithm. However, the SetFileName function is not writing the file to the directory. Can you please help?

PXCMSenseManager pp = PXCMSenseManager.CreateInstance();

RaiseMessage("Starting...");

pp.EnableFace()
pp.Enable3DScan()

if (!string.IsNullOrEmpty(StreamOutputFilename))
{
    if (File.Exists(StreamOutputFilename)) throw new Exception("File already exists");

    {
        System.Diagnostics.Debug.WriteLine(StreamOutputFilename);
        pp.QueryCaptureManager().SetFileName(StreamOutputFilename,true);
John Odom
  • 1,189
  • 2
  • 20
  • 35
Praveen
  • 174
  • 15
  • I can't figure out from the docs when the file is supposed to be created, but it could be from the `Init()` call as shown [here](https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?doc_essential_record_and_playback_streams.html). Also the `SetFileName()` method can return an error, you should check with `IsError()`, for example if the file isn't writable i think you'll get an error: `if (pp.QueryCaptureManager().SetFileName(StreamOutputFilename,true).IsError()) { an error occurred } else { continue }` – Quantic Apr 21 '17 at 15:12
  • @Quantic: Thanks for your comments. I did try the Is error function but unfortunately, it did not return any error. But I cannot see any file created after initializing the SetFileName function. Do you have any more ideas? – Praveen Apr 24 '17 at 14:24
  • @Quantic any ideas? – Praveen Apr 25 '17 at 13:50
  • No sorry I just had this tab open and responded because there was zero comments after a whole day. I've never used Intel Real Sense. I don't understand why you don't have an `Init()` call like in the examples, have you tried adding it? Have you tried running as administrator? – Quantic Apr 25 '17 at 15:07
  • @Quantic: Thanks for your information.And yes, I am adding init() right after calling the function. Do you think admin rights will be an issue? I will try that. And do you have any ideas to use any manual function calls instead of calling this function(Setfilename) which comes in the SDK? – Praveen Apr 25 '17 at 19:43
  • Trying admin rights is sort of a catch all "let's just give a try to see what happens", I was mainly thinking about permission issues in the destination directory but there are other things it could affect. I don't think it's guaranteed the file will be created with `SetFileName`, it may only be created once another call comes in that actually creates data, but I don't even understand what calls retrieve source data and what calls write data, i.e., the example I linked shows `AcquireFrame`, then they mention editing that data, but when is that data written? Sorry I can't be more help. – Quantic Apr 25 '17 at 22:34
  • @Quantic: Thanks for your insights. I did try running as an administrator. But I did not get any advantage. Let me know if you come up with any more insights – Praveen Apr 28 '17 at 14:09

1 Answers1

1

Please refer to the solution here

int wmain(int argc, WCHAR* argv[]) {
// Create a SenseManager instance
    PXCPointF32 *uvmap = 0;
    pxcCHAR *file = L"C:\\new.rssdk";
    PXCSenseManager *sm = PXCSenseManager::CreateInstance();
    // Set file recording or playback
    sm->QueryCaptureManager()->SetFileName(file, 1);
    // Select the color stream
    sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH, 640, 480, 0);
    // Initialize and Record 300 frames
    sm->Init();
    for (int i = 0; i<300; i++) {
         // This function blocks until a color sample is ready
        if (sm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;
        // Retrieve the sample
        PXCCapture::Sample *sample = sm->QuerySample();
        sm->ReleaseFrame();
    }
    // close down
    sm->Release();
    return 0;
}
  • 1
    Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Tim Diekmann May 29 '18 at 06:42