带有Java的OpenCv 3.0.0人脸识别器 [英] OpenCv 3.0.0 Face Recognizer with Java

查看:439
本文介绍了带有Java的OpenCv 3.0.0人脸识别器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写这篇文章,问我如何在JAVA项目中使用Face Recognizer. 我正在尝试使用cmake生成带有所有贡献的opencv3.0.0.0的jar文件,但是生成的生成的jar仅包含标准模块.我也尝试过使用2.4.11版本,但是我不知道如何制作人脸识别器类的具体实例.

I'm writing this post to ask how I can use Face Recognizer in a JAVA project. I'm trying to generate with cmake the jar file of opencv3.0.0.0 with all its contribs, but the resulted generated jar contains only standard modules. I've also tried to use the 2.4.11 version but i can't realize how to make a concrete instance of the face recognizer class.

推荐答案

在任何文档中都很难找到的一部分是关于编辑contrib模块的CMakeLists.txt.看来这是您唯一缺少的部分,但是我在下面为其他人提供了完整的分步过程.

The one part that is a bit tricky to find in any documentation is about editing the CMakeLists.txt for the contrib modules. It seems that is the only part you are missing, but I have included the full step-by-step process below for others.

  1. 此处
  2. 下载/克隆opencv存储库
  3. 此处
  4. 处下载/克隆opencv_contrib存储库
  5. 转到opencv_contrib/modules/face并编辑CMakeLists.txt
  6. 找到以ocv_define_module开头的行,并添加"java",使其看起来像这样:

  1. Download/clone opencv repository found here
  2. Download/clone opencv_contrib repository found here
  3. Go to opencv_contrib/modules/face and edit CMakeLists.txt
  4. Find the line that begins with ocv_define_module and add "java" so that it looks something like this:

ocv_define_module(面对opencv_core opencv_imgproc opencv_objdetect WRAP python java)

ocv_define_module(face opencv_core opencv_imgproc opencv_objdetect WRAP python java)

  • 使用contrib模块编译opencv 正常,即向cmake添加适当的参数,如下所示:

  • Compile opencv with contrib modules as normal, i.e. adding the appropriate parameters to cmake as follows:

    cmake -D CMAKE_BUILD_TYPE =发布-D OPENCV_EXTRA_MODULES_PATH =< opencv_contrib的路径>

    cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=<path to opencv_contrib>

  • bin/文件夹中内置的JAR现在将包含org.opencv.face包

  • The JAR built in the bin/ folder will now contain the org.opencv.face package

    这篇关于带有Java的OpenCv 3.0.0人脸识别器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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