Image comparison algorithm, trying to figure out how similar two "binary" forms are

3

1

I'm a student I'm completely new to this technology maybe my approach could be completely wrong, I want to create an algorithm that compares the similarity between two binarized images.

I'll explain: I have 2 pictures as input. The RGB colors of these images can only be 0 or 255

(R = G = B = 255) or (R = G = B = 0). I take these two letters as an example.

1. 2.

I thought so: the 255 value is the background of the image which is white. The 0 value is the shape (letter) formed in the image. So I thought of creating a matrix with 0 and 1 values where value 0 represents the background and value 1 represents the shape.

So now i would like to create an algorithm that understands the shape created in the two matrices and that returns a similarity percentage.

Update: I'm creating this app that tries to recognize the font of a text in a image (https://github.com/Sirvasile/Typefont), I want to create this algorithm to improve the comparison between the input letters and the alphabet of my fonts in the database.

1I think you need to define what you mean by shape. One could compute the hamming distance between the images and get an answer but I don't think that is what you want. Try looking up convolutional NNs and MNIST. It should help. – Jaden Travnik – 2017-04-30T21:40:31.683