mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
fix samples
This commit is contained in:
parent
8fad85edda
commit
0f24d4d2a1
@ -28,7 +28,7 @@ def make_gaussians(cluster_n, img_size):
|
||||
return points, ref_distrs
|
||||
|
||||
def draw_gaussain(img, mean, cov, color):
|
||||
x, y = np.int32(mean)
|
||||
x, y = mean
|
||||
w, u, _vt = cv.SVDecomp(cov)
|
||||
ang = np.arctan2(u[1, 0], u[0, 0])*(180/np.pi)
|
||||
s1, s2 = np.sqrt(w)*3.0
|
||||
|
@ -46,7 +46,7 @@ def hist_lines(im):
|
||||
im = cv.cvtColor(im,cv.COLOR_BGR2GRAY)
|
||||
hist_item = cv.calcHist([im],[0],None,[256],[0,256])
|
||||
cv.normalize(hist_item,hist_item,0,255,cv.NORM_MINMAX)
|
||||
hist=np.int32(np.around(hist_item))
|
||||
hist = np.int32(np.around(hist_item))
|
||||
for x,y in enumerate(hist):
|
||||
cv.line(h,(x,0),(x,y[0]),(255,255,255))
|
||||
y = np.flipud(h)
|
||||
|
@ -50,8 +50,11 @@ def main():
|
||||
cur_str_mode = str_modes.next()
|
||||
|
||||
def update(dummy=None):
|
||||
sz = cv.getTrackbarPos('op/size', 'morphology')
|
||||
iters = cv.getTrackbarPos('iters', 'morphology')
|
||||
try: # do not get trackbar position while trackbar is not created
|
||||
sz = cv.getTrackbarPos('op/size', 'morphology')
|
||||
iters = cv.getTrackbarPos('iters', 'morphology')
|
||||
except:
|
||||
return
|
||||
opers = cur_mode.split('/')
|
||||
if len(opers) > 1:
|
||||
sz = sz - 10
|
||||
|
Loading…
Reference in New Issue
Block a user