Is there an open source implementation for bag-of-visual words?
There is one implementation of BoVW in openCV. You can find the documentation here :

http://docs.opencv.org/2.4/modules/features2d/doc/object_categorization.html