http://stackoverflow.com/questions/22432673/how-to-measure-the-cosine-similarity-between-2-images

 

 

 

 

 

You could use the matlab's built in function to get the cosine distance:

pdist([u;v],'cosine')

which returns the "One minus the cosine of the included angle between points". You could then subtract the answer from one to get the 'cosine of the included angle' (similarity), like this:

1 - pdist([u;v],'cosine')

Source: Pairwise distance between pairs of objects.

Posted by uniqueone
,