You can use other code or relax the discrimination criteria. The usual way is to
- detect everything that moves (that's what it sounds like you want), and then to
- examine each moving blob to determine which are cars and which are not, then
- just keep the cars and throw out everything else.
It sounds like your code does all three steps because you said "The code I have can only detect cars." You need to modify it so that it does not do steps 2 and 3.