0

I'm using opencv2 framework, you can find info at their website. The framework is installed and working, but a lot seems to be updated (mostly it seems to be more swifty, which is great!), for example:

cvMat has moved to Mat( as a swift struct initialized

However, I'm missing two global functions:

matchTemplate, and computeDistance

did these move to an object or get renamed somewhere?

ultimately, I'd like to reproduce this function: https://stackoverflow.com/a/20562811/2611971

Logan
  • 52,262
  • 20
  • 99
  • 128
  • 1
    Some shots in the dark, I don't know iOS anything: `matchTemplate` is a global function but included specifically in the `imgproc.hpp` header; maybe you need to include that? `computeDistance` is not a global function on any OpenCV version I can find, can you provide more context on what that function does? Is it supposed to be used on two different contours, i.e. https://docs.opencv.org/3.4/dc/dbf/classcv_1_1ShapeDistanceExtractor.html#aba29b7775eca6bd6c4b4f5e300094097 ? If so it's not a global function and looks to be namespaced within `cv::ShapeDistanceExtractor`. – alkasm Dec 29 '20 at 06:47
  • thanks @alkasm I'll see, these namespaces might help.. as far as `matchTemplate` I don't think it's an import issue as I see it used in old code references, but can't seem to locate any info about the new syntax changes, thank you for posting, this gives me some clues! – Logan Dec 30 '20 at 15:44
  • @alkasm you were close, they had made a special type called Imgproc`` – Logan Dec 31 '20 at 01:45
  • Awesome! Yeah sounds like they namespaced it. Unfortunate that there's not docs yet for the iOS interface. – alkasm Dec 31 '20 at 18:07

1 Answers1

1

I found the answer for those looking.. I was able to locate a hidden type called: Imgproc

So, for example matchTemplate is now: Imgproc.matchTemplate

Logan
  • 52,262
  • 20
  • 99
  • 128