Similarity between two geometric shapes

I have two shapes in a 2D space, not necessarily convex, and I'd like to compare how similar they are. How can I define a robust distance metric to measure their similarity, and how can I compute it?

I am looking for a method which provides a short distance in case of:

1. scaling;
2. rotation;
3. perhaps local scaling or rotation.

I see two possible solutions:

1. transform the shapes into pixel-based matrices (bitmap) and compute a Levenshtein distance (but without enough robustness in the distance, in case of rotation for instance);
2. transform the shapes into graphs and try to define a distance between them.
• Computing the distance is probably not the issue here; you need to define what the distance is first! Is that your question, or do you have some idea (but not included it in the question)? Note that there are many, many possible distances between curves/shapes (min, max, avg, median, min max, max min, ...)
– Raphael
Mar 19, 2014 at 0:07
• My question was about defining a metric more than computing it, sorry for the misunderstanding. Thanks @D.W. for your clarification. Mar 19, 2014 at 3:29