Good question! With SURF key points (ObjectDetect or SaliencySurf), the problem will be that your shape is not very unique in the world, and hence you may get lots of false positives.
For ArUco, in part the algorithm is robust because of the more complex and carefully crafted shapes in the dictionary. So you may not get the same level of robustness with your shape. I don't think ArUco supports custom shapes, but I believe ARtoolkit (which we also support) does. However, you may still have issues with false alarms with that simple shape.
I wonder whether this one would be a good starting point: http://jevois.org/moddoc/FirstPython/modinfo.html
also see https://www.youtube.com/watch?v=BaWostkMClA
In there, we try to detect a U shape. If you edit the code in JeVois Inventor, have a look at lines 160 and later. This is where we enforce that the shape should look like a U:
- first, its convex hull should be quadrilateral
- then its area should be within some range (you can remove that test if you want)
- then (lines 179-180), the shape contour approximated as a polygon should have 8 vertices (replace that by 4)
- finally (lines 183-186), we check that the approximate polygon matches the fully detailed shape quite well. You could remove that first, then play with it later.
To understand this code, you need to look at the OpenCV docs:
Also you may want to look online for "OpenCV shape detection python", and see, eg,