The laws of gray distortion of machine vision system were discussed, and a method for gray calibration was presented. Five standard templates with unanimous gray value were used as the research objects. The average gray values of X direction and Y direction of the standard template images were obtained according to row and column. The gray distortion models were developed with moving average model of two image pixels. The models of five standard templates were developed separately, and the correlation coefficients of each model were above 0.96. The parameters of the gray distortion model were independent to the templates themselves. The gray calibration models of row and column were developed based on the gray distortion models separately, and the image gray values of other templates were proportion to the true value after gray calibration with the gray calibration models. The test verified the method.