Scanning probe microscopy has emerged as a powerful and flexible tool for atomically resolved imaging of surface structures. However, due to the amount of information extracted, in many cases the interpretation of such data is limited to being qualitative and semi-quantitative in nature. At the same time, much can be learned from local atom parameters, such as distances and angles, that can be analyzed and interpreted as variations of local chemical bonding, or order parameter fields. Here, we demonstrate an iterative algorithm for indexing and determining atomic positions that allows the analysis of inhomogeneous surfaces. This approach is further illustrated by local crystallographic analysis of several real surfaces, including highly ordered pyrolytic graphite and an Fe-based superconductor FeTe0.55Se0.45. This study provides a new pathway to extract and quantify local properties for scanning probe microscopy images.