MATLAB Examples

Animating Radiohead's House of Cards Data


Radiohead just released a new video for its song "House of Cards" from the album "In Rainbows". No cameras or lights were used. Instead two technologies were used to capture 3D images: Geometric Informatics and Velodyne LIDAR. Geometric Informatics scanning systems produce structured light to capture 3D images at close proximity, while a Velodyne Lidar system that uses multiple lasers is used to capture large environments such as landscapes. In this video, 64 lasers rotating and shooting in a 360 degree radius 900 times per minute produced all the exterior scenes.

Embracing the remix culture, they released some of the raw data as a download on Google Code and encouraged people to submit their own remixes to the House of Cards YouTube group.


Load the Data

This assumes you've downloaded the ZIP-files from Google Code, uncompressed them, and put the CSV-files in a subdirectory called 'data'.

if exist('radiohead.mat','file')
    load radiohead frames
    nFrames = numel(frames);
    nFrames = 2101;
    frames = cell(nFrames,1);
    for i = 1:nFrames
        fid = fopen(sprintf('data/%.0f.csv',i));
        frames(i) = textscan(fid,'%f%f%f%f','Delimiter',',','CollectOutput',1);
    save radiohead frames

Create the Animation

Here we create a patch object, hiding the surface itself and using putting a marker wherever there's a data point. If you take out the three lines creating the AVI-file, it will play back at almost real-time.

% Setup the figure.
clf reset

% Setup the axes.
axis vis3d ij off
set(gca,'XLim',[-100 250],'YLim',[0 300],'ZLim',[-200 50])

% Create the patch.
p = patch( ...
    'Marker','.','MarkerSize',20, ...

% Animate the patch.
mov = avifile('radiohead.avi','quality',100,'FPS',30);
dtheta = 0;
dphi = 0;
for i = 1:nFrames
    thresh = frames{i}(:,4) > 25;
    X = frames{i}(thresh,1);
    Y = frames{i}(thresh,2);
    Z = frames{i}(thresh,3);
    C = frames{i}(thresh,4);
    dtheta = dtheta + randn/20;
    dphi = dphi + randn/200;
    mov = addframe(mov,getframe(gcf));
mov = close(mov);


I like the painterly effect that comes from using big dots of different colors to draw the face.

I added the title and music in Movie Maker and uploaded it to YouTube: