-3

I am working on a game to compare a kid drawing (with mouse or gesture) to numbers from 1 to 9, is converting the drawing to bitmap and compare it with number converted to bitmap a good idea? and how to handle the difference in size (width-height) between the 2 images? Thanks

  • Really!? Sorry but no... – bcesars Mar 24 '15 at 12:12
  • what's wrong with my question? – Hamada Samir Mar 24 '15 at 12:15
  • 2
    Stackoverflow is not the place to ask people to write code for you. Try doing it yourself first, then ask about any problems you encountered. – EvergreenTree Mar 24 '15 at 12:24
  • i did not ask for code, i said help me with the idea like where to start – Hamada Samir Mar 24 '15 at 12:26
  • i got the question edited, maybe this looks better, and sorry if it was not in a proper shape first time – Hamada Samir Mar 24 '15 at 12:32
  • why everyone is so aggressive? i am asking if it is a good idea or not – Hamada Samir Mar 24 '15 at 12:34
  • this could help: [link](http://stackoverflow.com/questions/13401773/compare-two-images-and-check-equality) and concerning your second question, you'd scale one of the images to be the same size as the other image, then compare. –  Mar 24 '15 at 12:35
  • Thanks, sorry for the mistaken question , it is my first question here so i still have alot to learn here – Hamada Samir Mar 24 '15 at 12:40
  • And I apologize for my aggresive comments earlier. But you should look into the [FAQ](http://stackoverflow.com/help/how-to-ask) to see what type of questions get better responses. –  Mar 24 '15 at 12:49

2 Answers2

0

You can try Mouse Gesture Recognition

var gesture:MouseGesture  = new MouseGesture(stage);
gesture.addGesture('B','260123401234');
gesture.addEventListener(GestureEvent.MATCH,matchHandler);

function matchHandler(event:GestureEvent):void
{
     trace (event.datas + ' matched !')
}
gabriel
  • 2,351
  • 4
  • 20
  • 23
0

You can do it with image comparison, but it's pretty tricky to get it right.
What I would suggest is:

  • Pre-generate small (10x10 pixels or even smaller) grayscale images of the numbers and blur them a little
  • Convert drawing to grayscale
  • Blur drawing a bit
  • Crop borders from drawing
  • Resize drawing down to the size of your number images;
  • Compare the small drawing image with the generated number images, pixel by pixel and be lenient to what you accept as a match.
Richard
  • 527
  • 3
  • 9
  • this sounds a very good way to do it, i will give it a try, thanks alot – Hamada Samir Mar 25 '15 at 15:39
  • Hi @HamadaSamir if this or any answer has solved your question please consider [accepting it](http://meta.stackexchange.com/q/5234/179419) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – Richard Mar 25 '15 at 15:53
  • As I said, there is no obligation to do this. Computer vision problems are challenging, but satisfying when you get right. – Richard Mar 26 '15 at 17:28