Sign in to follow this  
reverso13

Recognize drawing made by user

Recommended Posts

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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
[url="http://www.lextalkington.com/blog/2011/01/dynamic-mask-and-image-comparison-part-2/"]http://www.lextalkington.com/blog/2011/01/dynamic-mask-and-image-comparison-part-2/[/url]

might be of use to you

:)

Share this post


Link to post
Share on other sites
Thanks a lot for the help guys! I'll try to implement it and I'll tell you if it works [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this