How to match two images and find out mistakes
I have a template of a letter and many of it's variations (see below) which i acquire from a digital pen :
Template
Test 1
Test 2
These letters are always scaled to be in the same bounding box .
I want to detect the mistakes in the letter , like the mistake in Test 1 is that that there is a extra line , and mistake in Test 2 is that there is a missing segment . Similarly there can be a mistake in which there is a curve instead of a line segment . I want to find the parts which need to be corrected . How should i go about doing it ?
I would suggest you find a way to connect to the dots. Perhaps using a findContours or something to that effect then detecting lines and measuring them
Connect the dots, skeletonize the shape, use morphology hit-or-miss to find junctions and endpoints. A perfect A would have 3 junctions and 2 endpoints. If you get more or less of them, you will know where a mistake is located. That will work provided you know what character you are working with.
what's the best way to connect the dots?