Fixed shebangs, added error checking
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#/usr/bin/env python
|
||||
#!/usr/bin/env python
|
||||
|
||||
'''
|
||||
Distance transform sample.
|
||||
@@ -15,15 +15,22 @@ Keys:
|
||||
import numpy as np
|
||||
import cv2
|
||||
import cv2.cv as cv
|
||||
|
||||
from common import make_cmap
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
try: fn = sys.argv[1]
|
||||
except: fn = '../cpp/fruits.jpg'
|
||||
try:
|
||||
fn = sys.argv[1]
|
||||
except:
|
||||
fn = '../cpp/fruits.jpg'
|
||||
print __doc__
|
||||
|
||||
img = cv2.imread(fn, 0)
|
||||
if img is None:
|
||||
print 'Failed to load fn:', fn
|
||||
sys.exit(1)
|
||||
|
||||
cm = make_cmap('jet')
|
||||
need_update = True
|
||||
voronoi = False
|
||||
|
Reference in New Issue
Block a user