mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Drop Python2 support.
This commit is contained in:
@@ -22,11 +22,6 @@ f - change distance function
|
||||
ESC - exit
|
||||
'''
|
||||
|
||||
# Python 2/3 compatibility
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
import numpy as np
|
||||
import cv2 as cv
|
||||
|
||||
@@ -49,10 +44,7 @@ def sample_line(p1, p2, n, noise=0.0):
|
||||
|
||||
dist_func_names = it.cycle('DIST_L2 DIST_L1 DIST_L12 DIST_FAIR DIST_WELSCH DIST_HUBER'.split())
|
||||
|
||||
if PY3:
|
||||
cur_func_name = next(dist_func_names)
|
||||
else:
|
||||
cur_func_name = dist_func_names.next()
|
||||
cur_func_name = next(dist_func_names)
|
||||
|
||||
def update(_=None):
|
||||
noise = cv.getTrackbarPos('noise', 'fit line')
|
||||
@@ -89,10 +81,7 @@ def main():
|
||||
ch = cv.waitKey(0)
|
||||
if ch == ord('f'):
|
||||
global cur_func_name
|
||||
if PY3:
|
||||
cur_func_name = next(dist_func_names)
|
||||
else:
|
||||
cur_func_name = dist_func_names.next()
|
||||
cur_func_name = next(dist_func_names)
|
||||
if ch == 27:
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user