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
Recognize drawing made by user
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!
- 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
might be of use to you
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement