#!/usr/bin/env python2.7

import sys, math
import numpy as np
import cv2

def main(argv):

  # gram video from available camera (e.g., laptop cam)
  cap = cv2.VideoCapture(0)

  while(True):

    # capture frame-by-frame
    ret, frame = cap.read()

    # our operations on the frame come here
    gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)

    # display the resulting frame
    cv2.imshow('frame',gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
      break

  # when everything is done, release the capture
  cap.release()
  cv2.destroyAllWindows()

if __name__ == '__main__':
# main(sys.argv[1:])
  main(sys.argv)
