如何使用从Java在openCV中创建的FaceRecognizer库? [英] How to use the FaceRecognizer library created in openCV from Java?

查看:155
本文介绍了如何使用从Java在openCV中创建的FaceRecognizer库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Java中实现人脸识别器.我得到了代码示例,进行更改以适合我对系统行为的要求.它可以工作,但是当我在不同的光强度下获得同一个人的图像时,其效率就会下降.我读到openCV中插入了一个用于faceRecognizer的库,但是其示例在c ++中实现.有什么办法可以使用此库在Java中进行编码吗?而且如果我们可以使用它,那么它将提高代码的效率吗?

I am trying to implement a face recognizer in java. I got this code example and made changes to fit my requirements on how the system should behave. It works but then when I have images of the same person in different light intensities its efficiency drops. I read that there is a library inserted in openCV for faceRecognizer but then its samples are implemented in c++. Is there any way i can use this library to code in java? and also if we can use it then will it increase the efficiency of the code?

请为此提供一些帮助.严重地卡在上面...

Please do provide some help on this. Stuck on it badly...

推荐答案

您可以为Java创建C ++ dll.您应该编写一个使用C ++代码的包装器类(在C ++中).包装类的函数定义应使用JNI.此链接此处应该会有所帮助(对我来说).实现包装器类后,将其导出为dll.

You can create a C++ dll for java. You should write a wrapper class (in C++) which uses your C++ codes. Function definitions of the wrapper class should use JNI. This link here should be helpful (it was for me). After you implement the wrapper class, export it as a dll.

这篇关于如何使用从Java在openCV中创建的FaceRecognizer库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆