Let me add a little bit to the discussion by the following collection of sprocket holes I encountered in my work with the Super-8 format:
The left-most sprocket shows something which you encounter very often with old Super-8 material: dust. In this case, if you look closely, the dust accumulated around a splice - Super-8 movies were often spliced together with adhesive pads. However, even if you clean film before scanning, you will encounter sprocket holes which have some sort of dust accumulated. Right to this is a damaged sprocket. The sprocket itself is still clearly defined, but already somewhat larger than the norm. Moving further to the right, the next sprocket (from the same stock) is even more damaged. Clearly, a registration using only the upper edge of the sprocket would work, but the lower edge is certainly torn out and not usable. Both examples feature also another challenge: the film material surrounding the sprockets is nearly as transparent as the sprockets themselves. That makes it harder for optical based methods to detect the sprockets. The next sprocket example shows also a challenge one encounters with Super-8 stock. Most material has some more or less transparent imprints between the sprockets - this also is able to fool certain sprocket detection mechanisms. The last sprocket example shows another challenge I encountered: the film gate of the camera used is extending into the sprocket area. In the example given, the edge of the sprocket is still clearly defined. But if this part of the film frame becomes very bright or even overexposed, the boundary of the sprocket might visually “disappear”.
Maybe it is possible to collect some further examples of sprockets, preferably also from other formats, in order to develop a general approach? From my experience, I think some suitably tuned image processing algorithm might outperform any other means.