1. A method comprising: capturing an image of a scene by an image capturing unit of a device that includes an accelerometer; deriving a gravity vector from at least one measurement obtained from the accelerometer; determining a location of a vanishing point in the captured image of the scene; computing a directional vector based on the determined location of the vanishing point in the captured image of the scene; in response to a determination that the computed directional vector is substantially parallel to the gravity vector, re-computing the directional vector based on another location of another vanishing point determined to be present in the captured image of the scene; and determining an orientation of the device based, at least in part, on the computed directional vector and the gravity vector derived from the at least one measurement obtained from the accelerometer.