mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Drop Python2 support.
This commit is contained in:
@@ -21,14 +21,6 @@ Keys:
|
||||
Select a textured planar object to track by drawing a box with a mouse.
|
||||
'''
|
||||
|
||||
# Python 2/3 compatibility
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
if PY3:
|
||||
xrange = range
|
||||
|
||||
import numpy as np
|
||||
import cv2 as cv
|
||||
|
||||
@@ -104,7 +96,7 @@ class PlaneTracker:
|
||||
matches = [m[0] for m in matches if len(m) == 2 and m[0].distance < m[1].distance * 0.75]
|
||||
if len(matches) < MIN_MATCH_COUNT:
|
||||
return []
|
||||
matches_by_id = [[] for _ in xrange(len(self.targets))]
|
||||
matches_by_id = [[] for _ in range(len(self.targets))]
|
||||
for m in matches:
|
||||
matches_by_id[m.imgIdx].append(m)
|
||||
tracked = []
|
||||
|
||||
Reference in New Issue
Block a user