Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I ended up coming up with a bit of a convoluted way of doing this that seems to work OK.

  • Use opencv's fast line detector with a minimum line length condition to extract the pitch markings.
  • Cluster lines (DBSCAN) based on their slope and intercept to merge detected lines that correspond to the same pitch marking.
  • Cluster lines into 'vertical' and 'horizontal' groups (k-means with k = 2 on the slopes)
  • Find the points of intersection of each vertical line segment with each horizontal line segment -- these are my features for matching. I allow some user-defined tolerance that allows segments to be extended by some number of pixels at each end.
  • Use some heuristics to match features. Stuff like using the type of intersection (T- or L-shaped) and the fact that the ordering is preserved. It's a bit of a hassle but I guess sometimes (annoyingly) you have to actually think about the problem.
  • Once the features are matched I can just use findHomography and voila.