Continuous limits of discrete perimeters