python - How can I open up webcam and process images with docker and OpenCV? -
i have python script uses opencv , when runs script want process image webcam , give result. how can make it?
this how tried:
my simple test python script:
import cv2 cap = cv2.videocapture(0) while true: ret, frame = cap.read() print ret
this in dockerfile:
from gaborvecsei/opencvinstall add testcode.py ./testcode.py #start sample app cmd ["python", "testcode.py"]
after build , run it prints false
means not have image webcam.
how can images?
to make cam visible docker container, should pass --device argument when start container.
docker start --device /dev/video0 helloworld:1.0.0
Comments
Post a Comment