Problems with PXCGesture::ProcessImageAsync() function and synchronization

Problems with PXCGesture::ProcessImageAsync() function and synchronization

All the samples work fine.

I`m trying to use SDK without utility lib.

I read the SDK documentation and everything was clear, nothing I could not understand. I tried to implement my own utility classes to start catching gestures, but ran into a problem, the reason of which I cant understand, and I hope someone can help me.

My library initializes those instances:

  • (1) PXCSession - ok
  • (2) PXCSessionService, PXCScheduler, PXCCapture, PXCCapture::Device - ok

Then I create PXCGesture, query its ProfileInfo. There I see field "inputs", that is VideoStreamDesc - an array of 4 elements - with defines streams, that will be captured by camera (in SDK docs its said, that I can require multiple streams, but there I saw only one - 320x240 depth data) to recognize hand moves. Then I start submitting read tasks (stream[j]->ReadStreamAsync(&images[j], &syncs[j]) - this fills out my "images" (PXCSmartArray<PXCImage>) and "syncs" (PXCSmartSPArray) arrays and then use PXCSmartAsyncImplIxOy class (it calls my callbacks correctly, synchronizes all sync points and releases them, returns a single sync point I call to get images).

After I got images (statuses are ok for all streams - PXC_STATUS_NO_ERROS, because if something fails, function will return non-zero value, and I shall notice it since I log all returned values where necessary).

So, after submitting the read task to streams, I call the returned sync point (sync->Synchronize()) to complete capturing images, then I call gesture->ProcessImageAsync() to recognize images - this function returns another sync point. When I don't show my hands to camera, this function works fine, but when it starts seeing my hands, the last synchronization fails, the breakpoint triggers:

First-chance exception at 0x58AF0271 (CILib.dll) in PerceptualGesturesd.exe: 0xC0000005: Access violation reading location 0x1BBA74B5.

Unhandled exception at 0x58AF0271 (CILib.dll) in PerceptualGesturesd.exe: 0xC0000005: Access violation reading location 0x1BBA74B5.

Did I miss something? I had carefully checked to sources of UtilCapture class, the SDK says:

// session is a PXCSession instance

PXCGesture::ProfileInfo pinfo;

gesture->QueryProfile(0,&pinfo);

 

UtilCapture capture(session);

capture.LocateStreams(&pinfo.inputs);

 

gesture->SetProfile(&pinfo);

then

for (;;) {

   PXCSmartArray<PXCImage> images;

   PXCSmartSPArray sps(2);

 

   // Get samples from input device and pass to the gesture module

   capture.ReadStreamAsync(images,&sps[0]);

   gesture->ProcessImageAsync(images,&sps[1]);

   sps.SynchronizeEx();

 

   // Tracking results are ready. Now process them

   …

}

The only difference is that I don't have "PXCSmartSPArray sps(2)" - I have 2 sync points and I call the first one after "ReadStreamAsync", the second one after "ProcessImageAsync".

Everything works fine with simple capturing - I had located to streams, color and depth, accessing the image data, releasing access, that it worked perfectly. But when I try to process images with PXCGesture, I triggers a breakpoint. I had subscribed gesture handler and gesture alert handler - it works, but only for 10-20 iterations, then I see the same breakpoint triggered.

Please, help.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I`d figured out the reason why it kept happening:

  • first, I set gesture profile just before I`d located video streams (that should be done vice versa)
  • second reason was that one should use pointer to Profile.inputs field -> in my implementation I passed a copy of this array

That Util... classes are awesome, but it would be nice for developers to mention such things in SDK documentation.

I wonder, when the next release R8 will be available? I hope that bug with face comparison will be fixed. Maybe the developer team could make some kind of hotfix for this issue? Why are previous releases not available for download (I cannot find them... If they are available, send me a link, please)?

 

 

I`d figured out the reason why it kept happening:

  • first, I set gesture profile just before I`d located video streams (that should be done vice versa)
  • second reason was that one should use pointer to Profile.inputs field -> in my implementation I passed a copy of this array

That Util... classes are awesome, but it would be nice for developers to mention such things in SDK documentation.

I wonder, when the next release R8 will be available? I hope that bug with face comparison will be fixed. Maybe the developer team could make some kind of hotfix for this issue? Why are previous releases not available for download (I cannot find them... If they are available, send me a link, please)?

 

 

I`d figured out the reason why it kept happening:

  • first, I set gesture profile just before I`d located video streams (that should be done vice versa)
  • second reason was that one should use pointer to Profile.inputs field -> in my implementation I passed a copy of this array

That Util... classes are awesome, but it would be nice for developers to mention such things in SDK documentation.

I wonder, when the next release R8 will be available? I hope that bug with face comparison will be fixed. Maybe the developer team could make some kind of hotfix for this issue? Why are previous releases not available for download (I cannot find them... If they are available, send me a link, please)?

 

 

Leave a Comment

Please sign in to add a comment. Not a member? Join today