Name: opencv-installer
Owner: WPIRoboticsProjects
Description: Simple application to install OpenCV
Created: 2016-09-10 20:42:29.0
Updated: 2018-02-18 16:26:20.0
Pushed: 2018-02-24 19:06:35.0
Homepage: null
Size: 88
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Simple application to install OpenCV.
This assumes that the OpenCV artifacts are located in the FRC maven repository at http://first.wpi.edu/FRC/roborio/maven/development
or in the local maven repository.
(Artifacts for this project are also available in the above repository)
For now, this is just a CLI app with no GUI.
This currently supports
Artifacts are installed by default in C:\Users\<user>\OpenCV\
. You will need to add the install locations to the PATH
environment variable.
JNI and native bindings will be installed in /usr/local/lib
and the headers will be installed in /usr/local/include
. If you don't have write access to these folders, you can run the installer with
sudo java -Duser.home=$HOME -jar ...
Make sure that /usr/local/lib
is on LD_LIBRARY_PATH
or the JNI bindings won't be loaded by the JVM.
Similar to Linux, but you probably won't need to use sudo
.
Short name | Long name | Description | Argument
—|—|—|—
| h
| help
| Prints the help text |
| v
| version
| Sets the OpenCV version | The version in the format x.x.x
e.g. 3.1.0
| j
| java
| Flags the Java API for install. This does not install JNI bindings | Install location (optional)
| i
| jni
| Flags the JNI bindings for install | Install location (optional)
| s
| headers
| Flags the C++ headers for install | Install location (optional)
| n
| natives
| Flags the C++ native libraries for install | Install location (optional)
| a
| all
| Installs all OpenCV artifacts
| o
| overwrite
| Overwrite already installed files
| p
| platform
| Download artifacts for a specific platform. They will be located in ./install
| The platform to download artifacts for
platform
ows-x86
ows-x86_64
x86_64
x-x86
x-x86_64
x-arm
x-armhf
-jar opencv-installer --version <version> --platform <platform> --java <location> --jni <location> --headers <location> --natives <location> --overwrite
dscript {
positories {
maven {
url 'https://github.com/WPIRoboticsProjects/opencv-maven/raw/mvn-repo'
}
pendencies {
classpath group: 'edu.wpi.first.wpilib.opencv', name: 'opencv-installer', version: '+'
rt edu.wpi.first.wpilib.opencv.installer.Installer
rt edu.wpi.first.wpilib.opencv.installer.PlatformDetector
openCvPlatform = PlatformDetector.getPlatform()
openCvVersion = '3.1.0'
ndencies {
mpile group: 'org.opencv', name: 'opencv-java', version: openCvVersion
.
installOpenCvJni(type: Copy) {
staller.setVersion(openCvVersion)
staller.installJni(openCvPlatform.defaultJniLocation())
Or manually set the install location
staller.installJni('/usr/local/lib')
First, add
sitories {
ven {
url 'https://github.com/WPIRoboticsProjects/opencv-maven/raw/mvn-repo'
ndencies {
mpile group: 'edu.wpi.first.wpilib.opencv', name: 'opencv-installer', version: '+'
to your build.gradle
file.
Then to make sure that OpenCV is installed prior to using any OpenCV code:
rt edu.wpi.first.wpilib.opencv.installer.Installer;
rt edu.wpi.first.wpilib.opencv.installer.PlatformDetector;
rt org.opencv.core.Core;
s Main {
atic {
Installer.setOpenCvVersion(Core.VERSION);
Installer.installJni(PlatformDetector.getPlatform().defaultJniLocation());
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
This will install OpenCV on the current system if the JNI bindings are available for it. If there aren't any JNI bindings, an IOException
will be thrown by the call to Installer.installJni()