#!/usr/local/bin/python
import sys,cv2
from lib import log
capture = "false"

def take(p):
	global capture
	if capture == "false":
		capture = cv2.VideoCapture(-1)
	log.add("Taking picture...")
	#capture = cv2.VideoCapture(-1)
	for i in range(50):
		ret, frame = capture.read()
	cv2.imwrite(p, frame)
	#capture.release()
	log.add("Picture saved!")