#Recognising drawn characters

1 messages · Page 1 of 1 (latest)

safe lynx
#

Hi! I'm trying to make a japanese drawing game where the player must draw characters and the computer will recognise them. For context, this is not OCR, that's already done.

I'm wondering how I'll do this. In this game, two things must be taken into consideration

  • The direction of the stroke
  • The order of the strokes (whether the horizontal line came first or the vertical line)
  • The shape itself

I've attached a photo of how my current system looks like for the character ち, at least in my head. In blue, I'll define Area 2Ds which will serve as the "acceptable drawing area" for the stroke. If a stroke is mostly within the blue, it'll be marked as correct. A player must take the first stroke, which is the horizontal line, from left to right (that's how it's taught), and the second curvy stroke from top to bottom. Here's where I'm stuck.

  • Detecting the drawing itself (whether it comes into the blue area)
  • Finding the order of the strokes (Could do this by storing them in an array)
  • Making sure that each Area2D aligns with the strokes (E.g. the player decides to draw in one corner instead)
  • Finding the direction of the strokes
#

reference of the strokes, just in case

wet marsh
#

for positioning the area2D you could try to position it using the start of the first stroke and the end of the last

#

direction could be the start of the stroke and some point after that and making sure the vector between the points is in the general direction you require

safe lynx
safe lynx
#

i'd have to define a new "center"

prisma dust
safe lynx
#

but thank you for the suggestion!

wet marsh
#

Have you solved how to draw and how to save the strokes? I think the rest of your implementation will depend on that.

safe lynx
#

the stroke_drawn signal unfortunately isn't useful in this case