Patch distance calculation using geodesic weights