2

I was wonder if there is any way to check in Android if I could check if two draws are alike, not specially the same. I want to make a test for little kids . Let's say they draw 'A' letter and I want to check if there is correct. So I think I could check if child's draw is alike as a model. A correct draw for letter 'A'.

So, is there any way for me to implement it?

Undo
  • 25,519
  • 37
  • 106
  • 129
stanga bogdan
  • 724
  • 2
  • 8
  • 26
  • Take a look into this thread maybe that will help? http://www.anddev.org/gesture_recognizer_and_character_recognition-t2998.html and http://www.krvarma.com/2010/10/gesture-detection-in-android-part-2-of-2/ – QVDev Jul 26 '12 at 11:56

3 Answers3

2

This is an interesting question. I have never done something like this but here's how I would begin.

Let's say the drawing is done on a Canvas. So, you save the Canvas to a Bitmap. Convert that bitmap to an array of bytes and generate a hash. Then you do the same for the second picture, and compare their hashes. If both hashes do not match, then this means one of the pictures is modified.

I didn't tried this my self, but I believe it's an idea worth investigation.

Andy Res
  • 15,963
  • 5
  • 60
  • 96
  • You answer is very helpful . I was wondering if you have any idea how could I check if the two photos are almost the same. I mean you can't draw two things exactly the same. And I want to check for example what letter the user did draw and I thought that I could use an example an compare the two of them. Do you have any idea how could I check if they are almost alike ? I hope you understand what I mean. – stanga bogdan Jul 26 '12 at 16:14
1

Interesting question, maybe this other SO question can help you ;)

By the way, i would say that Andy's answer consisting in converting drawing to bitmap and checking the similarities of resulting hashes hasn't much sense, because you would have to put some statistical variance margins to the comparation and allow some logic errors...

good luck!

Community
  • 1
  • 1
Hugo
  • 1,662
  • 18
  • 35
0

You can have look in to android gesture and gesture libraries. It helped me. Refer below link http://www.devlper.com/2010/10/gesture-detection-in-android-part-2-of-2/