Sunday, 29 December 2013

OpenCVKinect: Acquiring Kinect Data Streams in OpenCV

Click here to go to code download step directly
_______________________________________________________________________________________________

Edit (26/05/2016) : I have updated the OpenCVKinect to fix some bugs and make use of different visualization for depth maps. Details of this newer version can be seen here. All other details mentioned in this blog post still apply to the updated version.
_______________________________________________________________________________________________

Holiday season is here, and I have finally found sometime to write something for this blog. Sometime back I wrote a guide for compiling OpenCV with OpenNI support. Since that post a lot has been changed in the newer OpenNI 2.x SDK, there has been a lot of improvements for using Microsoft Kinect Sensor. One of the major change is the Object Oriented Implementation as opposed to pure C implementation in previous OpenNI 1.x versions. I have had many requests asking me to write a tutorial for compiling OpenCV with the new OpenNI 2.x support. Although this is not possible with the current SDK and OpenCV, this blog post introduces an implementation for acquiring Kinect Data Streams in OpenCV.

After a long time, I recently started working with Kinect Sensor again, and therefore I wanted to access the data streams in a more efficient manner. While it looked straightforward to use the built in function calls in OpenNI 2.x, I was more comfortable with using OpenCV format instead. Therefore I wanted to hide all that detail of OpenNI Objects and their methods in a simple and convenient way. To achieve this, I wrote my own implementation and this blog post officially releases this code as open source, for anyone to use/modify/update to. Right now I have some basic methods, but in future I am thinking of adding simple image processing/data recording methods too (to make it easier for beginners).

Sunday, 15 December 2013

One Image hiding over eight thousand different stories...


Working with large datasets has its own pros and cons. Whatever the implementation or field might be, there is always a need for training a machine learning algorithm to recognize the pattern in that data. We often discuss this "Pattern" in many different instants and a big chunk of literature addresses this recognition problem. However it is often not considered important to get to know how this pattern looks like? why is it even called "Pattern" in the first place??

Interestingly the answer lies in the above image which shows a collection of 8000 different samples, arranged in columns. Here the first thing to notice is that there actually is a repeating pattern in the data. This is the exact pattern which we are trying to learn. It may not make sense when looking at it, however with correct label representation, each sample can be used to build a model which is able to identify each class with high accuracy.

Tuesday, 10 December 2013

Implementing SnakesGame using OpenCV


A long time back I used to have a nokia phone which came with this awesome and simple game. I still love nokia phones for this, and have a couple of phones just to play it (no kidding, haha). A while back I decided that I will write my own snakes game implementation, so I did. What is interesting about this post is that I did not use any graphics engine or OpenGL rendering at all. Instead this whole game was implemented using OpenCV function calls, enabling me to make my own rendering funcitons and display buffers.

Friday, 6 December 2013

Google's Christmas surprise....!!

I have an android phone which automatically syncs all the photos I take to Google+ Photos.

So today we had our own christmas tree in Uni, and I took a picture to post on instagram.

After a while I checked to see that google's auto awesome feature has made a very cool christmasy effect to make the picture come alive.


What a nice surprise, interesting how google is using different image processing algorithms.

Feels like its holiday season already!!