I want to know that how face detection is achieved in opencv using haarcascade_frontalcatface.xml files. As viola-jones face detector is implemented in opencv for face detection and it needs to be trained before testing. So my question is it trained primarily and some model is stored in these xml files or it is trained just when function is invoked for testing. If it is trained primarily then how training results are stored in these xml files. Please help! Thanks in advance.