1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +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
+9 -4
View File
@@ -18,12 +18,10 @@ import cv2 as cv
from gaussian_mix import make_gaussians
if __name__ == '__main__':
def main():
cluster_n = 5
img_size = 512
print(__doc__)
# generating bright palette
colors = np.zeros((1, cluster_n, 3), np.uint8)
colors[0,:] = 255
@@ -43,8 +41,15 @@ if __name__ == '__main__':
cv.circle(img, (x, y), 1, c, -1)
cv.imshow('gaussian mixture', img)
cv.imshow('kmeans', img)
ch = cv.waitKey(0)
if ch == 27:
break
print('Done')
if __name__ == '__main__':
print(__doc__)
main()
cv.destroyAllWindows()