Cosmological constraints from cosmic homogeneity