Skip to content

Commit

Permalink
fix samples
Browse files Browse the repository at this point in the history
  • Loading branch information
APrigarina committed Jul 1, 2021
1 parent 8fad85e commit 0f24d4d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samples/python/gaussian_mix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/python/hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions samples/python/morphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f24d4d

Please sign in to comment.