In a past game, before the VisionPortal, I helped some students use JNI to call OpenCV code written in c++. At that time we had to import OpenCV as a module into our FTC Android Studio project. But now with the VisionPortal I don’t see an OpenCV module, although OpenCV is available in Java, so I don’t know how to reference it from CMakeLists.txt. Can you help?
Hi there - author of Vision Portal and EasyOpenCV here.
You’re not going to be able to directly build OpenCV C++ code against against the modern SDK without some additional hoops. At minimum, you need the header files to build against, and these are not packaged with the SDK. Linking against the shared library may also prove difficult because it will be located in some obscure gradle dependency cache directory instead of in the build tree.
I actually have a quickstart repository for using OpenCV from C++ with EOCV located here: GitHub - OpenFTC/EasyOpenCV-Cpp-Quickstart: A quickstart FTC Robot Controller project for running C++ OpenCV code in conjunction with EasyOpenCV
I see now however that I haven’t updated it since SDK 8.0 and EOCV v1.5.2. Some things have changed in recent years that means just bumping version numbers isn’t going to work. I might try to get it updated in the next couple weeks if I have time.