Affinity-based Distributed Algorithm for 3D Reconstruction in Large Scale Visual Sensor Networks