AR SandBox

founder: harvie
depends on:

Augmented Reality SandBox is quite nice concept where you play with sand and a projector mounted on top of the sandbox projects constantly updating height-map on it. We've prepared a few installations.

Basic Instructions

Just start piskoviste.brm PC and everything should start by itself.


Add following shell script to your Window Manager autostart scripts (i.e. Settings→Session and startup in XFCE4)

/bin/nice -n -10 /home/brmlab/PISKOVISTE/SARndbox-1.5-001/bin/SARndbox -rs 0 -wo 9999 -loadView /home/brmlab/Desktop/SavedViewpoint0001.view &

The script above increases niceness of an SARndbox process. Increasing niceness to negative values is not allowed for non-privileged user by default in common Linux distros. We can allow user brmlab to do so by adding following lines to /etc/security/limits.conf (Fedora)

brmlab   hard nice     -15
brmlab   soft nice     -11

Fullscreen mode by default

open Vrui.cfg, find in Window section and change windowFullscreen value from false (default) to true

section Window
  windowPos (0, 0), (1024, 768)
  windowFullscreen true

Power Management

Piskoviste.brm PC

in xfce4-panel go to “Applications menu→Settings→Power manager” and monitor and PC to go to sleep after some amount of time.


Set “auto power off” to ON and “timeout” to i.e 15min. Having no input from graphic card projector will turn off automatically after amout of time set.



Software created by Oliver Kreylos for W.M. Keck Center for Active Visualization in the Earth Sciences, UC Davis Tahoe Environmental Research Center, Lawrence Hall of Science, and ECHO Lake Aquarium and Science Center. See for more info.


It may be quite hard to find out how to calibrate for the first time, so i will document it here a bit

Kinect (Height calibration)

Tou have to manually edit files in PISKOVISTE/SARndbox-1.5-001/etc/SARndbox-1.5/ :


(-0.0076185, 0.0271708, 0.999602), -115.0000
(  -48.6846899089,   -36.4482382583,   -111.8705084084)
(   48.3653058763,   -34.3990483954,   -106.3884158982)
(   -50.674914634,    35.8072086558,   -114.4082571497)
(   48.7936140481,    36.4780970044,     -108.74159795)

The important is the last number in each line - in the first line is z-offset of sea level, the four lines are corner calibration points (must be always higher value than the sea level offset). To move sea level up, increase the value on all lines by the same amount.


-15.0    0   0  80
 -7.0    0  30 100
 -6.0    0  50 102
 -3.5   19 108 160
 -0.75  24 140 205
 -0.25 135 206 250
 -0.05 176 226 255
  0.0    0  97  71
  0.25  16 122  47
  2.5  232 215 125
  5.5  161  67   0
  8.0  130  30  30
 13.0  161 161 161
 19.0  206 206 206
 24.0  255 255 255

Mapping from height to colors. Adjust the appropriate z-offsets (first column) to compress/spread colors across heights.

Projector (plane mapping)

IAMap SandBox


CUstom reimplementation of AR Sandbox that is capable of running on less-advanced hardware than SARndbox (which requires quite decent graphics card), designed with ARM platform in mind (like Raspberry Pi or BeagleBoard).


FreezeFest 2012

This installation was created for DIY festival FreezeFest 2012. It used ad-hoc on-site construction, around 60kg of sand and SARndbox software (see below).


JDI 2012

This installation was created for One Day with Informatics event held at Charles University Prague. It used IKEA1 construction, 50 kg of sand and SARndbox software (see below).




This portable construction was used for JDI 2012 installation (see photos above) and will be stationed at brmlab. It uses the following components from IKEA (hence the name):


This portable construction is built from IKEA components and custom parts from OBI.

AR SandBox^2

The new software is based on Python + OpenCV + libfreenect to abadon that crappy software from the distant past and make hardware requirements as low as possible (lets convert from tower PC to raspberry).
from freenect import sync_get_depth as gdepth
import cv2
import numpy as np
def loopa():
	global depth
	while True:
		(depth,_) = gdepth()
		npd[npd>1000]=1000 # Eliminate kinect artefacts, constant to be fitted manually
# Debugging histrogram START
#		himg=np.zeros((300,256,1))
#		hst=cv2.calcHist([npd],[0],None,[256],[0,2048])
#		cv2.normalize(hst,hst,0,255,cv2.NORM_MINMAX)
#		hst2=np.int32(np.around(hst))
#		pts=np.column_stack((np.arange(256).reshape(256,1),hst2))
#		cv2.polylines(himg,[pts],False,(255,0,0))
# Debugging histogram END
		#cv2.imshow('hst',himg) # Debugging histogram
		if cv2.waitKey(1) & 0xFF == ord('q'):
cv2.namedWindow("dpth", cv2.WND_PROP_FULLSCREEN)

Environment preparation

Easiest way to do anything pyrelated without fighting incompatible python versions is to create virtual environment (venv).

apt-get install python3-venv python-opencv libusb-dev libusb-1.0.0-dev python3-dev
mkdir ./piskoviste
cd ./piskoviste
wget ""
unzip "./"
python3 -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
pip install matplotlib
pip install numpy
pip install opencv-python
pip install cython
mkdir ./libfreenect-master/build
cd ./libfreenect-master/build
make install
cd ../wrappers/python
python ./ install
cd ../../..
wget "piskoviste.py_Z_BRMLABI_WIKI"
python ./


Similar Projects


Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki