1. A method, comprising: receiving a query image; processing the query image to obtain visual features; determining a feature from the visual features obtained by processing the query image; determining a viewing direction for the query image from a pre-determined set of viewing directions, wherein the viewing direction is predetermined viewing direction closest to an estimated viewing direction of the query image, and wherein the viewing direction of the query image is estimated based on sensor data; generating a direction-based hash based on the feature in the query image and the viewing direction; identifying sub-volumes of a point cloud database that match the direction-based hash; and matching the sub-volumes against the query image features to find a match.