8

I am looking for fast procedures for polygon matching, i.e. checking polygon similarity under different transforms

  • translation only,
  • translation + rotation,
  • translation + scaling,
  • translation + rotation + scaling (= similarity).

The matching can be partial, meaning that there can be a good match on a significant fraction of the outline (say > 70%), and complete mismatch elsewhere.

The number of vertices is reasonable (say N<50).

In a variant of the problem, you need to compare two polygons. In another variant, you compare one polygon to a series of polygons, with preprocessing of the single polygon allowed. In a third variant, preprocessing is allowed on all polygons.

Are you aware of solutions to this problem ?

enter image description here

3 Answers3

7

There is quite a bit of work on this important problem. Some of the most insightful work is by Helmut Alt and collaborators. He wrote a survey in 2009:

Helmut Alt. "The computational geometry of comparing shapes." Efficient Algorithms. Springer Berlin Heidelberg, 2009. 235-248. (Springer link.)


         
Image from Helmut Alt & Leonidas J. Guibas. "Discrete geometric shapes: Matching, interpolation, and approximation." Handbook of computational geometry 1 (1999): 121-153.).
Joseph O'Rourke
  • 934
  • 6
  • 9
3

One reasonable approach is to use RANSAC to find a homography that causes many points to be aligned (or approximately aligned). You'd apply this procedure to align the set of vertices of the first polygon with the set of vertices of the second polygon.

The homography captures translation, rotation, and scaling, so it allows correcting for all of them. RANSAC allows for a subset of the points to match (the points that are approximately aligned are called inliers; the others are outliers), and tries to find a homography that (firstly) maximizes the number of points that are approximately aligned and (secondly) among all such homographies, causes the aligned points to be as closely aligned as possible.

D.W.
  • 167,959
  • 22
  • 232
  • 500
0

An interesting application of partial polygon matching is symmetry detection in building footprints. The polygon in the middle of the image was (partially) matched with the polygon obtained from itself in the other direction. There was also an adjustment applied to the match.

The matching algorithm uses dynamic programming on triangles. The adjustment is computing middle points iteratively until no improvement is possible.

Both algorithms are developed by me and not public. The image was taken from an implementation in a QGIS C++ plugin.

enter image description here