mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Drop Python2 support.
This commit is contained in:
@@ -22,14 +22,6 @@ Keys:
|
||||
b - toggle back-projected probability visualization
|
||||
'''
|
||||
|
||||
# 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
|
||||
|
||||
@@ -68,7 +60,7 @@ class App(object):
|
||||
bin_count = self.hist.shape[0]
|
||||
bin_w = 24
|
||||
img = np.zeros((256, bin_count*bin_w, 3), np.uint8)
|
||||
for i in xrange(bin_count):
|
||||
for i in range(bin_count):
|
||||
h = int(self.hist[i])
|
||||
cv.rectangle(img, (i*bin_w+2, 255), ((i+1)*bin_w-2, 255-h), (int(180.0*i/bin_count), 255, 255), -1)
|
||||
img = cv.cvtColor(img, cv.COLOR_HSV2BGR)
|
||||
|
||||
Reference in New Issue
Block a user