[英]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.