The present disclosure relates to an
endoscope calibration method, apparatus, electronic device, and storage medium. A
sample image set including a plurality of all-black sample images collected in a lightless environment and a white level image collected by the
endoscope under the conditions of maximum brightness,
gain, and temperature are obtained. Each
sample image has a corresponding
gain and temperature. The corresponding
black level value is determined according to the pixel value of each
sample image, and the white level value is determined according to the pixel value of the white level image. A
calibration function is determined according to the
gain, temperature, and corresponding
black level value of each sample image. When the
endoscope obtains an image to be calibrated, the image to be calibrated is calibrated according to the white level value and the
calibration function. The present disclosure accurately determines a
calibration function representing the corresponding relationship between the
black level value and the gain and temperature through a plurality of samples, and calibrates the images collected by the endoscope in real time through the calibration function and the white level value, removing the
noise brought by the black level in the images and improving the
image quality.