[英]How can i convert "\xff\xfet\x00e\x00s\x00t\x00" into b'\xff\xfet\x00e\x00s\x00t\x00"' in python
[英]How can i release the camera<imutils.video.webcamvideostream.WebcamVideoStream instance at 0x7f2c40e75b00>
我使用此代码启动相机
from imutils.video import Videostream
vs = VideoStream(0).start()
但是当我尝试这个时
vs.stop()
相机不会停止,变量 vs 显示此值:
<imutils.video.webcamvideostream.WebcamVideoStream instance at 0x7f2c40e75b00>
imutils实际上使用cv2.VideoCapture()初始化流,但并未停止释放它。
vs.stream.release()应该可以。
我已经在imutils github repo中创建了pull请求:) https://github.com/jrosebr1/imutils/pull/81/files
vs.stream.release()
对我不起作用。
vs.stream.stream.release()
完美运行。
Imutils 使用 OpenCV 构建,因此我们需要使用 release() 来释放网络摄像头。 我之前尝试过 stop(),然后我意识到并使用了 release(),它对我来说很好用。
vs = VideoStream(src=0).start() ## To launch the cam
vs.stream.release() # To release the camera
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.