Help needed to build a Shape Classifier

Dear all,

I am trying to implement this paper (Skeleton-based shape classification using path similarity) in Processing but have difficulties understanding formulas 5 and 7 on page 7.

The goal is to find a shape (named “class”) whose topology is the closest to a query shape.

In this example, the probability that the query shape belongs to class C should be the highest

More specifically I am trying to calculate the “posterior probability” that a query shape belongs to a given class (formula 7)

What I understand: This “posterior probability” is based on “path similarity”, i.e how far/close the skeleton paths of the compared shapes (“query” and “class”) are.

  • a skeleton path (sp) is the route along the edges of the skeleton that starts at one vertex of the polygonal shape and ends at another one.

  • the distance is the difference between the respective radii of the m equidistant maximum disks along 2 different skeleton paths

What I DO NOT understand: Path comparison.

Do I need to compare each path of the query shape against each path of a class shape (nested for loop) ?
If not, what paths do I need to compare ?

Again, I believe understanding formula 7 is key to get this right

Here a snippet in Python mode showcasing the example displayed on the first picture (query shape vs A/B/C classes):

1 Like