War on Whitespace, master edition: trailing spaces.
This commit is contained in:
@@ -119,19 +119,19 @@ if __name__ == '__main__':
|
||||
img1 = cv2.imread(fn1, 0)
|
||||
img2 = cv2.imread(fn2, 0)
|
||||
detector, matcher = init_feature(feature_name)
|
||||
|
||||
|
||||
if img1 is None:
|
||||
print 'Failed to load fn1:', fn1
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if img2 is None:
|
||||
print 'Failed to load fn2:', fn2
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if detector is None:
|
||||
print 'unknown feature:', feature_name
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
print 'using', feature_name
|
||||
|
||||
pool=ThreadPool(processes = cv2.getNumberOfCPUs())
|
||||
|
@@ -102,7 +102,7 @@ class App(object):
|
||||
vis[:] = prob[...,np.newaxis]
|
||||
try:
|
||||
cv2.ellipse(vis, track_box, (0, 0, 255), 2)
|
||||
except:
|
||||
except:
|
||||
print track_box
|
||||
|
||||
cv2.imshow('camshift', vis)
|
||||
@@ -119,7 +119,7 @@ if __name__ == '__main__':
|
||||
import sys
|
||||
try:
|
||||
video_src = sys.argv[1]
|
||||
except:
|
||||
except:
|
||||
video_src = 0
|
||||
print __doc__
|
||||
App(video_src).run()
|
||||
|
@@ -40,9 +40,9 @@ def coherence_filter(img, sigma = 11, str_sigma = 11, blend = 0.5, iter_n = 4):
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
try:
|
||||
try:
|
||||
fn = sys.argv[1]
|
||||
except:
|
||||
except:
|
||||
fn = '../cpp/baboon.jpg'
|
||||
|
||||
src = cv2.imread(fn)
|
||||
|
@@ -141,7 +141,7 @@ class App:
|
||||
count = tk.IntVar()
|
||||
while True:
|
||||
match_index = text.search(pattern, 'matchPos', count=count, regexp=regexp, stopindex='end')
|
||||
if not match_index:
|
||||
if not match_index:
|
||||
break
|
||||
end_index = text.index( "%s+%sc" % (match_index, count.get()) )
|
||||
text.mark_set('matchPos', end_index)
|
||||
|
@@ -143,15 +143,15 @@ if __name__ == '__main__':
|
||||
if img1 is None:
|
||||
print 'Failed to load fn1:', fn1
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if img2 is None:
|
||||
print 'Failed to load fn2:', fn2
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if detector is None:
|
||||
print 'unknown feature:', feature_name
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
print 'using', feature_name
|
||||
|
||||
kp1, desc1 = detector.detectAndCompute(img1, None)
|
||||
|
@@ -51,14 +51,14 @@ if __name__ == '__main__':
|
||||
print __doc__
|
||||
try:
|
||||
img_fn = sys.argv[1]
|
||||
except:
|
||||
except:
|
||||
img_fn = '../cpp/baboon.jpg'
|
||||
|
||||
img = cv2.imread(img_fn)
|
||||
if img is None:
|
||||
print 'Failed to load image file:', img_fn
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
filters = build_filters()
|
||||
|
||||
with Timer('running single-threaded'):
|
||||
|
@@ -61,7 +61,7 @@ if __name__ == '__main__':
|
||||
print "usage : python hist.py <image_file>"
|
||||
|
||||
im = cv2.imread(fname)
|
||||
|
||||
|
||||
if im is None:
|
||||
print 'Failed to load image file:', fname
|
||||
sys.exit(1)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
'''
|
||||
This example illustrates how to use cv2.HoughCircles() function.
|
||||
Usage: ./houghcircles.py [<image_name>]
|
||||
Usage: ./houghcircles.py [<image_name>]
|
||||
image argument defaults to ../cpp/board.jpg
|
||||
'''
|
||||
|
||||
|
@@ -23,16 +23,16 @@ if __name__ == '__main__':
|
||||
import sys
|
||||
try:
|
||||
fn = sys.argv[1]
|
||||
except:
|
||||
except:
|
||||
fn = '../cpp/fruits.jpg'
|
||||
|
||||
|
||||
print __doc__
|
||||
|
||||
img = cv2.imread(fn)
|
||||
if img is None:
|
||||
print 'Failed to load image file:', fn
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
img_mark = img.copy()
|
||||
mark = np.zeros(img.shape[:2], np.uint8)
|
||||
sketch = Sketcher('img', [img_mark, mark], lambda : ((255, 255, 255), 255))
|
||||
|
@@ -27,13 +27,13 @@ if __name__ == '__main__':
|
||||
fn = sys.argv[1]
|
||||
except:
|
||||
fn = '../cpp/baboon.jpg'
|
||||
|
||||
|
||||
img = cv2.imread(fn)
|
||||
|
||||
|
||||
if img is None:
|
||||
print 'Failed to load image file:', fn
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
cv2.imshow('original', img)
|
||||
|
||||
modes = cycle(['erode/dilate', 'open/close', 'blackhat/tophat', 'gradient'])
|
||||
|
Reference in New Issue
Block a user