ASCII output
[imago.git] / capture.py
index f4283b7..98ad7be 100755 (executable)
@@ -1,6 +1,9 @@
 #!/usr/bin/env python
 
+"""Go image capture."""
+
 import sys
+import argparse
 
 import pygame
 from pygame.locals import QUIT, KEYDOWN
@@ -22,10 +25,24 @@ class Screen:
 
 
 def main():
-    
-    cam = Camera()
+    parser = argparse.ArgumentParser(description=__doc__)
+    #parser.add_argument('file', metavar='file', nargs=1,
+    #                    help="image to analyse")
+    #parser.add_argument('-w', type=int, default=640,
+    #                    help="scale image to the specified width before analysis")
+    parser.add_argument('-d', '--device', type=int, default=0,
+                        help="number of video device to use")
+    #parser.add_argument('-s', '--save', dest='do_something', action='store_const',
+    #                    const=image_save, default=im_debug.show,
+    #                    help="save images instead of displaying them")
+    args = parser.parse_args()
+
+    cam = Camera(device=args.device)
     screen = Screen()
 
+    im = cam.get_image()
+    screen.display_picture(im)
+
     im_number = 0
 
     while True: