Add cv.DestroyAllWindows() after exiting loop