The invention relates to the technical field of image focus detection, in particular to a
fiber endoscope image focus detection method and
system, and the method comprises the following steps: providing a
data quality guide interface; capturing narrow-band light images of the
endoscope away from a first preset position and a second preset position of the intestinal wall in the axial movement process, calculating brightness
gain values of a
blue light channel and a
green light channel, calculating an asymmetric
scattering correction coefficient, and updating indication of color information calibration integrity; tracking the pixel
moving speed of the interferent in the view in the propulsion operation process, calculating the
relative depth of the interferent, and updating the indication of the validity of the depth data of the interference layer; identifying the
image area which is not shielded by the interferent, and updating the indication of the
information coverage degree of the background area; triggering an
image synthesis operation; performing
color compensation on the image information of the
image area which is stored in the background canvas and is not shielded by the interferent; reconstructing a clear image; and performing focus detection on the clear image. The method improves the accuracy of focus detection.