Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- from skimage.io import imsave
- class Camera(object):
- def __init__(self):
- self.cap = cv2.VideoCapture(0)
- def get_frame(self):
- ret, capture = self.cap.read()
- if (ret):
- imsave('gromfactory/test.png', capture)
- y = open('gromfactory/test.png', 'rb').read()
- return y
- else:
- return None
- def __del__(self):
- self.cap.release()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement