From 354e33141dddfb6e39e9a86ef669fc5a7fb75da1 Mon Sep 17 00:00:00 2001 From: Alisher Berdibekov <71194270+PreacherBaby@users.noreply.github.com> Date: Mon, 4 Jan 2021 03:52:07 +0600 Subject: [PATCH] Update bayes.py LINE #234 - fixed "TypeError: only integer scalar arrays can be converted to a scalar index" in line #234 which caused the program to crash and preventing it from drawing the circle when the sailor coordinates are retrieved. --- Chapter_1/bayes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter_1/bayes.py b/Chapter_1/bayes.py index 7c93f14..861b8b8 100644 --- a/Chapter_1/bayes.py +++ b/Chapter_1/bayes.py @@ -231,7 +231,7 @@ def main(): print("P1 = {:.3f}, P2 = {:.3f}, P3 = {:.3f}" .format(app.p1, app.p2, app.p3)) else: - cv.circle(app.img, (sailor_x, sailor_y), 3, (255, 0, 0), -1) + cv.circle(app.img, (sailor_x.item(0), sailor_y.item(0)), 3, (255, 0, 0), -1) cv.imshow('Search Area', app.img) cv.waitKey(1500) main()