added cv2.destroyAllWindows()

This commit is contained in:
Gary Bradski 2012-03-15 03:45:15 +00:00
parent 41d2a3c832
commit dfaabd88fc
31 changed files with 33 additions and 2 deletions

View File

@ -45,3 +45,4 @@ if __name__ == '__main__':
cv2.imshow('preview', small)
cv2.setMouseCallback('preview', onmouse)
cv2.waitKey()
cv2.destroyAllWindows()

View File

@ -54,4 +54,5 @@ if __name__ == '__main__':
print "RMS:", rms
print "camera matrix:\n", camera_matrix
print "distortion coefficients: ", dist_coefs.ravel()
cv2.destroyAllWindows()

View File

@ -106,6 +106,7 @@ class App(object):
break
if ch == ord('b'):
self.show_backproj = not self.show_backproj
cv2.destroyAllWindows()
if __name__ == '__main__':

View File

@ -70,3 +70,4 @@ if __name__ == '__main__':
update()
if ch == 27:
break
cv2.destroyAllWindows()

View File

@ -45,3 +45,4 @@ if __name__ == '__main__':
ch = 0xFF & cv2.waitKey(1)
if ch == 27:
break
cv2.destroyAllWindows()

View File

@ -46,3 +46,4 @@ if __name__ == '__main__':
cv2.createTrackbar( "levels+3", "contours", 3, 7, update )
cv2.imshow('image', img)
0xFF & cv2.waitKey()
cv2.destroyAllWindows()

View File

@ -149,3 +149,4 @@ class App:
if __name__ == '__main__':
App().run()

View File

@ -53,4 +53,5 @@ if __name__ == '__main__':
update()
if need_update:
update()
cv2.destroyAllWindows()

View File

@ -27,4 +27,5 @@ if __name__ == '__main__':
ch = cv2.waitKey(5)
if ch == 27:
break
cv2.destroyAllWindows()

View File

@ -56,4 +56,5 @@ if __name__ == '__main__':
if 0xFF & cv2.waitKey(5) == 27:
break
cv2.destroyAllWindows()

View File

@ -93,3 +93,4 @@ if __name__ == '__main__':
ref_img = img.copy()
if ch == 27:
break
cv2.destroyAllWindows()

View File

@ -100,3 +100,4 @@ if __name__ == '__main__':
cv2.imshow('find_obj SURF', vis_brute)
cv2.imshow('find_obj SURF flann', vis_flann)
0xFF & cv2.waitKey()
cv2.destroyAllWindows()

View File

@ -62,3 +62,4 @@ if __name__ == '__main__':
connectivity = 12-connectivity
print 'connectivity =', connectivity
update()
cv2.destroyAllWindows()

View File

@ -65,3 +65,4 @@ if __name__ == '__main__':
cv2.imshow('img', img)
cv2.imshow('result', res2)
cv2.waitKey()
cv2.destroyAllWindows()

View File

@ -54,3 +54,4 @@ if __name__ == '__main__':
ch = 0xFF & cv2.waitKey(0)
if ch == 27:
break
cv2.destroyAllWindows()

View File

@ -106,4 +106,5 @@ if __name__ == '__main__':
print 'ESC'
cv2.destroyAllWindows()
break
cv2.destroyAllWindows()

View File

@ -32,4 +32,5 @@ if __name__ == '__main__':
img_mark[:] = img
mark[:] = 0
sketch.show()
cv2.destroyAllWindows()

View File

@ -154,3 +154,4 @@ if __name__ == '__main__':
fn = args['--save']
print 'saving model to %s ...' % fn
model.save(fn)
cv2.destroyAllWindows()

View File

@ -107,6 +107,7 @@ def main():
print __doc__
App(video_src).run()
cv2.destroyAllWindows()
if __name__ == '__main__':
main()

View File

@ -92,6 +92,7 @@ def main():
print __doc__
App(video_src).run()
cv2.destroyAllWindows()
if __name__ == '__main__':
main()

View File

@ -56,3 +56,4 @@ if __name__ == '__main__':
if ch == ord('2'):
cur_str_mode = str_modes.next()
update()
cv2.destroyAllWindows()

View File

@ -78,3 +78,4 @@ if __name__ == '__main__':
prev_frame = frame.copy()
if 0xFF & cv2.waitKey(5) == 27:
break
cv2.destroyAllWindows()

View File

@ -69,3 +69,4 @@ if __name__ == '__main__':
cv.imshow("gray",gray)
if (cv.waitKey() & 255) == 27:
break
cv2.destroyAllWindows()

View File

@ -35,3 +35,4 @@ if __name__ == '__main__':
cv2.imshow('img', vis)
if 0xFF & cv2.waitKey(5) == 27:
break
cv2.destroyAllWindows()

View File

@ -80,4 +80,5 @@ if __name__ == '__main__':
if show_glitch:
cur_glitch = img.copy()
print 'glitch is', ['off', 'on'][show_glitch]
cv2.destroyAllWindows()

View File

@ -53,3 +53,4 @@ if __name__ == '__main__':
ch = 0xFF & cv2.waitKey()
if ch == 27:
break
cv2.destroyAllWindows()

View File

@ -37,3 +37,4 @@ if __name__ == '__main__':
ch = 0xFF & cv2.waitKey()
if ch == 27:
break
cv2.destroyAllWindows()

View File

@ -70,4 +70,5 @@ if __name__ == '__main__':
cv2.imshow('left', imgL)
cv2.imshow('disparity', (disp-min_disp)/num_disp)
cv2.waitKey()
cv2.waitKey()
cv2.destroyAllWindows()

View File

@ -62,3 +62,4 @@ if __name__ == '__main__':
cv2.imshow('a', vis)
if 0xFF & cv2.waitKey(5) == 27:
break
cv2.destroyAllWindows()

View File

@ -165,3 +165,4 @@ if __name__ == '__main__':
cv2.imwrite(fn, img)
print fn, 'saved'
shot_idx += 1
cv2.destroyAllWindows()

View File

@ -53,7 +53,8 @@ class App:
self.markers[:] = 0
self.markers_vis[:] = self.img
self.sketch.show()
cv2.destroyAllWindows()
if __name__ == '__main__':
import sys