One of the first projects I did when I got my Intel Edison in my third year of engineering, was to try and make a home security system. I had seen a lot of people make many varieties in this theme. You had your infra red tripwires, overhead PIR proximity sensors, all which did the job pretty well. What I found a bit lackluster was the actuation bit. An LED, a Buzzer or may be the odd LCD screen with "INTRUDER!" flashing in the ubiquitous black-over-green. Given that I had a lot more horsepower and connectivity options to work with, I tried to make it a bit more "integrated" with the world we live in today. Admittedly, when one builds a project, we don't see it adopted immediately into the desired ecosystem. There's a lot of work and modification involved. However, that doesn't concern makers, because we are pretty happy with prototypes.
To try and see if the prototype itself could work in the real world, I kept the sensing bit pretty standard, a light sensor to read spikes in ambient light. When it did, however, I decided to click a photo using an old Android phone via remote commands from the Edison, store the photo locally, and then upload it to the user's Twitter handle, which would actually alert the user of a break in, wherever he might be in the world.
At the time, I thought this was the pinnacle of awesomeness. And for a while it was. It's been a general observation in my local engineering colleges that anything with a display or anything that moves is considered a successful project. So having a computer automatically detect an intruder and upload the photo to your own Twitter handle became the apple of every teacher's eye. Needless to say, all my classmates hated me.
The process was quite simple. The Android Play Store houses an app called IPCam, which streams the phone's camera output to a local IP on your network. All you have to do is access that stream via Python and grab a snapshot. Once done, upload the snapshot to predefined Twitter handle.
However, it wasn't until I began working at my first internship that I realized that I had missed the true potential of this setup.
I worked at a company specializing in Image Processing and Embedded Systems for a year, during which time I learned how, with some effort, one can train a computer to intuitively understand what it is seeing through the camera lens. Computer Vision and Image Processing are essentially the back end of how our brains process images as well. (Neural Networks also play a big part here, but let's not get into specifics.) I realized that what I had at home was an ideal platform for some lightweight image processing as well, and how I had severely underutilized its potential in the Twitter project!
Image processing is rather elegant in its premise, and like most machine learning algorithms, is almost purely arithmetic. A big plus, because then the intuition behind it is much easier to understand. Border detection, histograms and motion sensing. Although these may sound like complex concepts, break them down to their mathematical roots, and all of them are ridiculously simple.
I plan on making this kind of a rolling blog to document my experiments in image processing. Intermediate proficiency in Python, a few packages, namely OpenCV and Numpy or Pandas, and, if you're planning on integrating that into IoT, maybe urllib or sockets is all you need. Experimenting with Numpy will be a treat. Analyzing pixel values individually may be very slow, but I'm not looking for lightning fast responses. Yet.
Top Comments