Image localization and parsing using 3D structure