Pages

Sunday, 20 December 2015

Long Exposure Shots with a GoPro and Matlab

I recently got  a GoPro. You know to get cool selfies, videos and all :D I am very much impressed by all the cool things you can do with it but was specifically impressed by the fact that one can create a time lapse video.

After giving a couple of tries to time lapse videos, I wanted to go beyond. I had always seen photographers make a long exposure shots by using specific DSLR cameras. I wanted to create just that using the only camera I had, a GoPro. However I had something much more than the camera, I knew how to write a code that deals with a number of images (I am a Computer Vision Engineer).

Sunday, 25 October 2015

FFMPEG: Convert an image sequence to a compressed video

Just putting this here for my future self and anyone out there who might need to converts an image sequence into a video.

I have been using the following code to generate compressed videos from a big image sequence. It seems to have a really good balance between quality and compression.
ffmpeg -r 30 -f image2 -i out_%05d.png -vcodec libx264 -crf 25  test.mp4

Source:
http://hamelot.co.uk/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video/ 

Wednesday, 7 October 2015

Different types of Randomness..

Randomness is an integral part of a number of programming algorithms. In fact most of my research until now has been based on a computer algorithm that only uses random numbers for learning a specific task.

A while back I was trying to write some code to define and visualize different Random number generation models. For this task I was playing with a number of different algorithms and visualizing the output on a (kind of a ) probability map. [Not to mention that I use OpenCV for this project as well].

Some of these maps looked pretty cool, so I am just embedding them in this post - also if anyone is interested I have shared the link to this project at the bottom of this post, check that and modify --> make your own random distributions :D

So the input to each of my functions is a Uniform Distribution which looks like this:
A 2D Uniform Distribution

Tuesday, 21 July 2015

"Welcome to the Virtual World...may I take your username?"

Quick note: I wrote this a long time back, but never published - thought it wasn't good enough. This just occurred to me --> it's just a post - doesnt need to be perfect right?!? So posting this now - Please be sure to leave a comment with what you think!



Over the last few years, there have been some amazing advancements in gadgets - specifically the new imaging devices have emerged and a new horizon for virtual reality has been set. These devices have opened up a door for limitless future development possibilities. "Occulus Rift", the virtual reality head-mounted device that was received with overwhelming Kickstarter response, has been the pioneer in developing the key tech that can realise the virtual reality. The reason behind this huge success is an amazing idea which transfers all your senses into a digitally created world. Although this concept has been recently recognised, the idea has been around for decades.

Sunday, 24 May 2015

What if I told you, you can use OpenCV code with Matlab mex!!



Matlab is probably one of the best tools for quickly prototyping and testing your research ideas. As quick and flexible it is, sometimes Matlab code can consume a lot of execution time. This is specifically a big hurdle when multiple experiments need to be run. A real-time execution alternative is to implement Matlab compatible C++ code and compile it with mex-compiler. While this works most of the time, it is well known that quickly implementing ideas in C++ is not possible.

Wednesday, 13 May 2015

What inspires me?

Admit it or not but everyone needs a little motivation or inspiration now and then. I myself have been heavily inspired, motivated and influenced by a number of things. While I do believe that I cannot write every single thing down in this post, what I can do instead is to share with everyone some of the videos/talks that have had impact on me and have made me self reflect and think about a number of things that are wrong/right or maybe discussions that do not have any conclusion at all.


Monday, 16 March 2015

Executing Matlab scripts on different Operating Systems

Just a quick post about making matlab scripts run on different OS.

Writing a matlab code that works on both Windows and Linux is a little challenging, especially when accessing the disk both OS use a slightly different syntax for filesystem.

One solution to this is using computer string to check the OS. Once checked you can use if condition statements to execute relevant code on each system.

The script for this is pretty straight forward and is listed below:

%compile everything
if strcmpi(computer,'PCWIN') |strcmpi(computer,'PCWIN64')
   compile_windows
else
   compile_linux
end



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.