ScratchData LogoScratchData
Back to panther__'s profile

Vertex - Facial Detection

PApanther__•Created June 6, 2020
Vertex - Facial Detection
122
100
1579 views
View on Scratch

Instructions

n to switch pictures to detect from Click 'Detect Face' to run the detection The camera isn't currently accurate enough to work for this program, so I removed this feature for the time being. If you want to test more images, go into the backdrop and place your image so that the face (or area to test) is inside the frame on the screen. The detection works best with grayscale images, so try to convert them to grayscale before using this Note: If you insert your own samples for it to detect, it may not detect the faces correctly. This is because I had to use a lower resolution grid for performance issues, which unfortunately can lose some features.

Description

Everything by me music Elucidate - @PaulRHJT Note: This program really works and stores no data about the test images beforehand How this facial detection works: The LBPH process: LBPH stands for Local Binary Pattern Histograms. Here's how it works: Each pixel is selected one at a time and all the neighboring pixels are tested against the central pixel. If the neighboring pixel has a greater intensity than the central pixel it is denoted with a 1, otherwise a 0. After all the neighbors are tested, the program forms a binary number from the 1's and 0's of the neighbors. This number is then converted into a decimal form which happens to be a number in the range of 0-255; the exact range of pixel intensity (how convenient!) This process goes through each pixel until all the pixels are tested. The next image generated will appear white, and will show mainly the contours(edges, flats, etc.). This process also helps eliminate poor lighting by normalizing all the pixels The HOG process: HOG stands for histograms of oriented gradients. It works with the LBPH process and determines the magnitude of the prominent gradient and also determines the angle of the feature in the 'neighborhood' around a pixel. Generalizing: The next process takes all the histograms (the data of each neighborhood) and picks out the common histogram from each square of a grid in which the picture is divided (8 x 8) Each square will hold a feature vector (magnitude and direction) Facial Detection: The last process is reading the features from the squares and finding if any of them form a face. This first looks for the left eye, and then checks two squares over for the right eye. If the right eye exist then it tests for the mouth which is two squares down between the eyes. If the test for the mouth returns true, then it classifies it as a face and puts a bounding box around the detected face. #facial detection #face #pictures #pen

Project Details

Project ID402545703
CreatedJune 6, 2020
Last ModifiedFebruary 8, 2025
SharedJuly 7, 2020
Visibilityvisible
CommentsAllowed