你如何通过标签参数为(MAT)来自OpenCV的Java中facerecognizer? [英] How do you pass the labels parameter as a (Mat) to facerecognizer from OpenCV in Java?
问题描述
所以我想实现从Android上OpenCV的API的贡献部分的脸部识别方法。 API文档可以在这里找到: http://docs.opencv.org /modules/contrib/doc/facerec/facerec_api.html
So I'm trying to implement the Face Recognizer methods from the contributed section of the OpenCV API on Android. The API documentation can be found here: http://docs.opencv.org/modules/contrib/doc/facerec/facerec_api.html
我遇到的问题是,Java API中,火车的方法是:
The problem I'm having is that in the Java API, the train method is:
public void train(List<Mat> src, Mat labels){
Mat src_mat = Converters.vector_Mat_to_Mat(src);
train_0(nativeObj, src_mat.nativeObj, labels.nativeObj);
return;
}
我不能为我的生命,让调用,因为(MAT)的工作标签输入。在C ++文档,它要求一个整数向量,所以我想通过一维垫,但没有运气。任何人有这个问题或对如何解决这个一些见解?
I cannot for the life of me, get the call to work because of the (Mat) labels input. In the c++ documentation it calls for a vector of integers, so I tried passing a 1D Mat, but no luck. Anyone had this problem or have some insight on how to tackle this?
推荐答案
哦,亲爱的,貌似你有没有发现,你不能的创建的一个FaceRecognizer在OpenCV中的Java API截至目前?
oh dear, looks like you haven't found out, that you cannot create a FaceRecognizer in the opencv java api as of now ?
这是一个已知的错误,你就需要一些技巧JNI建工厂缺少的功能。
it's a known bug, you would need some jni skills to build the missing factory functionality.
除非你解决这个问题,不用担心标签...
unless you solve that, don't worry about the labels ...
这篇关于你如何通过标签参数为(MAT)来自OpenCV的Java中facerecognizer?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!