Defect detection on button surfaces with the weighted least-squares model