Hi Ron,
I've outlined a high-level approach below to assist with your project on face detection and recognition. Please consider this as a starting point, and feel free to adjust it according to your specific requirements.
- Face Detection:Consider using the Viola-Jones algorithm or HOG (Histogram of Oriented Gradients) features to detect faces within a live video stream. Initialize a list to store the coordinates of detected faces.For a practical example, you might find this real-time face recognition and detection system using PCA and the Viola-Jones algorithm helpful:https://www.mathworks.com/matlabcentral/fileexchange/46674-real-time-face-recognition-and-detection-system
- Face Recognition:Train a deep learning model, such as CNN (Convolutional Neural Network) or FaceNet, on a dataset of known faces. For each detected face, extract features and compare them with the dataset of known faces. If the similarity exceeds a certain threshold, label the face as recognized.Here's an example that demonstrates how to register and recognize a new face in real time:https://www.mathworks.com/matlabcentral/fileexchange/68985-real-time-facial-recognition-using-hog-features/
- Bounding Box and Accuracy Score:Utilize the coordinates of detected faces to draw bounding boxes around them. Calculate the accuracy of recognition by comparing detected features with those of known faces.
- Keep a total Head-Count:Maintain a count of detected faces. Increment the count for each new face.Following example shows the use of MATLAB to create a cloud based people counter:https://www.mathworks.com/matlabcentral/fileexchange/58435-creating-a-cloud-based-people-counter-using-matlab
- Use MATLAB Coder to generate C/C++ code.Optimize deep learning models for Jetson (e.g., TensorRT).
Please note that the suggestions provided are meant to serve as a general guide. I encourage you to explore the attached links and tailor the algorithm to better suit your project's needs.
Regards,
Ninad