User Tools

Site Tools


project:ar_sandbox:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
project:ar_sandbox:start [2016/11/25 07:11] – ↷ Page moved and renamed from project:ar_sandbox to project:ar_sandbox:start ruzaproject:ar_sandbox:start [2019/07/23 20:17] (current) – fullscreen support sachy
Line 1: Line 1:
 ====== AR SandBox ====== ====== AR SandBox ======
  
-{{template>infobox|+{{template>project:infobox|
 name=SARndbox| name=SARndbox|
 image=sarndbox-foto_by_alef.jpg?200| image=sarndbox-foto_by_alef.jpg?200|
Line 7: Line 7:
 hw=-| hw=-|
 founder=[[user:harvie]]| founder=[[user:harvie]]|
-interested=[[user:stick]]\\ [[user:niekt0]]\\ [[user:pasky]]\\ [[user:nephirus]]\\ [[user:Gygal]]| +interested=[[user:stick]]\\ [[user:niekt0]]\\ [[user:pasky]]\\ [[user:nephirus]]\\ [[user:Gygal]]\\[[user:sachy]]| 
-status=done+status=active
 }} }}
 +
 +~~META:
 +status = in restart process
 +&relation firstimage = :project:sarndbox-foto_by_alef.jpg
 +~~
  
 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. 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.
Line 36: Line 41:
   windowFullscreen true   windowFullscreen true
 </code> </code>
 +
 +==== 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.
 +=== Projector ===
 +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 ===== ===== Software =====
Line 134: Line 145:
   * 3x VIKA LERBERG Trestle - http://www.ikea.com/gb/en/catalog/products/80130776/   * 3x VIKA LERBERG Trestle - http://www.ikea.com/gb/en/catalog/products/80130776/
   * custom parts from OBI   * 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).
 +
 +<code python piskoviste.py>
 +#!/bin/python
 +from freenect import sync_get_depth as gdepth
 +import cv2
 +import numpy as np
 +
 +def loopa():
 + global depth
 + while True:
 + (depth,_) = gdepth()
 + npd=np.array(depth)
 + mn=npd.min()
 + npd[npd>1000]=1000 # Eliminate kinect artefacts, constant to be fitted manually
 + #print(npd.max())
 + npd-=mn
 + mx=npd.max()
 +
 + npd2=npd*(255/mx)
 + npd=np.floor(npd2).astype(np.uint8)
 +
 +# 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
 +
 + fdepth=cv2.applyColorMap(npd,cv2.COLORMAP_JET)
 +
 + cv2.imshow('dpth',fdepth)
 + #cv2.imshow('hst',himg) # Debugging histogram
 + if cv2.waitKey(1) & 0xFF == ord('q'):
 + break
 +
 +cv2.namedWindow("dpth", cv2.WND_PROP_FULLSCREEN)
 +cv2.setWindowProperty("dpth",cv2.WND_PROP_FULLSCREEN,cv2.WINDOW_FULLSCREEN)
 +loopa()
 +
 +cv2.destroyAllWindows()
 +
 +</code>
 +
 +===== Environment preparation =====
 +Easiest way to do anything pyrelated without fighting incompatible python versions is to create virtual environment (venv).
 +
 +
 +<code bash>
 +apt-get install python3-venv python-opencv libusb-dev libusb-1.0.0-dev python3-dev
 +mkdir ./piskoviste
 +cd ./piskoviste
 +wget "https://github.com/OpenKinect/archive/master.zip"
 +unzip "./master.zip"
 +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
 +cmake -L .. -DBUILD_EXAMPLES=OFF -DBUILD_PYTHON3=ON
 +make
 +make install
 +cd ../wrappers/python
 +python ./setup.py install
 +cd ../../..
 +wget "piskoviste.py_Z_BRMLABI_WIKI"
 +python ./piskoviste.py
 +</code>
 +
 +===== Result =====
 +
 +{{:project:ar_sandbox:dpth.png?direct|}}
  
 ===== Similar Projects ===== ===== Similar Projects =====
Line 144: Line 236:
   * http://smartmania.cz/clanky/sandystation-interaktivni-piskoviste-s-vyuzitim-kinectu-video-1672   * http://smartmania.cz/clanky/sandystation-interaktivni-piskoviste-s-vyuzitim-kinectu-video-1672
   * http://www.military.com/video/logistics-and-supplies/army-equipment/sandtable-as-fun-as-sanbox/3849414398001/   * http://www.military.com/video/logistics-and-supplies/army-equipment/sandtable-as-fun-as-sanbox/3849414398001/
 +
 +more useful links
 +  * http://idav.ucdavis.edu/~okreylos/ResDev/SARndbox/LinkSoftwareInstallation.html
 +  * https://arsandbox.ucdavis.edu/
project/ar_sandbox/start.1480057860.txt.gz · Last modified: 2016/11/25 07:11 by ruza