Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate the similarity of two line drawing images in swift

We need to compare two hand drawn images..these images are drawn on the sprite kit.we need to see whether these pictures are roughly match or not. For Example, if someone draws a smile pic, we need to check whether the redrawing smile pic is looks like the first drawn smile pic or not.we need to know whether the two images look alike or not...and to calculate the accuracy percentage of how similar they are..Please suggest some solutions.Thanks in advance.

like image 867
Nandhini Nadesan Avatar asked Aug 19 '15 11:08

Nandhini Nadesan


1 Answers

You could try draw each of the paths into bitmaps and comparing them. Here are a few suggestions for doing the comparison. If nothing else this will put you onto the correct track for resolution. The following project can give you a head start but needs to be translated to objc or Swift. This answer on code review may also prove useful.

One suggestion that seems intriguing is trying to use kCGBlendModeDestinationOver to draw the bitmaps as a trace over each other and comparing the results.

like image 51
Tommie C. Avatar answered Oct 13 '22 04:10

Tommie C.