Yes, it is possible to find good analytics functions for Counting, with "some" classification (3 levels, motorcycles, cars, trucks; honestly very dangerous to expect more, and anyway not in heavy traffic or by night with optical cameras; beware definitely to whom is claiming "oh yes, 7-8 classes!.."....aha, ok show me!..), average speed estimation, alarms of stationary vehicle (some customer agrees to use it as possible accident detection), wrong way, smoke or fire detection, lost charge (but if well visible in the image), pedestrian within sensitive areas (SOS points, parkings, ..).
For counting and average speed estimation we always suggest to use differential thermal cameras (Axis Q1931, or Flir or DRS, or Samsung, ...), in order to filter the headlights of the vehicles. There are nevertheless good specific optical cameras (I remember for example to have worked with an impressive Basler) filtering them quite well.
For the other "alarm functions" the use of thermal camera could be anyway suggested (but not for smoke detection!..), but not that critical as for counting and average speed estimation. Thus, in general we suggest to put few more expensive thermal cameras for counting and average speed estimation (because you don't need of course to count each 100 meters.....), and good optical cameras for "sampling" all the street performing the other alarm functions each 100-120 metres (not more, not more, not more!! It's already even definitely too much for an optical camera if you want to see something also when it rains, in the dark night or with fog...).
In tunnels, forget to count or classify. Unless we are not in a tunnel 6 metres high...) Not enough space to see and track "consciously" trucks or big vehicles. But the funniest question is: for what to do it inside the tunnel?!? Maybe the vehicles are materializing or magically disappearing inside the tunnel?...;) Of course not, so let's count outside at the entrance, or by the exit, where we can maybe more easly put a higher camera to have a better timely panoramic view.. This I write because I go on reading lot of tenders everywhere where this function is required inside tunnels.... Sometimes I would really like to open a petition to disallow definitely "bakers" to write tenders with analytics involved (with all the respect to bakers...;))..)..