Software

If you want to download a pre-built binary version of the creepy portrait code follow the steps on this page.

If you're interested in compiling openFrameworks and the creepy portrait code (in particular if you want to do your own development with openFrameworks), skip this page and continue forward in the guide.

Binary Installation

First if you're new to using the Raspberry Pi, make sure you already have your Pi setup and running with a Raspbian operating system (Occidentalis should work great too). You can follow these guides for more information on the initial Raspberry Pi setup:
To download and install the application, open a terminal session (either through SSH or with a keyboard attached to the Raspberry Pi) and execute the following commands:
Download: file
mkdir ~/creepyportrait
cd ~/creepyportrait
wget https://github.com/tdicola/creepyportrait/raw/master/creepyportrait_1.0_raspberrypi.tar.gz
tar xvf creepyportrait_1.0_raspberrypi.tar.gz
sudo ./install_dependencies.sh
Answer yes to the questions about updating and installing packages that come up when the install_dependencies.sh script is run. This script is provided in openFrameworks and will install all the necessary libraries for running openFrameworks applications like the creepy portrait.

Next you'll need to ensure the Raspberry Pi GPU has at least 128 MB of memory available (if not, you won't see the 3D model textures render and instead get a black outline). You can change the split of memory in the raspi-config tool. Look at these instructions for running the tool, and change the memory_split option to 128 MB for the GPU.

Usage

To run the program first make sure either the Raspberry Pi camera or a webcam is attached to your Raspberry Pi.

Note: If you're using the Raspberry Pi camera for the first time, make sure to follow these instructions to enable it with the raspi-config command.

First run the program with no command line parameters by executing:
./creepyportrait
You should see the program usage and an error message about no video device being selected. If you're using a webcam, note the device ID number of the webcam you want to use.

To run the program with the Raspberry Pi camera execute:
./creepyportrait pi
Or to run the program with a webcam execute:
./creepyportrait (video device ID)
Where (video device ID) is the ID of the webcam from above. For example if you're using device ID 0 you would execute './creepyportrait 0' (without quotes).

It should take about 30-60 seconds for the program to start and display the skull. You should also see video from your camera in the upper left corner, and every ~2 seconds a green box appear over the largest detected face in the video. Make sure you have a decent amount of light on your face or else the detection won't be very reliable.

You can press the following buttons on the Raspberry Pi's keyboard to control the application:
  • V - Hide or show the video in the upper left corner.
  • M - If you're running with more than one 3D model (see further below), change between rendering different models. On the Raspberry Pi, for now only one model can be loaded in memory at a time.
  • Escape or Ctrl-C - Close the application.
You can run the program with a different 3D model by specifying it in a second command line parameter. The possible values are:
  • skull
  • jackevil
  • jackhappy
  • all
Skull is the default model. Unfortunately even on the Raspberry Pi model B there isn't enough memory to load all models at once, so pick your favorite one and use it when you run on the Pi.

For example to run with the evil jack-o-lantern using the Raspberry Pi camera you would execute:
./creepyportrait pi jackevil
Continue on if you want to download and compile openFrameworks and the code for the creepy portrait. If you just want to run the creepy portrait you can stop here, you're done!

This guide was first published on Oct 15, 2013. It was last updated on Oct 15, 2013.
This page (Software) was last updated on Jun 23, 2020.