I've tried to use affine transformation to match shapes and used, area of symmetric difference between target and match shapes (D) to calculate P = 1 - D/AreaOfShapeToMatch: [![enter image description here][1]][1] Result looks like this: [![enter image description here][2]][2] To find transformation coefficients using least squares technique shouldn't be a challenge if you know how to match points. You cannot use this technique to compare triangles, because any 2 will match. The same with rectangular shapes. Rectangle will match square. [1]: https://i.sstatic.net/MST1r.png [2]: https://i.sstatic.net/Jrzna.png