MATLAB Examples

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.

## Contents

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); else 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); fclose(fid); end save radiohead frames end ```

## 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 set(gcf,'Color','black','Renderer','opengl') colormap(pink(256)) % Setup the axes. axis vis3d ij off set(gca,'XLim',[-100 250],'YLim',[0 300],'ZLim',[-200 50]) view(2) camzoom(1.5) % Create the patch. p = patch( ... 'Marker','.','MarkerSize',20, ... 'EdgeColor','none','FaceColor','none','MarkerEdgeColor','flat'); % 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); set(p,'XData',X,'YData',Y,'ZData',Z,'CData',C) dtheta = dtheta + randn/20; dphi = dphi + randn/200; camorbit(dtheta,dphi,'Data','y') drawnow mov = addframe(mov,getframe(gcf)); end mov = close(mov); ```

## Results

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