Counting vechicles in an image
As mentioned the object counting problem is very challenging. A good account of some common approaches is given in http://www.robots.ox.ac.uk/~vilem/NIPS2010.pdf. 

Creating a SIFT feature database on training images would appear to be the natural path to go down. That in combination with some image segmentation may be the way to go.

Another path might be to look at HOG http://chrisjmccormick.wordpress.com/2013/05/09/hog-person-detector-tutorial/, which is similarly a feature detection algorithm, could be adapted for cars.