- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm trying to retrieve a personData from bodyTracking module using R200 camera.
I have a while senseManager acquire frames loop and in it I'm using a personTrackingData ptd and querying it to get the Person instance:
...
...
...
while (sm.AcquireFrame(true).IsSuccessful())
{
Thread.Sleep(1000);
// ptm is a PXCMPersonTrackingModule instance
PXCMPersonTrackingData ptd = ptm.QueryOutput();
PXCMPersonTrackingData.Person p = ptd.QueryPersonData(PXCMPersonTrackingData.AccessOrderType.ACCESS_ORDER_BY_ID, 0);
// Get the data
tracker.numberOfPeople = ptd.QueryNumberOfPeople();
tracker.trackingState = ptd.GetTrackingState();
person.presonID = p.QueryTracking().QueryId();
person.pointInfo = p.QueryTracking().QueryCenterMass().world;
printData(person, tracker);
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.Dispose();
...
...
...
On the marked line I get an unhandled exception of type 'System.AccessViolationException' occurred in libpxcclr.cs.dll error.
(Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.)
I read a bit in this issue and saw that it could be caused by using 2 instances of SenseManagers running and using the same resources from 2 threads.
I don't know what it's have to do with QueryPersonData() function I call.
Anyone has an idea that can help me solve this problem?
Yaniv
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not personally experienced with Person Tracking programming. However, when comparing your code to an example script in the Person Tracking documentation, I observed that on the last line, the documentation uses
sm->Release();
whilst your script uses sm.Dispose(); So maybe you could try changing Dispose to Release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yaniv,
Did you try MartyG's suggestion? Did it work?
Please let us know if you still have issues.
Have a nice weekend.
Regards,
Leonardo R.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I solve it myself by adding a condition before the function call.
I put an if statement - querying the number of people being tracked.
If the number is greater than 0, than I called ptd.QueryPersonData function.
Yaniv.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad you found a solution! Good luck with the rest of your project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yaniv,
That's great! Thank you so much for letting us know.
Feel free to contact us when you have doubts.
Have a nice day.
Regards,
Leonardo R.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page