NITE2::UserTracker crashes when reading from oni files - c++

I have recorded an oni file using a kinect and OpenNI NIViewer.
I want to track skeletons in that record file so I am using OpenNI2 and NITE2
I can create an openi device with the oni file but when I try to create a nite2 user tracker using that device it crashes and I get the following error:
0xC0000005: Access violation reading location 0x000000000000004c
On the cmd window I got the following message:
Couldn't getXN_STREAM_PROPERTY_PARAM_COEFF
Here is my code:
openni::Status rc = openni::OpenNI::initialize();
openni::Device device ;
rc = device.open("file.oni");
nite::UserTracker userTracker;
nite::NiTE::initialize();
niteRc = userTracker.create(&device);
Any Help is largely appreciated.
Could you please also advise if there are any other ways to track selections in recorded oni files?
Regards

I also experienced your same problem.
I recorded the oni files with the OpenNI2 sample NiViewer. The recorded file can be loaded using NiViewer itself (therefore the file is not corrupt), but if I try to open the saved file with the Nite2 sample UserViewer, I experience your same error.
The only way I've found to solve the problem id downgrading from Nite 2.2 to Nite 2.0 (as suggested in Creating a UserTracker crashes in NITE2 python bindings)
The strange thing is that I tested this saving/loading procedure with both Kinect and Asus Xtion, but I had this problem only with Kinect savings.

Related

OpenCV error when loading Fisher face recognizer in Xcode 8

I've imported opencv and opencv_contrib frameworks in an Xcode project, and in my Objective-C++ file, I load a face classifier and then a Fisher face recognizer:
// set up classifier, recognizer, and webcam
-(void) setupAnalyzer:(NSString *)faceCascadeName :(NSString *)fisherDatasetName
{
// load face classifier
cout << "loading face classifier..." << endl;
String faceCascadeNameString = string([faceCascadeName UTF8String]);
faceCascade.load(faceCascadeNameString);
// load face recognizer
cout << "loading face recognizer..." << endl;
fishface = createFisherFaceRecognizer();
String fisherDatasetNameString = string([fisherDatasetName UTF8String]);
fishface->load(fisherDatasetNameString);
}
When I call this function from Swift, it seems the face classifier loads just fine with an xml file I have in my project. But when I try to load the Fisher face recognizer using another xml file in my project, Xcode shows this error:
OpenCV Error: Unspecified error (File can’t be opened for reading!) in load, file ~/opencv/modules/face/src/facerec.cpp, line 61
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: ~/opencv/modules/face/src/facerec.cpp:61: error: (-2) File can’t be opened for reading! in function load
I've tried rebuilding the OpenCV frameworks in different ways and I keep getting the same error!
First of all, I'm confused why the program is looking to source code that isn't contained in the project (it's looking for facerec.cpp in another directory on my computer). Also, why does the cascade classifier load just fine? This makes me think it's an issue with the way I built the opencv_contrib modules, because the face classifier comes from opencv_contrib. But I tried rebuilding opencv_contrib, and I still get this OpenCV error.
Any help would be greatly appreciated!
[UPDATE]
It is not an issue with building the contrib module. I manually included the module in Xcode, so it's now looking within the project for the facerec.cpp, but it still can't open the xml file for reading.
First of all, I'm confused why the program is looking to source code that isn't contained in the project (it's looking for facerec.cpp in another directory on my computer).
It doesn't search for file. It shows you where error was happen. Since your library was build on your machine and has debug information it can point you source file and line number where error happen.
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: ~/opencv/modules/face/src/facerec.cpp:61: error: (-2) File can’t be opened for reading! in function load
This message means that exception was generated at line 61 in file facerec.cpp. You need to check if your data is available for reading.
Figured it out! This answer helped me realize that I needed to get the app bundle's path to the xml files: OpenCV Cascade Classifier load error iOS

VideoCapture::read always returns false

I'm running OS X El Capitan and trying to use OpenCV VideoCapture to read an .avi file. I've tried it on both opencv 2.4.1 and 3, both of which have the same outcome.
cv::VideoCapture capture("filename.avi");
cv::Mat currentFrame, prevFrame;
bool capPrevSuccess = capture.read(prevFrame);
bool capCurrSuccess = capture.read(currentFrame);
I've verified that the filename.avi is in the current working directory and I don't see any errors in the console.
I'm beginning to wonder if it's something with my machine. I have a similar problem running VideoReader in MATLAB on the same machine. I believe MATLAB uses OpenCV VideoReader as well, perhaps they're connected.
Error using VideoReader/init (line 619) Failed to initialize internal
resources.
Error in VideoReader (line 172)
obj.init(fileName);
EDIT: Looks like this has something to do with the video files I'm using. I downloaded an mp4 video, and had no trouble with it. Unfortunately I need to use the video files I'm using (all .avi), yet they all seem to not work with VideoCapture.

Segmentation Fault with Libvlc on Mac OSX

I am using the exact same code as here. I just replaced the file reading part with this:
char* filename = "testVLC.mpg";
media = libvlc_media_new_path(vlcInstance, filename);
I get a segmentation fault at the second line above. The video file is in the same folder as the cpp file. Am I doing something wrong?
If you use libvlc v2.2 - you have to use slightly modified libvlc tree (I have one prepared, please extract it from command line, to preserve symlinks)
The problem is libvlc v2.2 has a bug which leads to load libvlccore by plugins from wrong place

EDSDK cpp error: 10 EDS_ERR_MISSING_SUBCOMPONENT

I am trying to get started with EDSDK to control my Canon 500D. I'm new to cpp, and windows XP apps and I'm using visual studio. After a great deal of blind trial and error I have finally managed to get the app to compile the basic sample code from the documentation. To do this I have the EDSDK.h, EDSDKTypes.h and EDSDKErrors.h headers in the right places and the EDSDK.dll and EDSDK.lib in the same folder as the code. It seems to be picking these up. I have got the 500D to be recognised by the PC so I believe the USB drivers are there.
The code is just trying to pick up the camera:
EdsError err=EDS_ERR_OK;
EdsCameraListRef cameraList=NULL;
err = EdsGetCameraList(&cameraList);
if(err == EDS_ERR_OK)
{...}
However, when I run this console app the error is picked up as 10 - which suggests, according to the document, that there is a missing subcomponent. This happens both if the camera is connected or not, so I'm thinking this is something missing from the compile. But I am getting nowhere with the documentation.
I have installed the edsdk 2.4 Windows version from a download not the official route, so this may be an issue.
Can anyone help? Specifically how can I find out what the missing subcomponent might be so I might include it. Is this a subcmponent of the build like a header file or something like a driver?
I know, old question but still it might help someone with the same problem.
From the documentation:
All DLLs are required in order to execute an EDSDK client application.
All of the modules in the DLL folder must be copied into the same folder where the EDSDK client application is in.
This means you'll have to have all DLLs beside your *.exe. Namely these DLLs:
DPPDLL.dll
DPPLibCom.dll
DPPRSC.dll
EDSDK.dll
EdsImage.dll
Mlib.dll
Ucs32P.dll

Facebook Actionscript API examples not compiling - application descriptor not found

Trying to run some of the desktop(AIR) samples located here
http://code.google.com/p/facebook-actionscript-api/
No matter what I try get the error message
Process terminated without establishing connection to debugger.
application descriptor not found
But as far as I can tell there IS a proper descriptor file (XML) present in my bin-debug folder.
Anyone have an idea what is happening? Could the issue have something to do with the Flexsdk I am using (4.6) when combined with the latest AIR 3.4?
This is my application descriptor file WITHOUT most of the commented code
<id>MediaUploadDemo</id>
<filename>MediaUploadDemo</filename>
<name>MediaUploadDemo</name>
<version>v1</version>
<initialWindow>
<content>MediaUploadDemo.swf</content>
</initialWindow>
Found most of my answers here
http://alpha-beta-pruning.blogspot.ca/2011/06/migrating-flex-3-project-to-flex-45.html
Key paragraph
'Each AIR sdk tends to have it's own application descriptor file formatting which means that an application that was created with AIR 2.0 must "migrate" its descriptor file to the new AIR 2.7 sdk. My suggestion is creating from scratch a new project that targets the new sdk, just so we can take its descriptor file, copy/paste it to our "old" project and change the necessary values to adapt our project (such as project name, etc).'