{"id":488,"date":"2019-06-24T12:00:06","date_gmt":"2019-06-24T19:00:06","guid":{"rendered":"http:\/\/letsbuildroboticswithshadow8472.com\/?p=488"},"modified":"2019-06-23T23:58:06","modified_gmt":"2019-06-24T06:58:06","slug":"programming-a-pi-to-deter-cats-part-5","status":"publish","type":"post","link":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/2019\/06\/24\/programming-a-pi-to-deter-cats-part-5\/","title":{"rendered":"Programming a Pi to Deter Cats: Part 5"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Good Morning from my Robotics Lab! This is Shadow_8472, and I feel good about my progress this week. Let&#8217;s get Started!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Last week, I had successfully confirmed OpenCV was installed on my Raspberry Pi. The first thing to do this week was to start coding just as soon as I figure out a way to save a program file within the virtual environment, right?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Not quite. I thought a virtual environment was kind of like a virtual machine, where it has a whole little computer running within your computer, only with a few less restrictions. I still think that, but it turns out it works just fine if I run a file within the virtual environment from the Desktop or anywhere else.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I also learned exactly what a bash script is. So, I had OpenCV working in a script, and I changed permissions so I could run a .py file from the command line, but when i went to run it, I got an error about import not being supported. It turns out I forgot to run the Python interpreter with my program as an argument. That detail got me into the workshop I sometimes mention.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I actually got my base coding test harness from the YouTube Channel <a href=\"https:\/\/www.youtube.com\/channel\/UCWEHue8kksIaktO8KTTN_zg\">CodingEntrepreneurs<\/a>. (<a rel=\"noreferrer noopener\" aria-label=\"Link to their first OpenCV Python video (opens in a new tab)\" href=\"https:\/\/youtu.be\/YY9f-6u2Q_c\" target=\"_blank\">Link to their first OpenCV Python video<\/a>) While I was at the workshop, I learned a bunch of tangential stuff like when to pack your Python power cord, I polished off my knowledge on how to make sure a substitute power supply is acceptable, and when it&#8217;s a good idea to go back to the tutorial instead of arbitrarily placing a missing closing parenthesis. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the end, I feel like I had a very successful session, but since then I&#8217;ve been building a framework for my program as a whole. Hopefully, by next week, I will have a program that will look at a series of pictures, tell if the background in each of three zones (cupboard, counters, and cabinets) is occluded (blocked) by a moving object (a cat or human), and sound the alarm if it sees something in the counters&#8217; zone. As a bonus, it can save a picture of the culprit for if\/when I try my coding skills at training a neural net to tell if my cat is being naughty.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Final Question: When was the last time you caught yourself considering over complicating a plan? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good Morning from my Robotics Lab! This is Shadow_8472, and I feel good about my progress this week. Let&#8217;s get Started! Last week, I had successfully confirmed OpenCV was installed on my Raspberry Pi. The first thing to do this week was to start coding just as soon as I figure out a way to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/2019\/06\/24\/programming-a-pi-to-deter-cats-part-5\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Programming a Pi to Deter Cats: Part 5&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[9],"tags":[],"class_list":["post-488","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/comments?post=488"}],"version-history":[{"count":1,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/488\/revisions"}],"predecessor-version":[{"id":489,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/posts\/488\/revisions\/489"}],"wp:attachment":[{"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/categories?post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/letsbuildroboticswithshadow8472.com\/index.php\/wp-json\/wp\/v2\/tags?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}