Posts

Fun With DTMF

Since this blog acts as a kind of documentation for the kinds of projects I've involved myself with, I thought, hey why don't I put up something that I worked on on the year of 2014. Something of a little throwback just in case someone stumbles across this blog. So, back then, this project was the first, in search of a better word, "big" project that I had done. In this particular project, I used a Atmega16 micro controller. To be more specific, I used a development board which I got from here . Now, with this I wanted a robot that could be controlled from a distance, like an RC car. But, in this case, I wanted the range of it  be the entire world. So, how did I do that? To understand that, let's start by asking what DTMF is. So, DTMF stands for Dual Tone Multi Frequency. Essentially, when you dial a number on your phone's keypad, each number produces a distinct touch tone. This touch tone, is essentially a combination of two sound waves; one of a higher a...

Picking Apart Colours

Image
Recently, I've been pretty busy with university classes and exams. To get my mind off the exams, I've made a simple program using OpenCV. If you've ever had an interest in digital images are made or photography in general, you might have heard about "pixels". In essence, every image that you see on a computer screen consists of small points of colors called "pixels". All of these small points of color, when viewed as a whole, make up an image. Well, without going too much into the details, these pixels are made up of three colors; red,green and blue. Generally, each color is made up using 8 bits of memory. So, effectively, you can set each color as a value between 0 and 255. Just think of every image as a combination of red, green and blue where the value from 0 to 255 represents how much of each color there is.Knowing this, I got to thinking that it would be pretty fun to to see EXACTLY how much of red, blue and green there is in a sample image. And...

Adding Noise To An Image With OpenCV

Image
As a fun little project, let's try and add a little noise to an image. In particular, let's try adding something called salt-and-pepper noise to an image. So what is salt and pepper noise?Basically, we take an image, select a random pixel and convert it to a black or white pixel. For example, the white grainy image shown to the right is a "noisy" version of the one above it. So, how did I do this? First, I took the dimensions of the sample image that I wished to process. Then, we can think of the entire image as a 2-D array and each pixel can be located using $(i,j)$, where $i$ = position along the row and $j$ = position along the column. For example, the third pixel from the left, two rows down, would be $(2,1)$. Great! Now we have a system for pointing to a particular pixel in the image. So how do we take a random pixel? Here’s the interesting thing. Suppose you take a constant $a$ and a variable number $b$. Then, suppose we did $b$%$a$($b$ modulo $a$). ...

Getting started with OpenCV

Image
To get things started, I've decided to document the process of  getting OpenCV to work on Linux. More specifically, to get it to work on Code::Blocks. To do this I began by downloading the 2.4.13 release of OpenCV from here . My choice of 2.4.13 was because following the procedures mentioned in this post with 3.1.0(the latest release at the time) returned some weird error when running 'make' from the terminal. After downloading the .tar file, I proceeded to unzip it by running the following in the terminal. unzip opencv-2.4.13.zip Then, I proceeded to make a build directory and opened the directory in the terminal as follows. cd opencv-2.4.13 mkdir build cd build At this point the terminal should look something like shown below. Now from here, we have to start configuring the cmake files. Generally, the configuration is done by running a command of the following format in the terminal.  cmake [optional parameters] <path to the OpenCV source directory> I...