Comparing variable image to static image What are Levenshtein distance algorithms, but for images?

I will have one static image (the target: what it should look like) and one variable image (actual: what the user has created)

For example,

Target:



The following should be classified as "close enough"

Actual:



But the following should be classified as "incorrect" (even though it has 2 strokes and fills the '|' part)



I will be using this as a guide for users new to the English alphabet to practice on writing.

I will, of course, have other checks in place such as counting the number of strokes made (2 for 'K', 1 for '|', 1 for '&lt;') and also checking to see if the area covered is reasonable (filling whole area should not be identified as "correct").

The user "drawing" will only be in black and white (not greyscale).

I suppose I could train a neural network (like handwriting recognition) but only to identify if it is "close enough". I think this is overkill as this only requires checking to see if it matches a single image and not selecting the best-matching image from a set.
I think you're really asking for a distance metric on images.  Based on  your examples, I would suggest the L2 distance (sum of squares of differences in pixel intensities) or L1 distance; possibly after aligning the images.  This looks like it should b effective for the examples you list.