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
Last revisionBoth sides next revision
project:ar_sandbox:start [2016/12/08 23:37] – Power management ruzaproject:ar_sandbox:start [2019/07/23 18:17] – piskoviste^2 sachy
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=active status=active
 }} }}
  
 ~~META: ~~META:
-status = active+status = in restart process
 &relation firstimage = :project:sarndbox-foto_by_alef.jpg &relation firstimage = :project:sarndbox-foto_by_alef.jpg
 ~~ ~~
Line 145: 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
 +
 +
 +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 155: Line 235:
   * 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.txt · Last modified: 2019/07/23 20:17 by sachy