Purpose: Fluorescence imaging is a valuable tool for studying tear film dynamics andcorneal staining. Automating the quantification of fluorescence images is a challenging necessary step for making connections to mathematical models. A significant partof the challenge is identifying the region of interest, specifically the cornea, for collected data with widely varying characteristics. Methods: The gradient of pixel intensity at the cornea– sclera limbus is used as the objective of standard optimization to find a circle that best represents the cornea. Results of the optimization in one image are used as initial conditions in the next imageof a sequence. Additional initial conditions are chosen heuristically. The algorithm iscoded in open-source software. Results: The algorithm was first applied to 514 videos of 26 normal subjects, for a total of over 87,000 images. Only in 12 of the videos does the standard deviation in thedetected corneal radius exceed 1% of the image height, and only 3 exceeded 2%. The algorithm was applied to a sample of images from a second study with 142 dry-eye subjects. Significant staining was present in a substantial number of these images. Visual inspection and statistical analysis show good resuls for both normal and dry-eye images. Conclusion: The new algorithm is highly effective over a wide range of tear film andcorneal staining images collected at different times and locations.