1
0
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:
Alexander Smorkalov
2023-07-13 16:07:10 +03:00
parent cea26341a5
commit 1a3523d2d8
51 changed files with 65 additions and 344 deletions
+2 -13
View File
@@ -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