Reputation: 55
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.
Upvotes: 3
Views: 1885
Reputation: 29
org.opencv.face
is not available with OpenCV. For that, opencv-contrib
is required which can be easily added. Follow the link:
Upvotes: 0
Reputation: 307
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 : -
Download the original OpenCV repo and the contrib repo from GitHub.
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 .
Upvotes: 2