I expose films in a jig with pin pricks as reference markers. I use these references to register the scanned images of the film to other data.
I've been using mouse click coordinates to date, but I need to automate it and can't find a robust way to detect the pin pricks using binary image processing. I've tried various approaches using opencv with python (see below).
I don't use dust removal when scanning, that might be the issue, but it must be possible to distinguish the round pinpricks from dust no?
Does anyone have advice on suitable methods for detecting features like these pin pricks?
Thank you.
Here's an example image which I want to process. There are 10 pin pricks and 1 dark area of exposure. I just want the coordinates of the pinpricks.
An example attempt of binary thresholding followed by erosion and dilation. It doesn't robustly remove noise instead of the features regardless of parameters.
An attempt at finding contours which still misses pinpricks and picks up noise.
An attempt at using a Hough Transform with a similar result
**** EDIT ****
My attempts at template matching using an example pinprick
This picks out all the pins with a threshold of 0.5. This works well as the template pinprick was taken from this image.
This is run on a different image to the template and struggles. At the same threshold.
The above match when run with a lower threshold. It picks out dust instead of pins.