You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added libOpenCvSharpExtern.so in /lib/armeabi-v7a and set the "Build Action = AndroidNativeLibrary".
Also added "haarcascade_frontalface_default.xml" to Assets and set "Build Action = AndroidAsset"
Then in MainActivity:
Mat ImageOne = Mat.FromImageData(GetBytesFromBitmap(img1), ImreadModes.GrayScale);
Mat ImageTwo = Mat.FromImageData(GetBytesFromBitmap(img2), ImreadModes.GrayScale);
string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
string filename = System.IO.Path.Combine(path, "haarcascade_frontalface_default.xml");
File.WriteAllText(filename, GetTextFromAsset("haarcascade_frontalface_default.xml"));
using (var imageOne = ImageOne)
using (var imageTwo = ImageTwo)
using (var model = FaceRecognizer.CreateEigenFaceRecognizer())
Here in last line
FaceRecognizer.CreateEigenFaceRecognizer()
It throw a exception because cant find the cv::face, that's because my extern.so was compiled without the face class implementation.
I'm trying now to have the complete .so (building from source), but always throw the exception:
1> undefined reference to 'cv::face::createEigenFaceRecognizer(int, double)'
An error will occur if the following processing.
How should I implement it?
C#
Stream input = Resources.OpenRawResource(Resource.Raw.haarcascade_frontalface_default))
Java.IO.File dir = GetDir("cascade", FileCreationMode.Private);
Java.IO.File file = new Java.IO.File(dir, "haarcascade_frontalface_default.xml");
var output = new FileOutputStream(file);
byte[] buf = new byte[2048];
Output(output, buf);
input.Dispose();
output.Dispose();
string resource = file.AbsolutePath;
var cascade = new CascadeClassifier(resource);
The text was updated successfully, but these errors were encountered: