Not able to find Face and FaceRecognition classes

beta :

I am working on Face Recognition java project using OpenCV 3.4.0. For that using createFisherFaceRecognizer(0,1500) method but OpenCV doesn't contain this class and method. Does anyone know about OpenCV? Please let me know how to use it.

These are imports

import org.opencv.face.Face;
import org.opencv.face.FaceRecognizer;

Thanks in advance.

Arunachalam Muthupalaniappan :

There is another thing called OpenCV-contrib that is required to run the following Face class .

This is the GitHub repo link . Read the README.md

Follow the given steps : -

  1. Download the original OpenCV repo and the contrib repo from GitHub.

  2. Go to opencv_contrib/modules/face and open cmakeLists.txt with any editor . Now find the line that begins with ocv_define_module and add the word 'java' (no quotes) in the end .

    [Looks like:-

    ocv_define_module(face opencv_core opencv_imgproc opencv_objdetect WRAP python java)]

3.Compile using cmake using this : cmake -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=path to opencv_contrib

Use the generated jar!

PS:In windows , I don't think the default .exe opencv installer contains the face classes , so its better to build with cmake .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=108531&siteId=1