-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter_1\bayes.py #1
Comments
Hi Royml, I'm unable to reproduce the error on Windows or macOS. Try turning the sailor coordinates into a tuple: cv.circle(app.img, ((sailor_x, sailor_y)), 3, (255, 0, 0), -1). If this doesn't help, try running the bayes.py code downloaded from github. This ran okay for me. Let me know how it goes. |
Hi, the tupl(ing) didn't fix it, but I did manage to resolve with int() on the sailor_x and sailor_y. It could be a python version issue, mine is 3.8.5 |
Okay. I'm in the process of transferring to a new computer and installing Anaconda with the latest version of Python. I'll revisit this when I have everything up and running in the next week or so. Thanks. |
Could you also let me know which version of OpenCV you are using? Thanks. |
cv.circle(app.img, (sailor_x.item(0), sailor_y.item(0)), 3, (255, 0, 0), -1) # Returns a standard Python scalar and should fix the problem. Alternatively, using sailor_x[0] and sailor_y[0] should also work. A better solution would be changing lines 90 & 91 to the following: This returns an integer directly so no need to jump through hoops. Thanks to Alexander Valarus for pointing this out. |
getting the sailor position to show I also had to destroyAlllWindows after the imshow to get the draw_map to work twice |
Hmmm. A few questions: |
I ran your code again, it works fine.
I’ll there must have been an erro between the chair and the key board
Thanks again
…Sent from my iPhone
On Jan 16, 2021, at 1:11 PM, rlvaugh ***@***.***> wrote:
Hmmm. A few questions:
-What OS are you using?
-Are you launching the program from a terminal/powershell or from your IDE?
-Are you running the bayes.py I supplied on github? This has been tested on multiple systems.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
That's good news! It's easy to mistype something going from the book to the keyboard. If you run the supplied code and it works differently, you can compare your code to mine using online comparison tools or by pasting the code into two different Microsoft Word docs and then using the compare feature under the Review tab. This will highlight any changes, making them easy to find. |
Thanks for the tip!
On Sat, Jan 16, 2021 at 5:13 PM rlvaugh ***@***.***> wrote:
That's good news! It's easy to mistype something going from the book to
the keyboard. If you run the supplied code and it works differently, you
can compare your code to mine using online comparison tools or by pasting
the code into two different Microsoft Word docs and then using the compare
feature under the Review tab. This will highlight any changes, making them
easy to find.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANARLRJDAYBWXPX34CQI3OLS2I2VLANCNFSM4VQ3I2CQ>
.
I’m still flummoxed by the gensim import
Have asked pyCharm for their advice. I had just updated pyCharm when the
imports started to have problems
--
Regards,
Doug Brown
|
Chapter_1\bayes.py", line 234, in main
cv.circle(app.img, (sailor_x, sailor_y), 3, (255, 0, 0), -1)
TypeError: only integer scalar arrays can be converted to a scalar index
The text was updated successfully, but these errors were encountered: