Graffiti Analysis
sdfg






This tutorial is a guide on how to motion capture graffiti tags into the Graffiti Markup Language (GML) format using the Graffiti Analysis 3.0 Capture software (available online for free on the DOWNLOADS page). This tutorial involves the use of an external video/cctv camera, which is better for motion tracking (especially in low light) than a web camera. An easier and less equipment heavy approach of using the software to capture graffiti motion data using a built in laptop web camera can be viewed here.




Step 1: Materials
Step 2: Build Capture Enclosure
Step 3: Assemble Capture Enclosure
Step 4: Position Camera & Connect Devices
Step 5: Attach Light Source To Marker
Step 6: Download Capture Software
Step 7: Application Calibrations
Step 8: Capture Tag
Step 9: Playback Tag
Step 10: Share / Collaborate / Create








- Straight edge
- Hand held light source: Any LED pen light or low power laser will work.
- Graffiti implement
- Pencil
- Masking tape
- Small tri-pod: Needs to hold camera low to the surface (roughly 10" in height or less). I often use a small Gorillapod.

- Video Capture Card: This is used to capture the video output signal from the camera. Most devices built for watching TV on the computer will work. Save money by using older models that don't offer HD quality (since we won't be capturing in HD). Similar devices sell on ebay for less than $40. You will need a capture card that works with Open Frameworks applications: for PC most cards will work, for MAC it can a bit more difficult (I have heard that this one works well). USBVision allows some PC capture cards to work in OSX. For best results check the Open Frameworks forum.

Note: Some cameras may be able to to connect directly via firewire.

- Video Camera: Cameras with manual controls (as are common in many cheap security cameras) are better for tracking then most web cams which offer little control over focus and light input levels. Cameras with manual focus, manual zoom and manual light control are ideal. I am using a Watec 221S, however similar results can be achieved with much cheaper cameras (including web cams in a pinch).

- USB cable: For connecting the video capture card to the computer.
- RCA cable: For connecting the camera to the video capture card.
- DC power source: For powering the camera.
- Foam board: 3 large sheets (6 for double ply and added stability). Black if available.
- Acrylic: Clear, 26" x 20", ~3/16" thick.
- Paper: Any size that will fit on the 26" x 20" surface. If your light source is bright enough you can use common A3 computer paper, if not try something less opaque such as tracing paper.

Not Pictured:
- Computer: Any relatively good / recent computer should work. You can test your computer by launching the application and checking that the framerate (listed in the lower left corner) is 30fps or higher.






The details of the capture enclosure system are not that important. In the end all you need is a horizontal surface with the camera behind it centered at roughly 28" (depending on the camera lens) behind the writing surface. The system I am using here is designed to be quickly taken apart and packed flat so that it can be carried aboard airplanes. For added stability buy thicker foam board, or stick two sheets together. Black foam board works best if available.



This file can be used to quickly reproduce the shapes pictured above. The .jpg file is at 1:1 scale, so one option is to print it out and trace it onto the foam board. A second option is to open up this .eps file in any vector based drawing program and translate the dimensions to the foam board. Lastly, if you have access to a laser cutter you can use the .eps to cut the pieces out directly.






Assemble the pieces as shown in the photo above. Once it's in place I use a couple small pieces of masking tape on the corners of the acrylic to keep it from moving around (small notches cut into the acrylic would have been a more elegant solution).






The camera should be centered, perpendicular and roughly 28" from the writing surface. The edges of the camera frame should roughly match that of the writing surface.



Use the RCA cable to connect the camera to the video capture card (with some cameras you made need a coaxial to RCA adapter). Plug in the camera to the power supply, and connect the video capture to the computer using the USB cable.

This is a good time to test if your camera and capture card system are working properly. If you are using a video capture card you will most likely have to set your video input mode to 'composite' (if you are seeing static or television then this is most likely the problem).

Windows users - AMCap is good (and free) software for viewing camera input that will also allow you to make the composite setting.

Mac users - USBVision Capture. Select your capture card under the "Digitizers" menus.

Ubuntu users - If you are using a video capture card you will need to download the drivers/firmware for your device. To get my Pinnacle card working on my Ubuntu system I needed to install em28xx.

Potentially useful links:

- LinuxTV->Em28xx devices wiki
- edubuntu em28xx
- ~dougsland/em28xx
- v4l (video 4 linux) mirror



Once that is set up you can install TV Time from the Synaptic Package Manager. Open TV time, right click the screen and choose "Input Configuration", and then click "Change Video Source" until "Composite 1" is selected. At this point you should be seeing your camera input. If you are having trouble selecting "Composite" mode in TV time try launching the app through the command line with the following:

tvtime --device /dev/video1

Another alternative to TV Time is Unicap / UCView. To install on Ubuntu go to http://www.unicap-imaging.org/using_repository.htm, and type the following in the terminal:

sudo apt-get install ucview







Use masking tape to attach the light source to the writing implement. The tip of the light source should come close to the tip of the pen without interfering with writing. It helps to have a light source with an on/off toggle switch as opposed to a press and hold switch.

TIP:
Narrow the diameter of the LED light source by wrapping the end of the light with a thin strip of paper (photo).






Download the most recent version of the Graffiti Analysis 2.0 Capture software from the DOWNLOADS page (available in Windows, OSX and Linux).

The GA2.0 Capture software was written in Open Frameworks. To install OF go here to download and follow the instructions in the README file. To edit and compile GA2.0 download the source code from the DOWNLOADS page and un-compress to the "apps/examples" dir of your OF installation.

The original version of this software was written by myself, and version 2.0 was updated heavily by Chris Sugrue.






Tape a piece of paper onto the acrylic face of the capture enclosure. Adjust the camera position and zoom so that it fits the page as closely as possible.

TIP:
Once the camera and paper are in the proper positions use tape to mark the corners of the page to help quickly align new sheets of paper.



In Ubuntu go into the /bin/ directory and double click on 'clickToLaunchApp_Debug.sh', and click 'run' (Windows and Mac users just double click on executable file). Hit 'c' to toggle on the camera view. In the top left corner you should see the input from your camera.



If you have manual adjustment capabilities for the light level on your camera set it so as to let in just enough light to clearly see your light source and nothing else.



Use the Threshold slider to fine tune your capture setting so that you have a small clearly defined light source.






Turn on the light source but leave the cap on the pen for testing until you become comfortable with the system.

Hit RETURN to begin recording and write your tag on the sheet of paper. When you are done hit RETURN again to stop recording.

Pressing'C' toggles on and off the control panel and video capture window.

Use the left mouse click and drag to position the tag, right click and drag to zoom and SHIFT + left mouse drag to rotate.



Use the slider in the bottom left corner of the screen to edit the start and end points of the tag. Position the red dot so that the tag starts at the desired location and the white dot to mark the ending. To save the tag click inside the box labeled "Graf Name", type the desired file name and hit RETURN.



After saving the file the the application enters playback mode. Use pan, rotate and zoom to position the tag to the desired location. At this point you can hit RETURN to capture more tags, or close the application to retrieve the saved GML file. Your tag data is saved in /bin/data/tags/your-tag-name in a file ending in .gml.






The GA2.0 Playback application can be download for Linux, Mac and Windows on the DOWNLOADS page. To playback tags add .gml files to /bin/data/tags. The software will automatically load and cycle through all tags in the /tags/ directory upon launch.






GML files can be freely uploaded, downloaded and played back in the browser at 000000book.com, an open repository for sharing and archiving motion captured graffiti tags.




For more information please view the ABOUT page.








Copyright 2010 Evan Roth, graffitianalysis.com
This software is licensed under GNU GPL

Creative Commons License
All Graffiti Analysis related media is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.


Contact: info[at]graffitianalysis[dot]com

Follow: @graffanalysis


Web Ring: