Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

still asking for OpenCV Manager #4

Closed
farfromrefug opened this issue Feb 25, 2020 · 7 comments
Closed

still asking for OpenCV Manager #4

farfromrefug opened this issue Feb 25, 2020 · 7 comments

Comments

@farfromrefug
Copy link

I tried your sample and when running it still asks for opencv manager.
Looking at the generated apk i see this
Screen Shot 2020-02-25 at 18 16 45
Though when running it checks for openv_info so lib which is not there:
Screen Shot 2020-02-25 at 18 18 45

Any idea?

PS: i am using opencv 4.1.1

@ahasbini
Copy link
Owner

ahasbini commented Feb 26, 2020

That's true, with version 4.1.1, there are a couple of changes that need to be made.

  1. Include the libc++_shared.so in the APK.
  2. Call JavaCameraView.setCameraPermissionGranted().

I've pushed a working sample in branch 4.1.1-fix. (Note, enable the camera permission from the settings of the app).

@farfromrefug
Copy link
Author

OK great I understand. Thanks. BTW can I make the so smaller? Like filtering some ooencv components?

@ahasbini
Copy link
Owner

The libopencv4_java.so is like an opencv library containing all the different components (core, imgproc, dnn, etc...) compiled into a single .so file and packaged with the OpenCV Java SDK which is a wrapper with different utilities for the .so lib. This lib is provided as part of the OpenCV releases hence it is pre-built and provided even without using the AndroidOpenCVGradlePlugin. Seems to me that reducing it would need to re-compile this lib and OpenCV for Android architecture which is something that I would find difficult and time consuming.

On the other hand though, one could use selected native libs of the OpenCV components with the native code (Java/Kotlin apps with C/C++ code). That way, the OpenCV Java SDK and the libopencv4_java.so dependencies could be removed and instead depend on the smaller component libs of OpenCV which the largest file there is about 8MB. Unfortunately the repo does not have a sample to display this approach, it is planned to improve the sample to showcase the different strategies one could include the OpenCV in Android, hopefully soon. Stay tuned for updates or if you have anything in mind feel free to suggest.

@farfromrefug
Copy link
Author

@ahasbini awesome! Cant wait to see that :) For now as what i do is just a POC, i am good with the current behavior.
Again thank you, really awesome!

@farfromrefug
Copy link
Author

@ahasbini sorry one last issue (tell me if you want another issue in github)
when building i always get this:

Execution failed for task ':app:unZipAndroidOpenCV'.
/Volumes/data/mguillon/.androidopencv/4.1.1/opencv-4.1.1-android-sdk/OpenCV-android-sdk/LICENSE (Permission denied)

I can manually fix this by changing rights, but it would be better if it was done by the process. I think it is missing permissions to extract the zip

@ahasbini
Copy link
Owner

A new issue would be better as this seems different. Nevertheless, run the below commands in a shell and post their outputs:

cd /Volumes/data/mguillon
ls -la | grep .androidopencv
ls -la .androidopencv
ls -la .androidopencv/4.1.1
ls -la .androidopencv/4.1.1/opencv-4.1.1-android-sdk

@ahasbini
Copy link
Owner

Closing old issues, feel free to comment again or open a new issue(s) if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants