How I can use Kivy (Python) camera

前端 未结 0 432
眼角桃花
眼角桃花 2021-01-13 07:52

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

相关标签:
回答
  • 2021-01-13 08:35

    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()
    
    0 讨论(0)
  • 消灭零回复
提交回复
热议问题