Update calcBackProject_Demo1.py

To round a ndarray it's necessary to use np.round() instead to Built-in Python round()
This commit is contained in:
Vahid Nikoofard 2020-04-14 00:23:53 -03:00 committed by GitHub
parent 675342ecd9
commit 575a609b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ def Hist_and_Backproj(val):
histImg = np.zeros((h, w, 3), dtype=np.uint8)
for i in range(bins):
cv.rectangle(histImg, (i*bin_w, h), ( (i+1)*bin_w, h - int(round( hist[i]*h/255.0 )) ), (0, 0, 255), cv.FILLED)
cv.rectangle(histImg, (i*bin_w, h), ( (i+1)*bin_w, h - int(np.round( hist[i]*h/255.0 )) ), (0, 0, 255), cv.FILLED)
cv.imshow('Histogram', histImg)
## [Draw the histogram]