According the features of on-machine measuring and compensation machining, a suitable data processing flow is designed using contact or non-contact sensor to collect measuring data, and the no-linear least square method to correct the inclination error of measuring system. The results of verification experiments for data processing presented well reflect error distribution of the actual surface with suitable measuring accuracy. It is also clarified that the on-machine measuring significantly affects the machining accuracy by the compensation machining experiments.