{"id":1435,"date":"2018-08-13T18:12:49","date_gmt":"2018-08-13T22:12:49","guid":{"rendered":"http:\/\/matthannan.net\/blog\/?p=1435"},"modified":"2018-08-13T18:42:16","modified_gmt":"2018-08-13T22:42:16","slug":"making-the-computer-see","status":"publish","type":"post","link":"https:\/\/matthannan.net\/blog\/making-the-computer-see\/","title":{"rendered":"Making the computer &#8220;see&#8221;."},"content":{"rendered":"<p>I am currently down the <a href=\"https:\/\/opencv.org\/\" target=\"_blank\" rel=\"noopener\">OpenCV<\/a> rabbit hole.<br \/>\nI want to velcro a Rasp Pi to my oil tank and have it &#8220;see&#8221; how much oil is in there.<br \/>\nI don&#8217;t want to see a picture of the meter. That would be too easy.<br \/>\nI want something of an alpha-numeric representation, like &#8220;25% remaining&#8221; or &#8220;3\/4 full&#8221;.<br \/>\nSomething like that.<\/p>\n<p>First stab at making the computer see.<br \/>\n<a href=\"https:\/\/matthannan.net\/blog\/making-the-computer-see\/opencv\/\" rel=\"attachment wp-att-1436\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1436\" data-permalink=\"https:\/\/matthannan.net\/blog\/making-the-computer-see\/opencv\/\" data-orig-file=\"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/opencv.png?fit=762%2C539&amp;ssl=1\" data-orig-size=\"762,539\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"OpenCV\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/opencv.png?fit=640%2C453&amp;ssl=1\" class=\"alignleft size-medium wp-image-1436\" src=\"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/opencv.png?resize=300%2C212&#038;ssl=1\" alt=\"OpenCV\" width=\"300\" height=\"212\" srcset=\"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/opencv.png?resize=300%2C212&amp;ssl=1 300w, https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/opencv.png?w=762&amp;ssl=1 762w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>I need to take care of some pre-shoot clean-up of the scene, and may build a small, black background to fit around the meter. Last night, I was thinking about some kind of a mount.<\/p>\n<p>The Pi will also be equipped with a <a href=\"http:\/\/www.thirdeyevis.com\/pi-page-2.php\" target=\"_blank\" rel=\"noopener\">homemade LED light<\/a> that will come on a few seconds before the camera snaps the picture. This is easily done via the GPIO pins.<\/p>\n<p>And, while I am installing a computer in the basement, it might as well gather some <a href=\"https:\/\/learn.adafruit.com\/adafruit-sht31-d-temperature-and-humidity-sensor-breakout\/circuitpython\" target=\"_blank\" rel=\"noopener\">temp and humidity readings<\/a>, too. I&#8217;d like to rig the Pi to switch the dehumidifier electrical outlet on only when humidity gets too high. These stupid dehumidifier things just keep running the fans (burning electricity), even when the humidity gets down to the point you set the thing for. Not so sure I want to mess with relays in an electrical box, however, so I am keeping an eye open for an outlet thingy sort of like an X10.\u00a0<a href=\"https:\/\/i0.wp.com\/www.smarthome.com\/images\/Laddie24-1_big.jpg?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium\" src=\"https:\/\/i0.wp.com\/www.smarthome.com\/images\/Laddie24-1_big.jpg?resize=600%2C800&#038;ssl=1\" width=\"600\" height=\"800\" \/><\/a><\/p>\n<p>Oil level, temp and humidity data will be run back to a server of some sort. Hell, maybe this same box will be the web server!<\/p>\n<p>All of this is being written in Python, BTW.<\/p>\n<p>In order to learn all of this, I am making heavy use of the <a href=\"https:\/\/www.pyimagesearch.com\/\" target=\"_blank\" rel=\"noopener\">pyimagesearch<\/a> website. Thank you,\u00a0<a href=\"https:\/\/twitter.com\/PyImageSearch\" target=\"_blank\" rel=\"noopener\">Adrian<\/a>, for making this stuff approachable for old coots like me. Hey! He&#8217;s in CT!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am currently down the OpenCV rabbit hole. I want to velcro a Rasp Pi to my oil tank and have it &#8220;see&#8221; how much oil is in there. I don&#8217;t want to see a picture of the meter. That &hellip; <a href=\"https:\/\/matthannan.net\/blog\/making-the-computer-see\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[390,388,389,313,326],"class_list":["post-1435","post","type-post","status-publish","format-standard","hentry","category-geek","tag-coot","tag-opencv","tag-pyimagesearch","tag-python","tag-raspberrypi"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2NxlE-n9","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1481,"url":"https:\/\/matthannan.net\/blog\/raspberry-pi-poe-hat\/","url_meta":{"origin":1435,"position":0},"title":"Raspberry Pi POE HAT","author":"matthannan","date":"12 December 2018","format":false,"excerpt":"I am gearing up to return to this OpenCV project. Changing jobs and such do make hobbies a challenge. Looking at how to power the Pi once it is installed on the oil tank is causing me some headaches. I'd love to keep this thing running on WiFi and not\u2026","rel":"","context":"In &quot;Geek&quot;","block_context":{"text":"Geek","link":"https:\/\/matthannan.net\/blog\/category\/geek\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1430,"url":"https:\/\/matthannan.net\/blog\/installing-python-3-6-2-on-raspberry-pi-raspbian\/","url_meta":{"origin":1435,"position":1},"title":"Installing Python 3.6.2 on raspberry pi (raspbian)","author":"matthannan","date":"11 August 2018","format":false,"excerpt":"I want to update to the latest version of Python 3.6.6 on my Raspberry Pi 3B. I do not want my first go with 3.7 to be on a Pi! This Pi will be used in the basement as part of an OpenCV project. Replace 3.6.2 with 3.6.6 and you\u2026","rel":"","context":"In &quot;Geek&quot;","block_context":{"text":"Geek","link":"https:\/\/matthannan.net\/blog\/category\/geek\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1814,"url":"https:\/\/matthannan.net\/blog\/build-a-raspberry-pi-webcam-server-in-minutes\/","url_meta":{"origin":1435,"position":2},"title":"Build a Raspberry Pi Webcam Server in Minutes","author":"matthannan","date":"9 May 2020","format":false,"excerpt":"I have this up and running with the official Pi NoIR v2.1 camera module. I purchased it from these guys, as Bezos has enough money already. This camera will soon be moved to the basement Pi to try and revive the OpenCV oil tank monitor project. That will free up\u2026","rel":"","context":"In &quot;Geek&quot;","block_context":{"text":"Geek","link":"https:\/\/matthannan.net\/blog\/category\/geek\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2020\/05\/noIR.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2020\/05\/noIR.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2020\/05\/noIR.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1449,"url":"https:\/\/matthannan.net\/blog\/retropie-brain-transplant-and-a-new-home\/","url_meta":{"origin":1435,"position":3},"title":"RetroPie Brain Transplant and a New Home","author":"matthannan","date":"26 August 2018","format":false,"excerpt":"Xbox 360 controllers suddenly stopped working correctly on the new Pi3B+. Some quick Googling revealed this to be an on-going issue for the past few months that only just now filtered down to me. Performed a quick swap back to the Pi3B and everything is working fine. So, now the\u2026","rel":"","context":"In &quot;Geek&quot;","block_context":{"text":"Geek","link":"https:\/\/matthannan.net\/blog\/category\/geek\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/Group_Copy_5_1024x1024.png?fit=1023%2C678&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/Group_Copy_5_1024x1024.png?fit=1023%2C678&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/Group_Copy_5_1024x1024.png?fit=1023%2C678&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/matthannan.net\/blog\/wp-content\/uploads\/2018\/08\/Group_Copy_5_1024x1024.png?fit=1023%2C678&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1656,"url":"https:\/\/matthannan.net\/blog\/pi-hole-stuff\/","url_meta":{"origin":1435,"position":4},"title":"Pi-Hole Stuff","author":"matthannan","date":"29 September 2019","format":false,"excerpt":"I noticed that there were plenty of ads showing on my phone this morning, so I immediately started thinking that either the Pi-Hole Pi had an issue, or Pi-Hole itself was acting up. While reading the news, I saw that Pi-Hole is moving away from ad-block style filtering to straight\u2026","rel":"","context":"In &quot;Geek&quot;","block_context":{"text":"Geek","link":"https:\/\/matthannan.net\/blog\/category\/geek\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1195,"url":"https:\/\/matthannan.net\/blog\/what-more-to-do-with-a-raspberry-pi\/","url_meta":{"origin":1435,"position":5},"title":"What More to Do With a Raspberry Pi?","author":"matthannan","date":"14 November 2017","format":false,"excerpt":"I am so loving the Pi. As you may recall, I have Pi-Hole running on it, and also SoftEther VPN server. I noticed my co-worker attached earlier today. A few evenings ago, I was chatting with my wife's younger cousin about installing Linux on an old (PowerPC) Power Mac.[1.\u00a0This is\u2026","rel":"","context":"In &quot;Geek&quot;","block_context":{"text":"Geek","link":"https:\/\/matthannan.net\/blog\/category\/geek\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/posts\/1435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/comments?post=1435"}],"version-history":[{"count":6,"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/posts\/1435\/revisions"}],"predecessor-version":[{"id":1442,"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/posts\/1435\/revisions\/1442"}],"wp:attachment":[{"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/media?parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/categories?post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matthannan.net\/blog\/wp-json\/wp\/v2\/tags?post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}