- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
In my program I'm utilizing both hand tracking, and facial landmarking. My program makes both of these run at the same time on different threads.
I created two separation session instances and assign each component to their own session so they do not interfere with one another. Then run the components on separate threads.
When I run the program every now and then it'll work fine without a problem, but that's a 50/50 chance. The other times I get an exception and the program is forced to exit. I get this
'An unhandled exception of type 'System.AccessViolationException' occurred in libpxcclr.cs.dll.
Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
and it's traced back to " PXCMSenseManager pipeman = mainForm.Session.CreateSenseManager(); and pipeman.Init()"
which is within my face tracking pipeline.
How do I fix this?
Thank you guys!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How did you dispose the sensemanager? As a good practice, always release PXCSenseManager/Session at the end. Please post your dispose code so I can help you further. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi David,
At the end of the while loop containing the pipeline logic I have this
" moduleConfiguration.Dispose();
pipeman.Close();
pipeman.Dispose();
"
so it is disposing of the sensemanager at the end of the pipeline.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since your two threads shared the same camera. It will have problem when you created two session and did not sync them. For example, the first thread has dispose the senseManager and the camera will turn off but the second thread still want to read data from the camera. This will cause such error. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you David! This sheds much light on my problem!
How would I go about sync'ing the two threads with the camera though? I need to have face tracking and hand tracking/gestures in different classes and be able to access both of them independently from one another due to the nature of my project.
Would it be possible for me to use one sense manager within my program's main class, initialize and dispose of it there, and then have it applied to both classes and have face tracking and hand tracking work simultaneously at the same?
I ask this, because last year the PerCSDK had a problem with gesture tracking and voice input being on the same thread due to the algorithms used. I don't want to put forth the work of this possible solution and have it return with another headache.
Thank you for your help!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page