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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -