The invention belongs to the field of
coherent diffraction imaging, and particularly discloses an automatic focusing method and
system for
coherent diffraction imaging. Multiple groups of to-be-detected samples at different positions are simulated through the near-field propagation model,
wavelet transformation is performed on the simulated to-be-detected samples to obtain the
wavelet coefficient, the definition is calculated according to the
wavelet coefficient, and the
axial distance is weighted and updated by using the definition of all the simulated to-be-detected samples so as to gradually approach the actual value of the
axial distance between the sample and the
detector. And automatic focusing of
coherent diffraction imaging is realized. According to the method, the definition of the reconstructed image is calculated by adopting an operator in a
frequency domain for the first time, so that the method has higher axial contrast and
noise robustness, and the convergence speed, precision and robustness are greatly improved; through
wavelet transform, detail components of the image in the horizontal direction, the vertical direction and the
diagonal direction are extracted in the
frequency domain so as to evaluate the definition of the reconstructed image, the weights in different directions can be flexibly adjusted, and the method has better generalization.