There is provided a visual localization method comprising: providing access to a database that is maintained by: electronically storing a plurality of images in a database, wherein each of the stored images is associated with a location, and wherein each of the stored images is represented by a reference vector indicative of the frequency of visual words in the respective image; determining descriptors corresponding to visual features in the plurality of stored images; generating a binary search tree by quantizing the descriptors to obtain a plurality of visual words corresponding to nodes of the binary search tree, comprising: determining a hyperplane for each node to separate the child nodes of the respective node; and storing descriptors that are within a distance from the hyperplane of a node in an overlapping buffer associated with that node; for a given node, terminating the quantization when reaching a predetermined quantization threshold; the visual location method further comprising: receiving one or more video frames representing a query image of the location to be recognised; determining descriptors corresponding to visual features in the query image; quantizing said descriptors to obtain a plurality of visual words; and using an inverted file index to determine an image in the database that contains said visual words and the location associated with that image.