OpenFTC / OpenCV-Repackaged

10 stars 8 forks source link

Examples and Instructions #9

Closed e-holder closed 2 years ago

e-holder commented 2 years ago

I am fairly new to android and FTC. Last year I successfully used EasyOpenCV (looks like it was v 1.5). This year I plan on using EasyOpenCV again, and started by using your latest version. Initially, I'm getting an error on the import I used last year (import org.openftc.easyopencv.OpenCvCamera). I'm guessing the package naming changed with the new version. Last year there was some sample code in an "examples" folder that was a great help. Any chance that could be added for the updated version?

Also, from the instructions, I wasn't sure which libOpenCvAndroid453.so to use (the one in arm64-v8a or the one in armeabi-v7a). In addition, last year there were instructions to remove the arm64-v8a from the build.common.gradle file. Is that still an issue?

Windwoes commented 2 years ago

The package names have not changed, so not sure why you would be getting that error.

The examples directory is still present exactly where it was before. Only difference is I changed the samples to use the default teamcode package to make them easier to try right away.

You want the native library from the armeabi-v7a folder. The README links directly to the correct file :)

Yes, you still need to remove arm64-v8a from the gradle file. The 64-bit library is currently only used for the special OnBotJava version of the release.

e-holder commented 2 years ago

Thank you for the prompt response. I think that my confusion stemmed from thinking the OpenFTC/OpenCV-Repackaged repo was a newer/replacement for the OpenFTC/EasyOpenCV repo. So I had neglected to follow the EasyOpenCV readme and add the dependency: implementation 'org.openftc:easyopencv:1.5.0'. That fixed my pre-compile time errors. The examples weren't present in the OpenCV-Repackaged repo and the readme's lib*.so in that repo doesn't link to anything. I suppose my only remaining question (which should be resolved when I get access to our robot again) is whether I also need the dependency: implementation 'org.openftc:opencv-repackaged:4.5.3-B' (which we didn't need last year).

Windwoes commented 2 years ago

OpenCV-Repackaged is most definitely not a replacement for EasyOpenCV - they work in tandem.

EasyOpenCV has a transitive dependency on OpenCV-Repackaged. As such, if you pull in the EOCV artifact from Gradle, OpenCV-Repackaged is automagically pulled in as well.

I should mention nothing has changed about the setup since the initial release 2 years ago. OpenCV-Repackaged has always been there and EOCV has always depended on it :)