On the measurement of the generalized degree of polarization