math.pi -> np.pi

squares.py sample added
This commit is contained in:
Alexander Mordvintsev
2011-07-16 18:29:51 +00:00
parent 570041fed5
commit ae5dd1d748
5 changed files with 45 additions and 11 deletions

View File

@@ -1,5 +1,4 @@
import numpy as np
import math
from numpy import random
import cv2
@@ -20,7 +19,7 @@ def make_gaussians(cluster_n, img_size):
def draw_gaussain(img, mean, cov, color):
x, y = np.int32(mean)
w, u, vt = cv2.SVDecomp(cov)
ang = np.arctan2(u[1, 0], u[0, 0])*(180/math.pi)
ang = np.arctan2(u[1, 0], u[0, 0])*(180/np.pi)
s1, s2 = np.sqrt(w)*3.0
cv2.ellipse(img, (x, y), (s1, s2), ang, 0, 360, color, 1, cv2.CV_AA)