I worked for several days trying to use cv2.VideoCapture () in python for Android. I am using kivy with buildozer to build apk for android. Here is my code
from kivy.app import App from kivy.uix.image import Image from kivy.clock import Clock from kivy.graphics.texture import Texture import cv2 class KivyCamera(Image): def __init__(self, capture, fps, **kwargs): super(KivyCamera, self).__init__(**kwargs) self.capture = capture Clock.schedule_interval(self.update, 1.0 / fps) def update(self, dt): print 'hello' ret, frame = self.capture.read() print frame if ret:
This code works completely on the PC and successfully displays the video stream, but if I create it for the apk file using buildozer, it will be broken as soon as the application starts. Can someone help me fix this problem? Anyway, if someone did this, please comment ..
This is the log code from an Android device:
08-14 10:05:16.807 16826-16826/? A/DEBUG: backtrace: 08-14 10:05:16.807 16826-16826/? A/DEBUG:
source share