4

I am looking for the Gradle dependency for OpenCV so I can use its API with some Kotlin code. In my search I have come across the following makeshift solutions

  • Download the jar and use that (I want a mavenLike dependency - the one that goes like implementation("opencv:opencv:4.0.0-0") in build.gradle instead of an explicit jar addition task - it's more elegant and easier to maintain and configure)

  • Use the dependencies published in third party softwares (e.g. OpenPnp,QuickBirdStudios etc.) (I am looking for a publication from (or sourced from) the original organisation, especially when my code has little to do with the main purpose of these other projects.)

  • Switch to using Android Studio and use their dependency management to import OpenCV (My Kotlin code has nothing to do with an Android App and I like working in my current IDE, IntelliJ)

I came up with the above classification after browsing several related SO posts and the tree of references therein. A Maven central search didn't bubble up any original publications. The releases page doesn't show a Kotlin build either. There seems to be no general answer, that I could find or one that is popular enough to be found, regarding this issue. Given how wide spread the use of OpenCV is in the field of image processing, and how Kotlin is a language being increasingly used by more and more developers, I would like this to be a solid referenceable answer, a sort of goto, for the following question:

How to add the OpenCV Gradle dependency to my pure Kotlin code, without migrating to Android Studio or using a third-party publication?

lineage
  • 792
  • 1
  • 8
  • 20

0 Answers0