from ursina import *
import tracker
# define a video capture object
app = Ursina()
player = Entity(model='cube', color=color.orange, scale_y=2)
if app.run():
tracker.track()
app.run()
追踪器代码
import cv2
def track():
vid = cv2.VideoCapture(0)
while True:
ret, frame = vid.read()
cv2.imshow('frame', frame)
# the 'q' button is set as the
# quitting button you may use any
# desired button of your choice
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# After the loop release the cap object
vid.release()
# Destroy all the windows
cv2.destroyAllWindows()
track()
请有人告诉我我可以做这个吗
我想制作一个可以用手势控制3D物体的应用程序
当我运行这个时,两个窗口都不会并排打开 侧面
就像这样:
片段:
def run():
app.run():
tracker.track()
if __name__=='main':
run()