The invention discloses a
wafer six-surface detection automatic focusing method comprising the following steps: correcting the
crystal grain position through a feeding XYR platform, and obtaining a to-be-detected
crystal grain image; according to a to-be-detected
crystal grain image, edge points in the edge contour of the crystal grain are converted into geometric parameters by using a
Hough transform algorithm, and a position compensation value of the crystal grain is calculated; determining an optimal focus position of a front / back detection
station of the to-be-detected crystal grain according to the optical characteristics, the light
deflection angle and the incident
light intensity of the crystal grain, and adjusting the focus position of the focusing module; according to the position compensation value of the crystal grain, an electric sliding table is controlled to carry an optical camera to move in place and focus and image; and by comparing actual detection data with prediction results of the
refraction deviation correction model and the crystal grain front / back focus adjustment model, the accuracy of the model is evaluated and optimized. According to the invention, the problems of
position error, optical characteristic difference,
refraction deviation and the like in the prior art are effectively solved, and efficient and accurate crystal grain detection is realized.