changeset 660:f77be2334246

STUB: python/clean_whiteboard.py
author Jeff Hammel <k0scist@gmail.com>
date Thu, 03 Apr 2014 16:41:21 -0700
parents e5be32fea639
children 1453c8a3747e
files python/clean_whiteboard.py
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/python/clean_whiteboard.py	Thu Apr 03 11:53:23 2014 -0700
+++ b/python/clean_whiteboard.py	Thu Apr 03 16:41:21 2014 -0700
@@ -19,12 +19,17 @@
 
 def main(args=sys.argv[1:]):
 
-        # parse command line
-        parser = argparse.ArgumentParser(description=__doc__)
-            parser.add_argument('input', nargs='?',
-                                                        type=argparse.FileType('r'), default=sys.stdin,
-                                                        help='input file, or read from stdin if ommitted')
-                options = parser.parse_args(args)
+    # parse command line
+    parser = argparse.ArgumentParser(description=__doc__)
+    parser.add_argument('input',
+                        type=argparse.FileType('r'),
+                        help='input file')
+    parser.add_argument('-o', '--output' dest='output',
+                        type=argparse.FileType('w'), default=sys.stdout,
+                        help='output file or stdout')
+    options = parser.parse_args(args)
 
-                if __name__ == '__main__':
-                        main()
+    subprocess.check_call(['convert', options.input, '-morphology', 'Convolve', 'DoG:15,100,0', '-negate', '-normalize', '-blur', '0x1', '-channel', 'RBG', '-level', '60%,91%,0.1', options.output])
+
+if __name__ == '__main__':
+    main()