Just speculating...
Cataracts are opaque or semi-opaque masses within the eye. Suppose you shine a pinpoint light into the eye, and then photograph the retina.
In a normal clear eye, the image will be sharp. Details of the retina (blood vessels, etc.) will show up sharp. However if there is a cataract, then detail will be blurred, or obscured, etc.
An algorithm will look for detail with sharp borders between light and dark pixels. Where it does not find sharp detail, that could be a possible cataract.