Follow this tutorial to install OpenCV onto a Linux machine.
If you run into any problems, you can check out the Troubleshooting section which highlights some of the problems I've encountered while working on this project.
You can configure the frequency to save the trained weights in the detector.c
file.
Further project requirements can be found here.