A while back a friend of mine asked me to help him build an app that used computer vision to detect things like traffic lights & road signs. The idea was to use his Raspberry Pi and Pi Cam as a dashcam in his car. He wanted it to identify traffic lights that were red and play some sort of sound letting him know the light was red and that he needed to stop. Once the light turned green, it would play another sound letting him know that he could proceed. He also wanted to have the app do several other things, all of which were based off of color. Normally I would recommend using something such as a Haar classifier or dedicated algorithm for detecting such objects. But, I also wanted to see for myself whether it would be possible to detect objects based entirely on their color. The results were actually very good and the speed of the app outperformed some of the best algorithms available.
In order for me to know the RGB values of the objects he wanted to detect, I wrote a simple tool that uses Python and OpenCV to filter out all colors except the colors I am interested in, leaving me with the RGB values I needed to plug into the app. Now, I know that there are plenty of tools out there that can be used to identify RGB values of objects in images. But, being the geek that I am, I opted to write my own tool. Plus, this was just another opportunity for me to do some work with computer vision. Since I enjoyed playing around with this tool and found it helpful for my friend’s dashcam project, I thought I would share the app in case anyone else might also find it useful / fun.
In my last 2 articles, I have shared with you code from my home automation system (HAS) controller written in Python that allows you to access your Google Calendar for scheduling events and communicating with the Insteon PowerLinc USB modem for controlling your Insteon and X10 HAS devices from Raspberry Pi (or other dedicated computer).
In today’s article, I want to share with you some Python code that uses OpenCV to detect faces from the Insteon (or FOSCAM) IP Camera which you can get from SmartHome.com for about $79. At my house, I use this code to detect when my fiancee or I approach one of the exterior doors. When we do, my HAS will recognize us and will automagically unlock the door that we are approaching. To do that, I am using the MiLocks 3-in-1 deadbolt system which is also available at SmartHome.com and will run you about $100 per lock. You will also need the MorningLinc Insteon adapter which will allow you to communicate with the MiLocks deadbolts over RF. These are also available from SmartHome.com and will run you about $50. You will only need 1 which is capable of controlling multiple locks.
Before I share the code, I should say that this particular code does NOT include the ability to recognize one person from another like that found in my personal HAS controller. All this code is capable of doing is detecting a face and saving a screenshot of that face to the file system (regardless who the face belongs to). The reason I am not sharing the face matching code yet is because there are a lot of complex steps required to train the system to detect individuals. I am currently working on a way to simplify these tasks. It took me several weeks to prepare the system manually for recognizing my fiancee and I with an acceptable accuracy and to not unlock our doors due to any false positives. Once I get this process simplified, I will share the code.
Ever since receiving my new Google Glass a few weeks ago, my inbox has been flooded from people asking if I have built any computer vision apps yet for Glass. The answer to those questions is “yes” and I plan on posting some articles and videos about them very soon. Until then, I thought it would be a good idea to post some articles showing how to get started with computer vision development on Google Glass using OpenCV for Android. Since there are several steps involved with building useful computer vision apps for Glass, I will be breaking up the steps involved into multiple articles. In this article, I will walk you thru the steps required to get your first OpenCV app installed and running on your Glass. While I’m at it, I will also show you how to install and run a simple face detection app. In a future article, I will show you how to do more such as applying filters and even a little bit of augmented reality.
I’ve been doing a lot of work with the Raspberry Pi lately with what little free time I’ve had and one of the things I’ve been working with the most is computer vision. Since computer vision is my passion and the Raspberry Pi has so much potential, I wanted to push it to its limits by seeing if I can run some of the same computer vision apps on my Raspberry Pi as I do on my full size laptop. Most of the computer vision applications I’ve worked on recently are all written in C++ and consist of proprietary code. However, I still love using other computer vision libraries and OpenCV is still at the top of that list. Even though I sometimes write OpenCV applications in C++ or Java which I can also do on the Raspberry Pi, I really like the fact that the Raspberry Pi is configured with Python right out-of-the-box. So, I want to take a few minutes to show all of you how to configure your RPi to work with OpenCV using Python. Let’s begin.
Recently, I came across a pretty cool little device called the “Cronus controller adapter“. Basically, it’s a USB dongle that can be plugged into your Xbox 360 or Playstation 3, allowing you to use any controller you want no matter what console it was originally designed for as long as it works over USB. For example, using the Cronus adapter, you can use your Xbox 360 controller on your Playstation 3, your Playstation 3 controller on your Xbox 360, or your mouse and keyboard on both. Since I (used to) do a lot of computer vision programming (and have been looking for an excuse to get back into it), I felt like this little device would be a great way for me to create some new computer vision applications. Since I’ve already written several computer vision apps that can detect and track objects, I would like to test my skills at automating some video games by using OpenCV for the processing. Since the Cronus controller adapter allows you to feed commands to your Xbox 360 and Playstation 3 from basically any other device, I think that the Cronus adapter will be a great way for me to send commands to my Xbox 360 based on objects detected and tracked by OpenCV using my computer.