1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

samples: fix python samples compatibility with demo.py

This commit is contained in:
Alexander Alekhin
2019-03-19 21:03:58 +03:00
parent f4c2c4412b
commit 04fad57fc1
48 changed files with 678 additions and 403 deletions
+10 -2
View File
@@ -9,9 +9,10 @@ if PY3:
xrange = range
import numpy as np
from numpy import random
import cv2 as cv
from numpy import random
def make_gaussians(cluster_n, img_size):
points = []
ref_distrs = []
@@ -34,7 +35,7 @@ def draw_gaussain(img, mean, cov, color):
cv.ellipse(img, (x, y), (s1, s2), ang, 0, 360, color, 1, cv.LINE_AA)
if __name__ == '__main__':
def main():
cluster_n = 5
img_size = 512
@@ -66,4 +67,11 @@ if __name__ == '__main__':
ch = cv.waitKey(0)
if ch == 27:
break
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()