Showing posts with label demo. Show all posts
Showing posts with label demo. Show all posts
Tuesday, 20 September 2016
Monday, 28 March 2016
Designing an algorithm - from ideas to code
I had always been interested in solving sudoku puzzles, partly because there are too many combinations that make each Sudoku unique. Since my work involves writing and using programming in different scenarios, I thought why not try using my skills on Sudoku. So there I was on a London Underground train to Barbican - looking at a Sudoku puzzle at the back of a morning newspaper, wondering how I can write an algorithm to solve it. I figured out a few simple tricks that I have always used in algorithm design. Here I explain what thoughts I had while designing my very own Sudoku solver and how I transformed those ideas into a working prototype.
First of all lets have a look at a typical Sudoku puzzle and some basic rules:
![]() |
Sudoku Puzzle |
Yes - it has got everything to do with numbers!! lots of numbers!
A Sudoku puzzle typically has 81 boxes where each box can have a number between 1 to 9. However, all these boxes follow some rules that make it all interesting. You may have noticed 3x3 squares grouping the number boxes. A correct solution of Sudoku ensures no repetition of numbers from 1 to 9 inside each of the 3x3 squares, in each horizontal line and each vertical line. When solving a Sudoku puzzle, this is exactly where I look for a solution, and exactly where my thought process starts for my Sudoku solver algorithm.
Labels:
algorithms,
application,
code,
demo,
matlab,
puzzle,
skill,
Tutorial
Sunday, 15 March 2015
Estimating Pi with OpenCV
Yesterday was Pi day where the date and time specifically corresponded to the value of Pi, i.e. 3/14/15 9:26 <===> 3.1415926 . What made this day extraordinary was how different ideas and videos came out, some explaining its significance while others showing fun ways to estimate its value.
One such video caught my eye in which @thephysicsgirl and @veritasium calculated the value of Pi using Monte Carlo sampling method but with a fun twist. Instead of using random particles they decided to use random darts and a modified dart board. They explain the idea in a very simple and intuitive way in the video.
Friday, 26 September 2014
Gif animation using ImageMagick Command-Line
I have used GIFs in a number of presentations I have done and they are very useful if, like me, you are working with images/data which changes over time. Luckily I have found a very easy method of converting an image sequences into a GIF.
All you need is a working installation of ImageMagick.
Labels:
application,
demo,
Simple Tweaks,
Tutorial,
Windows
Tuesday, 18 February 2014
Creating "Mood lights" animation with OpenCV
The other day I went on a typical London walk near Thames, and as always loved the lights, reflections and the view. It was amazing! One thing I really liked was the RGB mood lights on the bridge that transformed from every possible color in a way that it made the whole experience amazing!! Here is a glimpse from my instagram.
Since there was a sequence of colors involved, I thought I would at least try to replicate these mood lights using OpenCV. Turns out its not very difficult to make this animation at all. I wrote an algorithm for doing this using some clever tricks that did make it simple and interesting. Here is a gif showing how cool the animation looks when you execute the code.
Labels:
algorithms,
application,
Computer Vision,
demo,
Graphics,
random,
Windows
Wednesday, 5 February 2014
Algorithm to check Sudoku puzzle!
I have got a couple of interviews this week, which I love preparing for as it a good way to refresh my C++ and at the same time, I get to implement some pretty interesting algorithms.
As most of us would do, I have been searching for the past few days about frequently asked interview questions and have been trying to solve most of the algorithm design questions myself. This post is about an interview question asked by google interviewers for an internship position. The question is about checking if a Sudoku Solution is correct or not.
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).
_______________________________________________________________________________________________
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.
_______________________________________________________________________________________________
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).
Labels:
code,
Computer Vision,
demo,
Kinect,
Open Source,
OpenCV,
OpenNI
Tuesday, 8 October 2013
Mind == Blown!
So sometime back I saw this video presentation of a new and, what I like to call it, novel method for extracting 3D structures from a single image. Part of the reason why this blows my mind, is that this approach is well defined for a specific scenario and it utilizes the best of both human brain and computer's processing power.
We have a great sense of depth perception of objects. Our brains are well trained to construct an object's three dimensional model, by just looking at pictures. This, however, is a trivial and a highly challenging task for computer algorithms. On the other hand, computers are capable of computing and interpolating data at a much faster rate than humans, given that the task is simple and fairly straightforward.
Tuesday, 10 September 2013
Computer Vision is everywhere...
As most of the android developers, I am a big fan of google nexus tablets and smartphones. Have been using a google nexus 4 for a while now and I am impressed by all kinds of cool stuff you can do with it. A number of cool applications are based on different computer vision techniques. In this post I will be discussing these applications.
To list just a few obvious ones, the android based smartphones have face recognition based unlocking, camera app which can pick up faces, creating panoramas, editing photos and using readings from a number of inertial sensors to stitch multiple picture into one 3D picture called Photo Sphere.
Monday, 6 August 2012
Just a tip of the Iceberg..
I have been working for a while on my dissertation. The main aim of this project is to build a gesture recognition system which is both reliable and robust; to the extent that it can replace the already existing human computer interaction (HCI) techniques. Despite the idea being clear, I have been asked a lot of questions about the project.
Right now I am still in the final stages to finish the approach I have planned to use. However to answer some of these questions, I have uploaded a video which shows an implementation of similar gesture recognition technique I did in the start of this project.
Here is a short demo video:
This was not very reliable or robust technique. However I learned a lot of vital information while implementing this. The idea behind this is still at the base of a very complex dynamic hand gesture recognition system I am currently working on.
Will be uploading more information soon..
Right now I am still in the final stages to finish the approach I have planned to use. However to answer some of these questions, I have uploaded a video which shows an implementation of similar gesture recognition technique I did in the start of this project.
Here is a short demo video:
This was not very reliable or robust technique. However I learned a lot of vital information while implementing this. The idea behind this is still at the base of a very complex dynamic hand gesture recognition system I am currently working on.
Will be uploading more information soon..
Friday, 20 July 2012
Congestion? Not a problem!
This post is about another course project which I did for my Master's degree in Computer Vision Engineering. It's as simple and innovative as it could get. The idea is to estimate the flow of traffic in real-time using the CCTV video. Four categories of congestion/flow are first categorized, which are Low, Medium, Medium-High and High Congestion.
Here is a short demo video for this project:
While implementing this, the most difficult part was to distinguish between Medium-High and High Congestion, as both types of congestion have data which overlaps and is difficult to model with a machine learning algorithm such as K-means Clustering.
Here is a short demo video for this project:
While implementing this, the most difficult part was to distinguish between Medium-High and High Congestion, as both types of congestion have data which overlaps and is difficult to model with a machine learning algorithm such as K-means Clustering.
Labels:
Computer Vision,
demo,
OpenCV,
Real-time
Wednesday, 25 January 2012
GSVI v2.0 real-time
After having finished the prototype guidance system earlier, an idea struck into my mind to make it real-time. Since everything was implemented in matlab (for the prototype) and because matlab is not good for real-time systems, I had to implement everything again (well sort of) in C++. I love working with OpenCV so there I began, doing all the stuff again in C++ using OpenCV library.
After much work, and tunning it with different algo's, i finally had it up and running. However, now came the main problem of testing this system in a real envoirnment, and since I have implmented everything on my desktop, it was impossible to take the desktop in a real path. So I took my camera and shot a small clip simulating a blind person walking, and deviading in both left and right directions slightly and then coming back to straight path.
I opened up this video using OpenCV and simply ran my code, the output was really impressive. This was the first time my system was working in a real world scenario, without controlled conditions.
Here is the output from the actual code:
Here is the output from the actual code:
Sunday, 14 August 2011
Vision for those who can't see
Following the simple line followers, I did my final year project on something which was much more complex and interesting (atleast it was for me). So, our group developed a prototype Guidance System to help Visually Impaired persons with their daily life.
Basically the concept behind this project was to first limit ourselves to the simplest scenarios a visually impaired person could possibly be in, and then develop a prototype system. Once that system was developed, we moved on to the next level, and did further testing.
Basically the concept behind this project was to first limit ourselves to the simplest scenarios a visually impaired person could possibly be in, and then develop a prototype system. Once that system was developed, we moved on to the next level, and did further testing.
Saturday, 6 August 2011
The beginning
So that's where it all started. A few years back, when I was doing my bachelors degree, I started with my strong interests in robotics (not computer vision). Surprisingly, this field was very different from what I was actually studying at university level. I took up to the challenge and along with Telecommunication subjects, I was very keen at learning the basics of robotics. This was the first time I was building my very own robot, little did I know at that time that it was the very same robot which will lead me to a whole new different field of Computer Vision. A simple line follower named tracker was the turning point for my career.
Years later I did a Final Year Project titled "Guidance System for Visually Impaired using Digital Image Processing", which was basically a very complex line follower with no lines drawn at all. It used the natural surroundings and extracted 'useful lines' to compute the deviation and hence guiding a visually impaired person. Eventually I realized that my interests in the field of Computer Vision was way more than what I was studying.
Subscribe to:
Posts (Atom)