Preprint: Combinatorial homology and image analysis