I try to use uix.camera widget and show some wideo from my web-camera. I looked into the documentation and try to use this simply code. But it's just show me a white creen withoud any video (I enabled playing). What I'm doing wrong? Maybe some useful docs\tutorial exist (because from official documentation I understanding a little from many). Thanks for any help.
import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.camera import Camera
class MainApp(App):
def build(self):
return Camera(play=True)
if __name__== "__main__":
MainApp().run()
Just import that file https://github.com/kivy/plyer/blob/master/plyer/platforms/android/camera.py Also, don't forget to add CAMERA permissions to manifest.
I've done heavy computation using OpenCV within Kivy. No issues, it just works.
It was possible to use Kivy in Jupyter Notebook since Kivy version 1.3. 0 using InteractiveLauncher (see documentation). However, this has been deprecated since version 1.10.
You need to specify resolution. In my case, I also needed to specify index=1, that is the second camera plugged in my computer.
Example:
import kivy
kivy.require('1.9.1')
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.camera import Camera
class MainApp(App):
def build(self):
return Camera(play=True, index=1, resolution=(640,480))
if __name__== "__main__":
MainApp().run()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With