Is it possible to use OpenCV functions in a Kivy android app?

172 views
Skip to first unread message

Kivy user

unread,
Jun 18, 2023, 8:41:45 AM6/18/23
to Kivy users support
I am creating a QR code reader app for Android using Kivy.
Is it possible to use the "OpenCV functions below" in a Kivy Android app built with Buildozer?

cv2.VideoCapture()
cv2. QRCodeDetector()

The former cv2.VideoCapture() works fine on Mac, but I haven't been able to get it to work on Android yet.
If I change cv2.VideoCapture() to kivy.uix.camera's Camera, the camera works, but accuracy of cv2.QRCodeDetector() gets worse.

I would appreciate it if anyone could give me some advice.

Robert

unread,
Jun 18, 2023, 1:01:45 PM6/18/23
to Kivy users support
> Is it possible to use the "OpenCV functions below" in a Kivy Android app built with Buildozer?

> cv2.VideoCapture()
probably not
> cv2. QRCodeDetector()
never tried it

https://github.com/Android-for-Python/c4k_qr_example
https://github.com/Android-for-Python/c4k_opencv_example

Kivy user

unread,
Jun 20, 2023, 5:50:15 AM6/20/23
to Kivy users support
Thank you Robert!

I have newly installed the ZXing library for scanning QR codes.
It works fine on Mac as well, but when I run it on Android I got the errors below.

   PermissionError: [Errno 13] Permission denied: 'java'
   zxing.BarCodeReaderException: ('Could not execute specified Java binary', 'java')

Would it be possible to allow the use of Java in the buildozer.spec?

Or if I want to create a QR code scanner for Android with Kivy, is kivy-garden.zbarcam better?

2023年6月19日月曜日 2:01:45 UTC+9 Robert:

Robert

unread,
Jun 20, 2023, 1:21:25 PM6/20/23
to Kivy users support
Reply all
Reply to author
Forward
0 new messages