Direct measurement of the polynomial invariant of degree 2