Recognize drawing made by user

Started by
2 comments, last by reverso13 11 years, 8 months ago
Hi everyone,
I'm working on a personal project for android. I'm programming with actionscript 3 using adobe air.
I'm trying to make a game in which I show an image to the user, for example a triangle, and the user has to paint with his fingers on top of that image and trying not to leave the path. After he finishes drawing I want to check how good the drawing was compared to the original.
As a begginer I don't know where to start or how to implement such a thing.
What would you guys do??

Thanks
Advertisement
As a beginner I'd suggest start with a simple approach, for example:
- For each drawing also store a version where each line has been expanded x pixels in every direction, so effectively a thick line
- Add points for the percentage of the thick line which is filled
- Subtract points for the percentage of what they drew which is outside the thick line

The beauty of the approach is that for scoring all you need to do is ask for each pixel "is it in or out of my ideal answer picture". If you don't care about the thickness of the line you would need to only take the length into account, e.g. if there is a filled pixel anywhere within the width of a segment, consider the segment filled.

It's so hard without diagrams!
http://www.lextalkington.com/blog/2011/01/dynamic-mask-and-image-comparison-part-2/

might be of use to you

:)
Thanks a lot for the help guys! I'll try to implement it and I'll tell you if it works biggrin.png

This topic is closed to new replies.

Advertisement