The invention relates to the technical field of defect detection, and discloses an automatic
exposure method and
system for an X-
ray flaw
detector, and the method comprises the steps: firstly obtaining a three-dimensional model of a workpiece, and calculating the equivalent thickness of the workpiece, the
source image distance, the normal included angle of the inner wall, the directional attenuation of an X-
ray source and other characteristic functions along with the change of a circumferential angle in combination with preset X-
ray projection geometry; then obtaining a linear
attenuation coefficient of the material under
effective energy through energy calibration, and setting a target comparison
noise ratio and a defect equivalent thickness at a reference angle to obtain a reference
exposure; generating full circumferential target
exposure distribution according to the
physical function and the material parameters; finally, dispersing exposure distribution into a sector sequence, carrying out
exposure measurement under the constraint of equipment and total exposure, calculating an actual contrast
noise ratio of each sector, and comparing the actual contrast
noise ratio with a threshold value, thereby quantitatively judging whether the workpiece has defects or not, and realizing high-precision and uniform-sensitivity X-ray defect detection on the circumferential weld.