I have a custom fiducial marker that is an X shape. It's all black and on a white background. I am able to use thresholding and contours to identify potential fiducial candidates, which I then perspective warp and downsize to 10x10 pixels and compare to a "fixed" or template fiducial. My current comparison algorithm is a simple Hamming Distance calculation between my fiducial candidates and the "fixed" or template fiducial.
This current setup works well but it could be better. Specifically, using Hamming Distance to compare the candidates with the "fixed" fiducial seems weak, and doesn't really take into account the "shape" of the fiducial candidate.
Below is an image that shows a candidate fiducial that I know to be correct with a Hamming Distance of 28. Then Fig C and Fig D are other images that also have a hamming distance of 28 from the fixed fiducial, but which are definitely not fiducials.
Visually it seems quite clear that Fig C and Fig D are not actually what I'm looking for and that the "Moving Image" is much more likely to be a fiducial, even though they all have a hamming dist of 28 with respect to the Fixed Image.
What is a more robust way to compare fiducial candidates than Hamming distance for this use case?