Open CV Install docker mage run $ docker ps $ docker start 0c5f0bc9b04c $ docker ps -a We need to go Self terminal not SSH terminal $ gksudo open a bog and type lxterminal Python and OpenCV. Alright, now we can finally start writing some code! Open up a new file, name it test_image . py , and insert the following code: Accessing the Raspberry Pi Camera with OpenCV and Python Python 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # import the necessary packages from picamera . array import PiRGBArray from picamera import PiCamera import time import cv2 # initialize the camera and grab a reference to the raw camera capture camera = PiCamera ( ) rawCapture = PiRGBArray ( camera ) # allow the camera to warmup time . sleep ( 0.1 ) # grab an image from the camera camera . capture ( rawCapture , format = "bgr" ) image = rawC...
Comments
Post a Comment