code to perform approximate nearest neighbour search using FLANN