'compare user draw to a bitmap defined

I'm trying to build an app like StrokePlus using bitmap to be able to check between two images if they're the same visually. The user can draw on the whole screen.

For now when the user draw a tiny L (12x56) or a big L (177x177) it gets transformed in a bitmap by the size. But now i've to compare with a 25x25 bitmap with a L shape draw on it.

I've tried to resize the user draw to 25x25 and compare them but i'm loosing too much pixel when resizing to get good results.

I also tried to resize it multiple time (ex : 50x50 to 40x40 to 30x30) I'm more precise but still not enough

How can i compare my Userdraw and bitmapdefined to be sure they're very similar ?

Example of user draw : UserDraw

Example of L shape 25x25 : BitmapDefined

Edit : Changed image color

Edit2 : Added new try



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source