我使用python和kivy框架访问android4.4中的相机。在
这是我的简单代码:
from kivy.app import App
from kivy.uix.camera import Camera
from kivy.core.window import Window
class CamApp(App):
def build(self):
return Camera(resolution= Window.size)
CamApp().run()
但当我运行代码时,它显示了:
理想情况下,它应该是这样的:
看起来kivy相机显示的输出是内置的-90度。这是正常现象还是错误?还是我自己旋转显示器?在
我认为这是一个bug,但是如果您使用以下代码,您可以旋转小部件:
这对我在android上很管用。在
最好在kivy代码中使用opencv。它为你提供了一系列操作图片和视频的选项和工具。 准备好了。 我有180度翻转问题,并用opencv解决了。你可以使用我的代码和这个链接:https://www.tutorialkart.com/opencv/python/opencv-python-rotate-image/
克里斯蒂安的解决方案对我不起作用。 它将在画布之前是这样写的:
关于那件事画布之前以及画布后只能在其他对象中调用以下代码对我有效:
^{pr2}$资源:
相关问题 更多 >
编程相关推荐