The aim of this lab is to:
- Detect faces in images
- Extract simple color features from faces
- Group faces using KMeans clustering
- Classify a new face using a template image
- Visualize the clustering results
- Haar Cascade classifier was used.
- Faces were detected in:
- A group faculty image
- A template image
- Rectangles were drawn around detected faces.
For each detected face:
- The face region was cropped.
- The image was converted from BGR to HSV format.
- Mean Hue and Saturation values were calculated.
- Each face was represented as a 2D point
- KMeans algorithm was applied with k = 2.
- Faces were divided into two clusters.
- Cluster centers (centroids) were calculated.
- Results were plotted in 2D space.
- A template face image was processed the same way.
- Hue and Saturation values were calculated.
- The template was assigned to the nearest cluster.
- The result was shown in the feature plot.
30 faces were detected successfully.
Each face was plotted as a point in 2D space.

Faces were grouped into two clusters and centroids were shown.

Template face was plotted with other faces.
Template face was assigned to the nearest cluster.
- Haar Cascade detected faces correctly.
- Hue and Saturation gave a simple 2D representation of faces.
- KMeans successfully grouped faces into two color-based clusters.
- The template face was classified based on similarity to cluster centers.
- 2D plots clearly showed cluster separation.
In this lab:
- Face detection was done using classical computer vision.
- Simple color features (Hue and Saturation) were used.
- KMeans grouped faces based on color similarity.
- A new face was classified using cluster distance.
This experiment shows how basic computer vision and machine learning techniques can be combined for simple face grouping and classification.
