Hi yall !
I want to do a system like letter tracing, so the user click and draw something
And So i don't really know how to do it... I'm able to draw the path of the user drawing but dunno how to compare to a specific pattern, like how can i know the user draw a O,
My idea i think is to create like a container that will be like a big outline of the letter and if the user go out this container it reset but i don't really know how to do the container (maybe just a hard container with like an array of vector3) and how to compare the position of the mouse and the container...
Someone to help please ?
#Letter tracing
1 messages · Page 1 of 1 (latest)
This is a pretty complicated problem if you do it properly
This is what it's called formally
oh thanks i didn't know how to explain it easily 😅
The simple solution would be to have preset shapes that you've drawn in advance and then simplify the lines drawn by the user so that a point is created every time they turn more than x degrees, then compare the points to your original letter's points. Another approach could be to reduce the letter to a grid, then detect based on which grid squares are covered
But neither of those will accurately detect letter if the person's handwriting is weird
The grid approach example:
err
fill in those middle squares
whatever, you know what I mean
I forget to precise it but i will not use the classic letter either it will be a unique alphabet... like for exemple an eclair will be a "a" for exemple
Another way would be to detect the sequence of turns made by the user's cursor. This would be more accurate and allow for irregular shaped letters but it's going to be pretty complicated to do
that's my thoughts
Yea but for exemple if i want to recognize an O and the user draw a oval i want to say oh ok that's a O even if it's really unclear
yeah
exactly
If you do a custom algorithm for each glyph you could handle those cases though
Like an O could be a shape where the total angles made by all the turns the user's cursor made = 360
or close to it
but if for exemple he does that
You can detect if the shape is convex or concave to prevent like a heart shape from detecting
just check if any turn is >180
If you're gonna do it properly it's gonna be a lot of fiddling by hand
Simplify the line
sry take a bit of time to upload ^^'
Combine segments that are sufficiently similar, etc
i start to see how big the problem is...
see why xD
But I'm sure if you google optical character recognition you'll find some stuff on it
surely this is a well explored problem
you have the advantage of knowing the order and direction the lines were drawn in
It should make it way easier than if you were just parsing a 2d image into a shape
and i don't think google can recognise a symbol that is not in his database
I didn't understand ^^'
I'm not telling you to use an existing solution, just saying, there are probably articles written on how OCR works that should be useful knowledge if you're making up your own system