Polygon Shape Comparison

Comparing the similarity of two simple rasterized polygons

Metric 1: Jaccard index. Represent similarity through overlap of sets. Sets are represented by counting the pixels of two rasterized polygons onto an HTML canvas.$${Jaccard}(A,B) = \frac{A \cap B}{A \cup B} = \frac{A \cap B}{A + B - A \cap B} = \frac{intersection}{union}$$

Metric 2: Added weighting to the Jaccard index. Smaller dissimilarities are exaggerated, and union pixels not present in B count worse than pixels not present in A. $${Jaccard^{weighted}}(A, B) = \frac{(A \cap B)^{min(w)}}{A^{w_0} + B^{w_1} - (A \cap B)^{min(w)}}$$

where $$w_0, w_1 \in [0, 1]$$

In my use case polygons are hand drawn annotations, I'd rather accept a slightly too large annotation than too small. This non-uniform weighting encourages B to be smaller than A.