-
Notifications
You must be signed in to change notification settings - Fork 2
Software setting : WEB Shared cam
Step 1: Install/Setup/run mjpg-streamer
Starting install streamer:
cd /home/pi
wget -Omjpg-streamer.tar.gz http://mjpg-streamer.svn.sourceforge.net/viewvc/mjpg-streamer/mjpg-streamer/? view=tar
tar xfz mjpg-streamer.tar.gz
cd mjpg-streamer
make
Test streamer
Install stremer service on startup
Step 2: Install/Setup/run haproxy
sudo apt-get install haproxy
/etc/haproxy/haproxy.cfg
sudo nano /etc/default/haproxy
global maxconn 4096 user haproxy group haproxy daemon log 127.0.0.1 local0 debug
defaults log global mode http option httplog option dontlognull retries 3 option redispatch option http-server-close option forwardfor maxconn 2000 timeout connect 5s timeout client 15min timeout server 15min
frontend public bind *:80 use_backend webcam if { path_beg /webcam/ } default_backend Shapextractor
backend Shapextractor reqrep ^([^\ :])\ /Shapextractor/(.) \1\ /\2 server Shapextractor1 127.0.0.1:7000 acl AuthOkay http_auth(L1) http-request auth realm octoprint if !AuthOkay
backend webcam reqrep ^([^\ :])\ /webcam/(.) \1\ /\2 server webcam1 127.0.0.1:8080
userlist L1 group shapeusers user test insecure-password test groups shapeusers
Step 3: Setup the web server
Use the console to change directory into the Shapextractor folder and run the following commands:
sudo cp Shape_service /etc/init.d/Shape_service
sudo chmod 755 /etc/init.d/Shape_service
sudo update-rc.d Shape_service defaults
Now every time the Rpi is started it also runs a simple python cgi webserver on port 7000
If you do not want reboot the Rpi you can run the server with this command:
./etc/init.d/Shape_service start
or likewise you can stop it with this one:
./etc/init.d/Shape_service stop
now that you can make the webserver run you are ready to use the Shapextractor
Step 4 : Using Shapextractor
Open your browser (Chrome or Firefox) and enter the Shapextractor URL:
http://"RPi-ip_address":7000
(if want to change PORT number modify it on the /etc/init.d/Shape_service file)
In the homepage you can choose to **Start new 3D-Scan** or see the Previous Scan.
All scans are visible on the web browser (provided it supports webGL). Also the PLY file can be downloaded and opened with Meshlab for Poisson Reconstruction.
New scan interface
In this configuration have live webcam stream
Option:
LASER POWER Laser power intensity
CROP Set pixel height you want to delete from the top to make a cleaner image
QUALITY Set scan resolution 0 (512steps/photos) 1 (1024 steps/photos) 2(2048 steps/photos)
ROT Set position of camera 0 horizontal 90 vertical
CAMERA HFOV Set this to the camera lens angle that you worked out above
CAMERA DISTANCE The distance from the camera 'foot' to the center of the turntable
LASER OFFSET The angle between the camera-turntable line and the laser
HORIZONTAL AVG. The number of consecutive horizontal points to average together to smooth out the surface
VERTICAL AVG. The number of consecutive vertical points to average together to smooth out the surface.
Other hidden values on html page
A = 9 GPIO RPi for 1 in uln2003 (stepper)
An = 25 GPIO RPi for 2 in uln2003 (stepper)
B = 11 GPIO RPi for 3 in uln2003 (stepper)
Bn = 8 GPIO RPi for 4 in uln2003 (stepper)
LASER = 18 GPIO RPi for 5 in uln2003 (laser line)
LIGHT = 7 GPIO RPi for 6-7 in ulm2003 (light)
DELAY = 0.002 Delay from stepper sequence
FRAME_SKIP = 1 Use every n'th frame for speed
POINT_SKIP = 1 Use every n'th scanline for speed
RESW = 640 Set camera resolution
RESH = 480 Set camera resolution
Note:
If want to change the default values above you need modify them on the file start.htm
After choosing your settings press the Start button and wait for Shapextactor to finish the scan :)