Bullet Time Effect – Frozen Raspberry Pi

Some people said we were trying to build a Raspberry Pi time machine. In some ways they were right. Others compared it to the LHC at CERN and said we would warp time and space when they saw our pictures on Facebook https://www.facebook.com/raspberryPiFace. They were partly right too.

Raspberry Pi LHC

The Raspberry Pi Large Hadron Collider? It felt like we were building it.

And on the Friday night before the Jam it felt like we were building the LHC! With nearly half a kilometre of network cables, 48 Raspberry Pis fitted with cameras and PiFace Control and Displays we wondered if we’d finally been too ambitious with a project!

It started over 13 years ago watching when I saw the film The Matrix and a BBC documentary called Supernatural: The Unseen Powers of Animals. What linked the two programs was a camera effect where time would stop and the camera would move round the scene. I spent days trying to work out how the effect worked – I accepted that The Matrix used computer generated graphics, but surely the animals in a BBC natural history unit documentary had to be real? My faith in wildlife documentaries was reassured when I discovered a few years later how the effect was created.

The effect was called Bullet time, or Time-slice and consists of taking pictures from a long line of cameras at the same time, but playing them back one after another. Because all the frames are taken at exactly the same time, the action is frozen, but when the frames from cameras, each with a different view, are shown in order, it gives the effect of moving around a scene while time is frozen. On paper it seemed quite simple, to create a bullet time effect, you just needed a lot of cameras that would trigger in perfect sync. The camera rigs for TV and film are as impressive as the budgets, with tens of digital SLR cameras triggered by a slave cable. I could barely afford one DSLR camera, never mind twenty odd. Nor could I afford the tripods to mount them on! I thought my dreams of creating my own bullet time effect were simply unaffordable. That is, until I had an idea back in June this year.

Raspberry Pi Snap Camera

PiFace Snap-Camera turns the Pi into an easy to build simple digital camera

I’d been working on a PiFace interface so I could use my Raspberry Pi without a keyboard and monitor. For a bit of fun I wondered if I could turn it into a simple digital camera, that would take a picture when a button was pressed, and to my pleasant surprise, discovered you could. An idea was beginning to form in my head. If I wrote a bit more code, instead of pressing a button to take a picture, I could trigger it remotely over a network. Furthermore, it cost a lot less than any other digital camera. Could the Raspberry Pi really recreate a bullet time style effect?

I have various crazy ideas, but normally they subside after a few days, but this one wouldn’t. I decided to buy four Raspberry Pi cameras to see if I could trigger them all at once. I laser cut a frame to mount them and it appeared to work, but with four cameras I couldn’t really tell how good the effect was. I decided to buy another four cameras, with the justification that if it didn’t work I’d either sell the cameras or use them in workshops I did with young people. Eight cameras showed promise but nothing conclusive, there was only one way to find out.

MVI_7428

Sometimes you wonder if a project was a bit too ambitious

It’s a funny feeling carrying nearly 50 computers in a box barely big enough to hold a laptop. In contrast, after multiplying the original mounting frame by 12, I’d ended up with a 3m wide circle. This was when I first realised I was building something significant. After much plugging, wiring, mounting, and SD card package installing the rig was finally ready. It certainly looked impressive, particularly given it was wider than the office. As such, the first time we tried the full rig was the Manchester Raspberry Jam.

I’d mentioned to Ben Nuttall, general star, (soon to be working for the foundation) and organiser of the Manchester Raspberry Jam that I’d be bringing the Frozen Pi rig, but for some reason he didn’t automatically associate this with a 3m ring of 48 Raspberry Pis, half a kilometre of network cable, a few industrial network switches and enough power adapters to terrify most caretakers. We were generously squeezed into a corner of Madlab at the capacity jam.

A packed Manchester Raspberry Jam

A packed Manchester Raspberry Jam

Soon pictures of the rig were being posted on Facebook and Twitter, yet still we hadn’t actually tested the full rig. The first eager volunteer bravely strode into the circle. We pushed the button and the red camera lights came on in unison. A few moments later the first images had been collected over the network and were being stitched into a video. To everyone’s amazement, including mine, it actually worked! Raspberry Pi had frozen time, recreating a Hollywood effect for a fraction of the cost. You can see the results in the video above http://youtu.be/IqoA4HeBCQ4?t=2m19s

The setup wasn’t perfect – the floor in Madlab is characterful and the rig was a bit low, which meant sadly we chopped Liz Upton’s head off when she had a go. Despite this, we showed it was possible. We’d learned a few things along the way –booting and installing software on 48 Raspberry Pis needs a bit of work, and the PiFace Control and Display proved essential for debugging by showing what was going on, and allowing us to push switches to trigger actions and see status without plugging in a monitor.

_MG_7452

Our patented support system was perhaps a bit low

The navigation switch on PiFace Control and Display allows us to set the index of the camera in the rig, so it makes it easy to build the rig in different shapes.

The rig generated a lot of interest and hopefully, in line with the aims of the Raspberry Pi foundation, has inspired youngsters to code and shown the computers can be used creatively.  I could imagine an after-school club building their own rig with a class set of Raspberry Pi and cameras.

For those with just one Raspberry Pi, its still possible to play with time. Instead of freezing it with the bullet time effect it’s easy to speed it up with a time-lapse as shown in the previous blog post.

We’ve still got a few tweaks to make to it, but we’ve got loads of things plan to shoot with Frozen Pi. We’re looking for suggestions too! If you’ve got an idea, or want to see more videos get in touch via our Facebook page.

Tech Specs

For those of you interested in the gory techie details, here are the stats

  • 48 Raspberry Pi Model Bs
  • 48 Raspberry Pi Cameras
  • 48 PiFace Control and Display
  • 48 NOOBS SD cards
  • 48 5V PSU
  • About half a kilometre of network cable
  • 2 x 24 port switches
  • 1 wireless router
  • Custom laser cut frame
  • Enough extension cables plugged into a single socket to scare most caretakers
  • Python script listening to receive command to take picture (included in snap-camera package) https://github.com/piface/snap-camera
  • Python script to collect images over network and assemble frames in order

Timeslice is a trademark of Time-slice films and Bullet time is a trademark of Warner Bros.

Advertisements

Raspberry Pi Time-lapse – in the field!

Finding myself shivering in a field I wondered what else this credit card sized computer would be responsible for.

Image

I was testing my new time-lapse setup with Raspberry Pi, a camera and PiFace Control and Display. When I do talks to teachers about why they should use a Raspberry Pi I point out you can put it in places you couldn’t put a PC, and I was certainly following my own words as I trekked up a hill overlooking Manchester. I’d previously tried pre-programming a Raspberry Pi that I could leave on a hillside to take pictures, but found I needed to change settings in the field. Taking a keyboard and monitor out with me was impractical, and sometimes it was hard to know if the Pi had started taking pictures.

Youtube compression isn’t great and doesn’t do justice to how reasonable the Raspberry Pi camera is.

Using PiFace Control and Display I could easily set the time between pictures and how long the time-lapse should cover. This is useful as often before I start taking a time-lapse I don’t know how much I want to speed the action up by, or how long to keep taking pictures for until I’m ready to start taking them. The display shows when the camera has started and how much room there is left on the SD card. It makes it really easy to take time-laspse with the Raspberry Pi. So much so I think I’m addicted!

The software is really easy to install – just type

sudo apt-get update

sudo apt-get install python3-snap-camera

There’s a quick video walking though setting it up from scratch and showing another time-lapse in the city centre.

It’s opensource and available on github, so hopefully between us and the community we’ll get more settings for the camera added. We’re also wondering about re-writing it to use Dave Jones’ python libraries for the Raspberry Pi Camera, or adding features like scheduling the time-lapse to start at a particular time.

For more info on things to do with PiFace visit our guides http://www.piface.org.uk/guides