Vehicle counting based on classification (cars,buses,trucks)
I have worked on almost similar problem.
Easiest way is to train a Haar-cascade on the vehicles of similar size. 
You will have to train multiple cascades based on the number of categories.
Data for the cascade can be downloaded from any used car selling site using some browser plugin.
The negative sets pretty much depend on the context in which this solution will be used. 
This also brings the issue that, if you plan to do this on a busy street, there are going to be many unforeseen scenarios. For example, pedestrian walking in the FoV. Also, FoV needs to be fixed, especially the distance from which objects are observed. Trail and error is the only way to achieve sweet-spot for the thresholds, if any. 
Now I am going to suggest something outside the scope of the question you asked.
Though this is purely image processing based approach, you can turn the problem on its face, and ask a question  'Why' classification is needed? Depending on the use-case, more often than not, it will be possible to train a deep reinforcement learning agent. It will solve the problem without getting into lot of manual work.
Let me know in case of a specific issues.
I am currently working on vehicle platooning for which I need to design a code in python opencv for counting the number of vehicles based on the classification.The input is a real time traffic video.
The aim is finding an average size "x" for the bounding box and say that for cars its "x", for buses its "3x" and so on.Based on size of "x" or multiples of "x", determine the classification.Is there any possible way I can approach this problem statement?