I am glad to share that this feature was (kinda) copied in 2023 by Google for their Pixel Phones. See https://blog.google/products/photos/google-photos-features-pixel-8-pro/
pip install opencv-python dlib imutils
-
Isn’t coordinating a perfect group photograph a difficult task in its own?
-
Isn’t there always someone who blinks and ruins the group photo?
-
And someone who smiles in one of the multiple shots of the squad, but not in the one where eyes of most of the people are open?
-
Take multiple photos of the group through the application
-
Upload to the server that detects the faces and facial features like their eyes (closed or open) and their mouth (smiling or frowning) using OpenCV
-
Blends best photos of all members of the squad into one beautiful photograph that is most likely to have all eyes open with everyone having their best smile
-
Detect faces using DNN (since it appears to work the best among other tried algos)
-
Iterate over the faces to detect eyes, ears and mouth and draw contours on eyes & mouth while determining the extent of the smile and the eyes being open
-
Determine which image to keep as base, and blend faces on that image with respective better faces from other images
-
Viola! We have our result image
-
Multiple photos are taken in succession such that people are in same sequence in the horizontal direction
-
Faces of same people are detected in all photographs
-
Subjects are facing towards the camera where it doesn’t matter the direction in which they are looking