To make it more obvious to the user that we have added their current face to the collection, you could provide a visual notification by either displaying a large white rectangle over the whole image or just displaying their face for just a fraction of a second so they realize a photo was taken. With OpenCV's C++ interface, you can use the + overloaded cv::Mat operator to add a value to every pixel in the image and have it clipped to 255 (using saturate_cast, so it doesn't overflow from white back to black!) Assuming displayedFrame will be a copy of the color camera frame that
should be shown, insert this after the preceding code for face collection: