fixed log at test_kmeans program and added OpenCV's version checking
implemented Greg's method for linear assignment