High-precision phase compensation in deflectometry for discrete surfaces