Melvin Cerba
Posts: 3
Joined: Wed Mar 07, 2018 6:21 pm

Facial Detection and recognition

Wed Mar 07, 2018 7:58 pm

Hello !
First, I must apologize for my english, it not my first language. I am in high school, and I would like to create a facial recognition device that makes acquaintance for the teacher. He would take a picture of the class, and the device would return him a list of the missing students. It is quite ambitious, since I'm a beginner ( I've been learning python's basics this year, but that's basically it ), but I am willing to learn. I already have the hardware ( a raspberryPi 3 , a picam and a screen ), but I need the software.

I know many programs already exist, but I would like to create my own recognition algorithm. For that purpose, I've seen there are many facial detection and annotation algorithms, available in openCV and Dlib, some that can extract each human face from a picture ( https://github.com/ageitgey/face_recognition ), and others that can create a series of landmarks to mark out the different facial parts on a picture ( https://ibug.doc.ic.ac.uk/resources/fac ... notations/ ). The goal would be to extract each student's face from the picture taken by the teacher, and then apply the annotation algorithm on each. My job would then be to recognize people by comparing relations between the point's coords to those previously registered.

Image Image

What I would need help with, in the first place, is installing all the dependencies and these two algorithms, to be able to use them. If I got it right, I must install OpenCv and Dlib, but I guess there are compatibility issues. Knowing that I am using python 3.6 and a RaspberryPi 3 running on Raspbian stretch, which version of OpenCv and Dlib should I get?


Thank you !

YCN-
Posts: 246
Joined: Fri Jun 10, 2016 3:18 pm

Re: Facial Detection and recognition

Thu Mar 08, 2018 8:53 am

Hi,

I believe that you made a miss conception, you're not going to implement your own algorithm, you're going to use those of openCV, it's very different. You're going to ask openCV to do the recognition.

Well firstly I think that your conception of the program is wrong, the way you want to do this is not very efficient. What you should do instead of looking for every faces and then trying to find who they are, is to directly look for the face of the person into the image. OpenCV is very optimised library (eventhough it's not perfectly efficient) but you shouldn't try to overcome it's capabilities, most of time you will loose. Just try to find Ben and Jerry face directly on the image. Afterward just do that on a loop with Bob and Barack and all the other one.

This will be easy once you'll have the first brick of the program : how to find a person in an image with openCV.

Once you'll have that just do :

Code: Select all

for(i=0;i<N_STUDENT_CLASS;i++){
	if ( find_with_open_CV(student[i] , picture_of_this_mornig_class ) != 1){
		missing_person[i] = 1;
		printf(" %s is missing \n" , list_classmate [i]);
	}
}
In order to set up OpenCV with RPI, just google it I know you'll find plenty of guides.

What I wrote upward is no real code just to help you with the conception of your program

Regards ,

YCN-

drgeoff
Posts: 8442
Joined: Wed Jan 25, 2012 6:39 pm

Re: Facial Detection and recognition

Thu Mar 08, 2018 9:44 pm

No image recognition system gives 100% accurate results. What are the consequences of that for you?

Melvin Cerba
Posts: 3
Joined: Wed Mar 07, 2018 6:21 pm

Re: Facial Detection and recognition

Thu Mar 08, 2018 10:01 pm

Hi, thank you for your responses !
I apologize, I have not been very clear. I know there are much easier and efficient ways to do it, but this is a project I must present at the end of the year, and I don't think just using openCV will do, in the eyes of the teachers. The whole acquaintance thing is really just a pretext to try making our own recognition algorithm. I'll use openCV to recognize faces and their parts, because it indeed overcomes my capacities, but, from that, I believe I can make the algorithm that distinguishes a face from another.
I understand that I'll be far from the 100% accurate results, and I know it won't be nearly as reliable as what openCV could do, or that it may not even work. The point of the project is to see how far we can go. I've been assured that even a prototype that could just recognize two different faces would be appreciated. The core of the project will be to find the must efficient criterion to tell a face from another... Well right now the core of the project is to successfully install OpenCV .

Thank you, I indeed found a guide on google, I feel a bit stupid for asking in the first place. It was'nt the only purpose of this topic though. As a python beginner and someone who uses a raspberry for the first time, I am sure to encounter many difficulties. I'll update this topic as the project progresses, hoping that you will help me overcome those many difficulties when I meet them.

YCN-
Posts: 246
Joined: Fri Jun 10, 2016 3:18 pm

Re: Facial Detection and recognition

Mon Mar 12, 2018 4:05 pm

Hi,

understood !

Since you want to do this for a school project it's always better to have a Proof Of Concept and then to see were you can go by yourself using your own solution.

Please take a look at a project few friend of mine did :
http://www.instructables.com/id/Prosopagnosia/

It actually allow the user to recognise a face when pressing a button, and then reading a data base to tell who the guy is. This would be a good base for you to start.

But I really believe that having a first working base, even for your comprehension of openCV could be a good step into your project.

If you want to know more about face recognition you should then go ahead and read some PhD thesis, and find out how this stuff is proceed. Then you can use MatLab with your PC (I hope it's a good one) and implement those algorithm.
But believe me when I'm telling you that this is very complicated, and that once you'll have one feet into the actual algorithmic of facial recognition or of image recognition, you will be far away from embedding it into a RPI and using it in real time to know who's absent. Even more if you don't know much about programming.

Regards,

YCN-

Melvin Cerba
Posts: 3
Joined: Wed Mar 07, 2018 6:21 pm

Re: Facial Detection and recognition

Mon Mar 19, 2018 2:37 pm

Hey !

Sorry for not responding sooner, I had not seen your message. I fully agree that making a working device with open cv would be a good start, and would enhance our comprehension of the whole project, which is very basic. I've had a quick look at your friend's project, and it is indeed very close to what we're trying to achieve. We'll try to install it on our raspberry, and see how it works. There is no doubt it will help us, thank you, and thank them !

Otherwise, we have installed OpenCV and Dlib, and we had the facial landmark annotation algorithm working on few pictures ( thanks to this guy: https://www.pyimagesearch.com/2017/04/0 ... cv-python/ ). Next step for the actual project should be accessing the landmark's coords, and then start experimenting different recognition algorithms.

Thanks again for your help !

Image

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 7 guests