hi,
First of all, it would have been more helpful if you mentioned which method you are using as of now and what problems you are facing.
You will have to study the necessary prerequisites like Haar cascades, background subtraction etc.
you already know the library name - OpenCV. You need to dig into their website (although there is a very slim chance that you will get the whole code but) you will get the topics you need to know for this project and a suitable starting point to go ahead.
Look at these
link 1[
^] and
link 2[
^].
2 more useful links
link 3[
^] and
link 4[
^]
You can find plenty more stuff on internet .Google is your friend.
hope this helps !