The reference hole is significant for pre-positioning in high-precision robot drilling. The visual and optical measurement of such holes is of great benefit in terms of improving location accuracy during robot drilling and subsequent rivet-in-hole assembly. However, the detection and location of the reference hole via visual sensors still presents signifcant challenges, owing to the occlusion of perforator clips prior to practical drilling. This study proposes a robust extraction algorithm, based on gray clustering and edge detection, for locating the occluded reference holes (ORH). Firstly, the boundary box of the ORH is segmented using a template matching and density clustering algorithm. Secondly, the discrete arcs of the ORH are extracted via a combination of K-means clustering, pixel-intensity, and concave points extraction based on edge concavity. Finally, the target arcs are filtered and obtained based on their ellipse geometric properties, followed by the center extraction of the ellipse fitting. The experimental results show that the location accuracy achieved in this way is within 0.03 mm, which is sufficiently accurate for robot drilling. Moreover, the ORH data can be extracted and located successfully even in challenging industrial environments, with varying levels of illumination.