Introduction - If you have any usage issues, please Google them yourself
Detected with opencv face, eyes, mouth, etc. are used CascadeClassifier classification, you can use C functions specific use, you can use opencv use C++ classes packaged. Here is the form of the function when they detect target (copied the opencv official website)