2 """Usage: imago.py file"""
10 class UsageError(Exception):
11 def __init__(self, msg):
15 """Main function of the program."""
20 raise UsageError('Missing filename')
24 except UsageError, err:
25 print >>sys.stderr, err.msg, "(\"imago.py --help\" for help)"
28 #TODO exception on file error
29 image = Image.open(argv[0])
30 #im_debug.show(image, "original image")
32 im_l = image.convert('L')
33 #im_debug.show(im_l, "ITU-R 601-2 luma transform")
35 im_edges = filter.edge_detection(im_l)
36 #im_debug.show(im_edges, "edge detection")
38 im_h = filter.high_pass(im_edges, 80)
39 #im_debug.show(im_h, "high pass filter")
41 im_hough = hough.transform(im_h)
42 #im_debug.show(im_hough, "hough transform")
44 im_h2 = filter.high_pass(im_hough, 120)
45 im_debug.show(im_h2, "high pass filter")
49 if __name__ == '__main__':