Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need a program that uses face detection. The sample video provides the goals i

ID: 3822741 • Letter: I

Question

I need a program that uses face detection. The sample video provides the goals in the project. As illustrated in the following figure, three persons’ faces are automatically detected by intelligent program, and each face is grouped by a square box with different colors. Under each square box has a number which can indicate the number order of the person or serve as a tracking ID of the person appearing in the current frame. Your video is similar to the following frame from the video “sample_video.mp4. The final video will be built from frame images in the processed “P2E_S5_C1”.

sample video 23.200 00:23

Explanation / Answer

As ou have not mentioned any specific programming language, I will provide it in two different language known to me.

C++

#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/gui_widgets.h>
#include <dlib/image_io.h>
#include <iostream>
using namespace dlib;
int main()
{
auto detector = get_frontal_face_detector();
array2d<rgb_pixel> img;
load_image(img, "people.jpg");
pyramid_up(img);
auto dets = detector(img);

std::cout << "Number of faces detected: " << dets.size() << std::endl;
image_window win(img);
win.add_overlay(dets, rgb_pixel(255,0,0));
win.wait_until_closed();
}

Python:

import dlib
from skimage import io

img = io.imread('people.jpg')

detector = dlib.get_frontal_face_detector()
# Run the face detector, upsampling the image 1 time to find smaller faces.
dets = detector(img,1)

print "number of faces detected: ", len(dets)
win = dlib.image_window()
win.set_image(img)
win.add_overlay(dets)
raw_input("Hit enter to continue")

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote