Java中的人脸识别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1595422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 16:34:15  来源:igfitidea点击:

Face recognition in Java

javaimage-processingface-recognition

提问by user189352

Can any one suggest me an open source face recognition framework in Java?

任何人都可以向我推荐一个 Java 中的开源人脸识别框架吗?

回答by Paul Lammertsma

Check out OpenCV. A well-documented and acclaimed face detection technique by Viola & Jones has been implemented, known as Haar cascade.

查看OpenCV。已经实施了 Viola & Jones 有据可查且广受好评的人脸检测技术,称为 Haar 级联。

A complete tutorial -- from training to experimentation -- is available here. Note that you don't actually need to do training; OpenCV comes bundled with several feature cascades, including a few for face detection.

完整的教程 - 从培训到实验 -可在此处获得。请注意,您实际上并不需要进行培训;OpenCV 捆绑了几个功能级联,包括一些用于人脸检测。

回答by Shervin Emami

There are a few open-source Face Recognition Java systems you can try, but don't expect much, because I am looking for the same thing but I'm still looking for a better option!

您可以尝试一些开源人脸识别 Java 系统,但不要期望太多,因为我正在寻找相同的东西,但我仍在寻找更好的选择!

Note that finding any face within in image is called "Face Detection", following any face is called "Face Tracking", and determining the identity of a detected face is called "Face Recognition". I'm telling you this because you probably have to use different software and algorithms to do each one! The answer by Paul tells you that OpenCV can do Face Detection easily (Haar Cascade Detector), but not Face Recognition as easily (actually it does have a way to do Eigenface Recognition), which it sounds like you need Face Recognition, so OpenCV isn't necessarily your best option since you are using Java.

请注意,在图像中查找任何人脸称为“人脸检测”,跟踪任何人脸称为“人脸跟踪”,确定检测到的人脸的身份称为“人脸识别”。我告诉你这个是因为你可能必须使用不同的软件和算法来完成每一个!Paul 的回答告诉你 OpenCV 可以很容易地进行人脸检测(Haar Cascade Detector),但没有人脸识别那么容易(实际上它确实有办法进行特征人脸识别),这听起来像你需要人脸识别,所以 OpenCV 不是不一定是您最好的选择,因为您使用的是 Java。

You can try FAINT which does both Face Detection and Face Recognition in Java, but it is pretty much undocumented. There is also "http://darnok.org/programming/face-recognition/", but I can't seem to get good results out of it. There is also "http://uni.johnsto.co.uk/faces/" for Face Recognition, and "Neuroph" for Face Recognition / Detection.

您可以尝试 FAINT,它在 Java 中同时进行人脸检测和人脸识别,但它几乎没有记录。还有“ http://darnok.org/programming/face-recognition/”,但我似乎无法从中得到好的结果。还有用于人脸识别的“ http://uni.johnsto.co.uk/faces/”和用于人脸识别/检测的“Neuroph”。

If you find a good solution, please tell me at "[email protected]" Good Luck! Shervin Emami

如果你找到一个好的解决方案,请告诉我“[email protected]”祝你好运!谢文·艾玛米

回答by Andrew Scott Evans

Accurate face recognition is a task that can be broken into several steps:

准确的人脸识别是一项可以分为几个步骤的任务:

  1. Face detection
  2. Facial landmark point discovery
  3. Rotation, cropping, alignment, and scaling using your landmarks
  4. Facial descriptor point discovery (these are not human readable)
  5. Comparison to known faces to find the closest match
  1. 人脸检测
  2. 面部标志点发现
  3. 使用地标进行旋转、裁剪、对齐和缩放
  4. 面部描述符点发现(这些不是人类可读的)
  5. 与已知面孔进行比较以找到最接近的匹配

This can be done with several libraries but requires bytedecowrappers for OpenCV and Caffe as well as a library such as ND4j for matrix comparison.

这可以通过多个库来完成,但需要OpenCV 和 Caffe 的bytedeco包装器以及用于矩阵比较的 ND4j 等库。

OpenCVhas HAAR cascades for face detection and can use flandmark for facial point recognition. This will allow you to perform steps 1-3.

OpenCV具有用于面部检测的 HAAR 级联,并且可以使用 flandmark 进行面部点识别。这将允许您执行步骤 1-3。

Facial descriptor discovery can be done using the bytedeco wrapper for Caffeand VGG Face Descriptor library (http://www.robots.ox.ac.uk/~vgg/software/vgg_face/)

面部描述符发现可以使用Caffe的 bytedeco 包装器和 VGG 面部描述符库 ( http://www.robots.ox.ac.uk/~vgg/software/vgg_face/) 完成

Finally, Nd4jcan be used for comparing images. If you have enough images classified by individual, perhaps you can use a neural network from the library for classification.

最后,Nd4j可用于比较图像。如果您有足够多的按个人分类的图像,也许您可​​以使用库中的神经网络进行分类。