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:
@@ -1,13 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# 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
|
||||
|
||||
@@ -16,7 +8,7 @@ from numpy import random
|
||||
def make_gaussians(cluster_n, img_size):
|
||||
points = []
|
||||
ref_distrs = []
|
||||
for _i in xrange(cluster_n):
|
||||
for _i in range(cluster_n):
|
||||
mean = (0.1 + 0.8*random.rand(2)) * img_size
|
||||
a = (random.rand(2, 2)-0.5)*img_size*0.1
|
||||
cov = np.dot(a.T, a) + img_size*0.05*np.eye(2)
|
||||
|
||||
Reference in New Issue
Block a user