OpenCV SBT Plugin
OpenCV is arguably the defacto free, open-source computer vision library, but setting it up for usage in a JVM project can be hard because OpenCV itself is written in C++, so there are a bunch of system-dependent things that you need to download/compile/install before you can use it.
JavaCV, written by Bytedeco is a library that makes it more bearable to use OpenCV from JVM projects by providing a bunch of wrapper classes and logic around OpenCV (there’s a lot more to it, see their page for details).
Still, because JavaCV depends on JavaCPP for common and OpenCV C++ wrappers, and JavaCPP requires you to set your target platform (what platform you want to run on), I thought getting started could be easier still.
After taking a look at this Github project, I created an SBT plugin, SBT-OpenCV, that allows you to add just one line to your project/plugins.sbt
to begin playing around with OpenCV:
1
|
|
The following is a list of SBT setting keys that you can set in order to customise the behaviour of the plugin:
1 2 3 4 |
|
I think javaCVPlatform
is the one that will be most interesting, since you may want to compile JARs for different target platforms; for a list of supported strings, look at the classifiers supported by JavaCPP presets, or work out the different strings that can result from the JavaCPP Loader.
For example:
1
|
|
Feel free to try it out and submit issues, ideas, and PRs at the Github page :)