Laser Pointer Tracking

Laser Pointer Tracking from Saulius Lukauskas on Vimeo.

Tracking a laser pointer is a tricky task.
The naive approach would be applying a fixed threshold on image and therefore finding all the brightest pixels, which, hopefully, are pixels of our laser pointer (or its trail). The number of false positives can also be reduced by including only those points that are red in colour (by applying a threshold on hue).

However, this approach is way too sensitive to ambient light conditions, as the threshold applied may work on one light conditions and completely fail on the other. Also, checking the points hue is completely useless in daylight as the camera simply sees the laser pointer as white dot instead red there.

A more sensible approach was introduced by Evgeny Popovich in the PresenterMouse. You can see it working in the video above.
Read more…

Filed under: Computer Vision, , , , , , ,

Processing and OpenCV on 64bit linux

!!! required library not found : /processing-1.0.9/libraries/OpenCV/library/libOpenCV.so: /processing/lib/processing-1.0.9/libraries/OpenCV/library/libOpenCV.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
Verify that the java.library.path property is correctly set and ‘libcxcore.so’, ‘libcv.so’, ‘libcvaux.so’, ‘libml.so’, and ‘libhighgui.so’ are placed (or linked) in one of your system shared libraries folder

Does this look familiar to you? The wrong ELF class: ELFCLASS32 error means that you’re trying to run a 32bit application on 64 bit machine. The solution is to recompile the libOpenCV.so library.
Read more…

Filed under: Computer Vision, , ,

Mendeley Desktop – A Must Have For Students

I have stumbled upon Mendeley Desktop, also known as “iTunes™ for research papers” in a students’ newspaper.

Though originally designed for researchers to help them discover new papers and stuff, and I am only an undergraduate, I found it very useful for me as well.

I do not do any research (yet), and I certainly don’t care about my references collection or whatever.

However, I care about quickly finding information in slides my lecturers give me. Read more…

Filed under: Studying, ,

Directory Traversal and NULL Byte Poisoning

if (isset($_GET['page']))
{
    include('page_'.$_GET['page'].'.php');
}

Nobody does it like this anymore, I thought at first. However, despite the fact that exploits to this exist more than 10 years, I’ve stumbled upon a kind of a huge website that used a very same code snippet in it yesterday.
The site’s developer may have thought that the worst that could happen is a “No such file or a directory” error, since only files with prefix “page_” and extension “.php” are allowed and there is not much space for attacker to improvize.
WRONG.
Read more…

Filed under: Computer Security, , , , ,

Movement Detection Using OpenCV

I am starting to like the Open Computer Vision Library (OpenCV). I have done some image processing with it for my art class (link) and I really enjoyed it. But when I tried to make some web cam application I realised that OpenCV fails to detect my web camera. After about 2 days spent installing/uninstalling various Microsoft SDK’s I found out that the problem may be somewhere in Visual Studio, because the program crashes only when I start it with debugging, and it works like a charm on ctrl+F5 – no debugging. I couldn’t find solution for this for now.

However, I have still managed to create a sample movement detection application with OpenCV. And this is how it looks:

Ain’t computer science fun? :)
Read more…

Filed under: Computer Vision, , , , ,

Color Randomization With Color Theory In Mind

Firstly, you may already know that every color may be encoded with three integers {red, green, blue}, for instance, red could be encoded as {255,0,0} or FF0000, if you prefer hex to dec. However, in this article I will consider color encoding in three double variables of interval [0;1], so red would be {1.0, 0.0, 0.0}.

so having something like:

struct colorRgb {
   double red, green, blue;
};

we can move further on this article.

The Obvious Approach

In order to generate random color many of you will come with something similar:

void randomize () {
   red = (rand() % 256) / 255.0;
   green = (rand() % 256) / 255.0;
   blue = (rand() % 256) / 255.0;
}

RGB Randomized Colors

RGB Randomized Colors


However, if you looked to the picture on your left, you would see that the colors, are, a bit too random, if you still want them to look good together. So the next question to be analyzed in the article is not exactly how to generate a random color (which seems easy), but how to generate colors that look good together.

In order to find solution to this we need to get acquainted with Color Theory basics.

Color Theory

A Color Wheel from easyrgb.com

A Color Wheel from easyrgb.com

The color theory puts all colors in a so-called color wheel and states that similar colors are near one to another on it. As you see, on your right, blues, reds, etc. are near one another.
According to easyrgb.com they’re within 30° radius one from another. So, in order to generate only similar colors, we need to stay in this radius. Sounds simple, but is it?

Read more…

Filed under: Graphics, , , , ,