Text this: Segmented algorithm for three-dimensional reconstruction in linear scan geometry