Every single door key is cut using a special code (4-5 digits) that defines the depth of each cut/groove on the key. Keysmiths can usually decipher the code for a key simply by looking at it. I’m working on a project on decoding the keys using a clear, well-lit, flat image of the key.
I have already preprocessed the raw image to get a segmented image of the shoulder of the key that needs to be decoded.
The part I’m having trouble figuring out is:
- How to detect where the cuts/grooves are along the shoulder
- How to get the depth of the cut by measuring the distance to the other side of the shoulder
I’d love to get some ideas for how to approach this. My idea was maybe to plot the distance between the straight part and the cuts, and look for minimas in the graph, but I’d really like a second or third opinion on ideas. TIA!
What I’ve done so far:
- Applied image segmentation to the key to make it pop from the background
- Automatically cropped out the head of the key (the round part at the top), and the tip of the key at the bottom to get only the part of the shoulder where the grooves exist
I now have a segmented image of the shoulder of the key that needs to be decoded.
(image attached)