tom333 / mycamerai

An android camera with AI inside. Made with love in Python
GNU General Public License v3.0
4 stars 3 forks source link

OpenCv and Kivy #11

Open franslott opened 4 years ago

franslott commented 4 years ago

Hi @tom333,

i have an issue were opencv keeps failing witht this error,

"Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer."

Can you please help with some step by step instruction of how you solved this. I am a newbie to kivy as well as buildozer.

Thank you.

tom333 commented 4 years ago

First get my Dockerfile and build the image with this command : podman build -t myapp-buildozer -f Dockerfile .

Then use the image like this :

podman run -it \
                    --privileged \
                    --volume /dev/bus/usb:/dev/bus/usb \
                    --volume buildozer_home:/root/.buildozer \
                    --volume ~/.android:/root/.android \
                    --volume ${CURDIR}:/home/user/hostcwd \
                    myapp-buildozer android debug deploy run logcat

It will build and deploy your app to your connected android device

You have also to adapt your buildzer.spec file to use pre downloaded stuff : android.ndk_path =/opt/android-ndk android.sdk_path =/opt/android-sdk android.ant_path =/opt/apache-ant-1.9.4 android.skip_update = True android.accept_sdk_license = True

franslott commented 4 years ago

Hi @tom333

It seems to be working but i seem to have this error as below when i run the second part to build.

Trying to pull docker.io/library/myapp-buildozer... denied: requested access to the resource is denied Trying to pull quay.io/myapp-buildozer... StatusCode: 404, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final/... Error: unable to pull myapp-buildozer: 2 errors occurred:

It seems a docker problem, how did you navigate this?

Thanks you.

tom333 commented 4 years ago

You must build the image locally, it's not available on any remote repository, because it's specific to your project

tom333 commented 4 years ago

@franslott if it can help, I just create a simple cookie cutter template you can use : https://github.com/tom333/cookiecutter-kivy-project

franslott commented 4 years ago

@tom333

This did not generate anything my current directory, it seems the cookie file was created in the home folder. The "deploy make" does not run. Do you have time to make a small 2 minute video that you can perhaps post to me in anyway?

Thank you loads for the effort.

tom333 commented 4 years ago

Can you please open a post on stackoverflow with the output of the above command ? It will be easyer to help you Thanks

franslott commented 4 years ago

@tom333

Thank, i actually with your help manage to get it to compile. But it seems the camera is not displaying.

cap = cv2.VideoCapture(0)

seems not to capture anything for some reason. Instead the app closes upon running the capture command.But thank you very much.