Face recognition using OpenCV in Java — Updated

Manish Bansal
Dec 27, 2018 · 2 min read
source: https://statescoop.com

This article is in continuation of my earlier article called Face Recognition Using OpenCV in Java. If you have not gone through it yet, I would recommend you to go through it first. And then you can come back to this article.

As mentioned in that article, if one needs to use any opencv modules like face recognition, which is not part of standard release, he/she will have to manually build it. And the same was explained in great detail.

However, if you have yourself tried building it, you must have already understood the grave pain of doing the build. But, there is an another way to it. Which I will call the Lazy way or The Maven way. Yes. You heard it right!!

All praise goes to bytedeco team who have provided us the java wrapper around the opencv java bindings. Along with that, they have also provided the pre-built cross platform java bindings along with cpp binaries for both standard as well as contrib repository. Cool right!! Therefore, if you are lazy like me who hate going through the painful build process, you can take this path.

I have ported my previous eclipse project to the maven project which you can clone from this repository.

Below are the steps you need to follow.

1. Install the maven for your platform. I did it on windows 8.

2. Import the project in eclipse. I used Mars version.

3. Right click on the project, Run as, Maven Install.

4. After this, eclipse will download all the dependent jars. And once done, you will be good to go.