From 575a609b80cd787c993c3608d0897c3e7aed567f Mon Sep 17 00:00:00 2001 From: Vahid Nikoofard Date: Tue, 14 Apr 2020 00:23:53 -0300 Subject: [PATCH] Update calcBackProject_Demo1.py To round a ndarray it's necessary to use np.round() instead to Built-in Python round() --- .../Histograms_Matching/back_projection/calcBackProject_Demo1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/python/tutorial_code/Histograms_Matching/back_projection/calcBackProject_Demo1.py b/samples/python/tutorial_code/Histograms_Matching/back_projection/calcBackProject_Demo1.py index eb0bdab..fc85aca 100644 --- a/samples/python/tutorial_code/Histograms_Matching/back_projection/calcBackProject_Demo1.py +++ b/samples/python/tutorial_code/Histograms_Matching/back_projection/calcBackProject_Demo1.py @@ -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] -- 2.7.4