An accurate optical method for measuring the azimuthal anchoring energy of nematic liquid crystals