Thanks so much for this amazingly helpful tutorial! I got the camera and image conversions working beautifully, but I was wondering if you could help with an issue integrating OpenCV in Swift. (I set up OpenCV in Swift according to your earlier tutorial.)
For each frame, I want to run face detection and emotion recognition. However, when I try to load the Fisher face classifier, I get 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
First of all, I don’t know why it’s referring to a module outside my project directory. I have copied opencv2.framework into my Xcode project.
Second of all, I don’t know why it can’t open my saved model (it’s saved as “fishface_ckplus.xml”). I copied the .xml file into my Xcode project, as well.
Any thoughts on why I can’t load the model? Any help would be greatly appreciated!