This will be a long question to make clear my point, I hope you can understand it :)
So I am making an app to write letters correctly, and to test if the letter is correctly drawn I use an algorithm that count the pixels and does the math.
The problem is that the algorithm doesn't work so well as I was wondering, so I will explain.
Here is the image before draw:
Then I ask the user to draw the letter as the image shows, and suppose he draws something like this:
The algorithm should say that the letter was successfully written.
This is how I am using the algorithm now:
int letterGreyPixels = 0;
int letterYellowPixels = 0;
// Then I count the letterGreyPixels before draw
// After the draw I count the letterYellowPixels
float percentage_yellow_on_grey = (float) letterYellowPixels/letterGreyPixels
//Then I count the percentage of yellow pixels on the grey pixels of the letter, and I test if its above 60%, and if it is, I say that the letter matches correctly
**//BUT there is a problem ! the user can easily do a drawn like this one:**
And the algorithm will say: "oh yes, the percentage of yellow pixels on the grey pixels are above the 60% ! But the letter is not well drawn"
Did you guys understood?
I can't make the algorithm like this, there must be a better way to calculate the matching of the letter.
Can someone advice me?
Thanks a lot in advance ;)