Posts Tagged ‘computer’

HyperlapseMB: Hyperlapse.js with Motion Blur

May 1, 2013

With the help of GSVPanoDepth.js (see previous post), I have created HyperlapseMB, a fork of Hyperlapse.js that uses the depth information to create a nice motion blur effect. The images are filtered as a pre-processing step before the hyperlapse is played. The algorithm is similar to the technique used as post-processing effect in video games as described in Rosado (2007). Altough the filtering is done before the hyperlapse is played, it is implemented in WebGL. In pure JavaScript, the filtering takes multiple seconds, nearly the same time the GPU needs for the whole sequence.

You can watch a demo (Firefox/Chrome) or get the source code. Enjoy!


Rosado (2007): Motion Blur as a Post-Processing Effect. In GPU Gems 3: Programming Techniques for High-Performance Graphics and General-Purpose Computation, edited by Hubert Nguyen.

Extract depth maps from Google Street View

May 1, 2013

Besides high-resolution images, Google Street View also provides a depth map for each panorama, containing the distance from the camera to the nearest surface at each pixel. As far as I know, there is no official documentation of the format, but there are some open source projects which contain code showing how to interpret the data. The depth information is stored in a slightly complicated way, probably to save bandwidth. Each pixel in a grid of 512×256 pixels references one of several planes. A plane is given by its normal vector and its distance to the camera. Therefore, in order to calculate the depth at a pixel, one has to determine the intersection point of a ray starting at the center of the camera and the plane corresponding to the pixel.

The geometry of the planes and the map containing the index of the plane at each pixel can be retrieved as Base64-encoded and zlib-compressed data by requesting the following URL:

I have written a small JavaScript library that fetches the data, decompresses it and computes a depth map from the planes. Here is an example:


As usual, you can find the code on my github page.

How to extract frames from videos

August 21, 2012

Using mplayer, frames can be extracted from videos by simply selecting jpeg (or some other image format) as output driver. If the video is interlaced, a deinterlacing filter like yadif can be used. However, in this case it is important to add the scale filter at the end of the list in order to convert to RGB colorspace after deinterlacing.

The complete command looks as follows:

mplayer -vf yadif=1,scale -vo jpeg:quality=95 -nosound file.mpg

IgorPlug-USB and Windows 7 x64

July 21, 2012

Do you know IgorPlug? Back in the old days when computers had RS-232 ports, this was a nice and cheap solution to control the OS and other software with an arbitrary infrared remote control. However, today most PCs do not have these connectors anymore. Fortunately, there is IgorPlug-USB, an IR receiver for USB ports. It uses an 8-bit AVR microcontroller and implements all necessary USB commands in software, as this microcontroller does not support USB natively. In comparison with the RS-232 solution, device drivers are needed in order to communicate with the IgorPlug-USB. Currently, I am using Windows 10 x64, and unfortunately, the original driver that came with IgorPlug-USB does not work with the 64-bit edition of Windows. There are other drivers (this one for example), but they never worked reliably for me. So, I decided to write my own “driver” based on libusb. It is not really a driver, because all the kernel-related stuff is handled by libusb. Therefore, it is very easy to implement and as this comes with a valid digital signature, it can be used without disabling signature checks etc.

The “driver” is designed as a replacement for IgorUSB.dll, so it can be integrated into any software that supports the original driver, e.g., EventGhost (or, maybe, Girder, but I have never tested it). In order to use it, you have to perform the following steps:

  1. Download Windows binaries for libusb and install one of the recommended drivers as described in their wiki. I use the WinUSB driver, as it comes with Windows and can be installed directly from the device manager (choose Browse my computer/Let me pick from a list of device drivers/WinUsb device)
  2. Download the new IgorUSB.dll that is used by EventGhost to communicate with the device through libusb.
  3. Copy IgorUSB.dll to the installation folder of EventGhost.
  4. Run EventGhost and enjoy!

If you are interested, you can grab the source code and experiment with it. For now, only receiving of IR commands is supported, other functions like setting LEDs are not implemented.

Update 2014-05-24

Thanks to Serge, I could fix some bugs and make a new release that should improve compatiblity with the original IgorUSB.dll. I changed the links in this post to point to the new version. Unfortunately, the IR codes reported to EventGhost have changed, so old configuration files won’t work anymore. If you want the old buggy version, you can download it below.

Update 2016-10-12
Some people report that the DLL does not work on Windows 10. Unfortunately, libusb-win32 is no longer maintained and is lacking Windows 10 support. I switched to another library called libusb. This slightly changes the installation procedure, because it needs another filter driver. Uninstall the device in the device manager and follow the instructions above to install the new version.

Version History