The invention relates to the field of medical
image processing and
computer vision, in particular to a
pupil positioning method for lightweight U-Net and unidirectional connected domain extraction, which comprises the following steps: S1, preprocessing an input
ocular surface image, including
Gamma correction and
histogram equalization; s2, inputting the preprocessed image into a lightweight U-Net segmentation network, recovering a final feature map to an original size, inputting into a segmentation layer, and outputting four types of segmentation regions including a background, an iris, a
sclera and a
pupil; s3, Canny
edge detection is applied to the
pupil segmentation area, and an
ocular surface area boundary is extracted; s4, screening pupil boundaries based on a one-way connected domain extraction strategy, traversing the edge
point set, and extracting connected domains of which the lengths are greater than a preset threshold value through a one-way
closed path search algorithm; and S5, calculating the center-of-
mass coordinates of all pixels in the pupil connected domain, and taking the center-of-
mass coordinates as a pupil center positioning result. The
automation level and the imaging success rate of equipment are enhanced, the training requirements of operators of
ophthalmic examination related equipment are reduced, and the equipment cost and the popularization difficulty are reduced.