How to install WPI OpenCV Installer?

Okay so I’ve downloaded the WPI’s OpenCV Installer from github. But I Don’t understand the install instructions.

Command line arguments for running java -jar … but there is no java opencvinstaller.jar in the download. I assume we must run something else first to generate it? Though that’s the first thing listed in the README. Also wouldn’t know what jni bindings are either.

Then there is a whole bunch of stuff under Gradle build scripts? Don’t understand them. Are they to include with a project to build opencv within a project we create?

Then there is a java library to add to your project? How does that install opencv? Project specific?

The last time I compiled opencv using source code. It was difficult as there were a lot of errors to fix to get it to compile but it finally did compile. Was hoping opencv-installer was simpler. If it included a few examples. ie the command line to run gradle installation on Windows. Then maybe we could figure out how to use it.

On the GitHub, go over to releases and click windows 64 bit. Are you on windows? I’ve provided links for 3 Operating Systems. You may have downloaded the wrong thing!
Windows Link
Mac Link
Debian Link

What instructions are you following? The readme doesn’t mention anything about running a raw JAR file. Maybe you were looking at the code generation examples?

I’m sorry. I meant WPI’s OpenCV Installer. https://github.com/WPIRoboticsProjects/opencv-installer.

We are in the middle of collecting everything we think we need and brain is freezing up. I did get Grip running on Windows and it was painless. Even figured out how to “wire” an output to an input. Thanks

Stepping back a bit, why do you think you need to install OpenCV? WPILib robot programs have it by default, and GRIP and shuffleboard bundle it internally, so it’s not necessary to install it for any roborio programming or using desktop tools

Because in 2016 I had openCV running on both a pi and windows which helped as I could test on Windows before trying on the pi. I think I found an exe that loads prebuilt windows x86-64 binaries.

Now I just need to figure out how to do this with vscode. Gradle is just too confusing for me. I’m Gradle illiterate.

In 2016, I was able to run java code in eclipse on Windows 8, with opencv. Then take the class files and copy them to the pi, compile them, and run them on the pi too.

Yesterday I was able to to take Class and Java Files located in a single directory and copy them to the pi, compile, and run them. However I can not run them on the PC. This was a simple opencv eye matrix example. I then successfully wrote a program to read a frame from the camera on the pi and save it to a jpg file.

Currently I am struggling with running a program with multiple java and class files. Especially when they are in separate folders. We used to be able to set the environment CLASSPATH to compile, and both CLASSPATH and the -DjavaLibraryPath during run to run files both on the PC and the pi. The -DjavaLibraryPath points to the locations of runtime executables (.dll on Windows, and .so on Linux). While the CLASSPATH environment variable or -cp option points to Jar and Java files.

But when we put these files in packages, then its a pain to figure out why the java interpreter can’t find something. And when we look at Maven or Gradle projects we can’t find where Maven and Gradle put things so that we may figure out the correct CLASSPATH environment variables nor -DjavaLibraryPath to run the examples.

That would be okay if the examples did exactly what we want. But when we want to run our own code we don’t know what to do. Unless we have the time to figure out maven and gradle and vscode.

And heaven help our students figure out maven and gradle and java and vscode and pi and linux and Windows. While gradle and maven make it easier for real programmers on large projects to compile their stuff they hide what is actually going on. ie running a compiler and then running the program.

We are lucky to keep a student interested in programming long enough to figure any of this out.

After 11 years, we had one student, with significant help from me, write one Class for a subsystem. We still had to modify the methods to work with a Command Based Code. And our programmer completely rewrote everything we did. (We may actually be doing more harm discouraging them that good).

I can compile and run an opencv program on the pi, but only if there is no package and the source file and output Class are in a single folder. I’ve spent six 8 hour days to get to this point. I wrote my first Basic program 44 years ago.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.