Giter VIP home page Giter VIP logo

capturpi's Introduction

CaptuRPi

Python codes for capturing synchronized stereo images with Raspberry Pi cameras (for 3D-DIC).

Disclaimer:

  • This was written by Aaron Jaeger you can contact him at amjaeger1317_at_gmail_dot_com.
  • This is not actively maintained.
  • This was written to work on a custom built multi-camera array, and work on a specific windows desktop in the lab.
  • It would take significant effort to get this up and running on your own system. It is here for reference if you are trying to set up an array of network controlled raspberry pi cameras. Feel free to contact Aaron if you would like advice/more info.

How this works: The system works with a desktop computer, raspberry pi's with cameras, and an internet router. The raspberry pi's run the raspiCam.py script located in the src folder. In command prompt windows the desktop computer runs scannerMaster.py - located in the src folder, and sshStart.py - located in the standalone tools folder.

The goal is for the raspberry pi's to all take a picture simultaneously. This is difficult as they do not have a real time clock, and they are not running a real time operating system. During device setup use an extra pi as an ntp time server, then force all of the other pi's to get their time from that surver. This improves the synchronization and jitter over using an existing timer server somewhere off in the cloud. It is easier to setup a pi or other linux device as a server than it is to make a windows computer the time server.

sshStart.py logs into every device it knows of, and will start the raspiCam script. The sshStart window must stay open during operation.

raspiCam.py does the following:

  • Determine's the decives IP Address. During device setup each device needs to be given a static IP address the first one starting at 192.168.0.201
  • initialize the camera settings. The cameras can auto-adjust, but we want consistent and predictable behavior. It is best to manually set these.
  • While the script is running the camera will continuously send a "heartbeat" message to the master computer to verify that it is still alive.
  • wait to recieve insctruction
  • Take picture when instructed
  • save picture locally
  • send update that the camera has take a picture
  • quit program when instructed

ScannerMaster.py:

  • scannerMaster has four objectives. Listen to inputs from the user, listen for undates from the camera, send commands to the cameras, and inform the user of the status of the cameras.
  • The user inputs are - take a picture, quit program on the camera side, and quit program on the master side
  • The updates from the camera are - heartbeat (or lack of one) and image captured. Updates come out of order, and within a window of time, the majority of the program is managing this flood of info.
  • Messages sent and recieved are in json string format so that they are human readable.
  • THe incoming messages are parsed and displayed in a easy to read update.

sshCopy.py:

  • located in the src folder
  • This script manages the image transfer and file naming for all the images.

sshCalCopy.py

  • located in the src folder
  • The base functionality of this script is the same as sshCopy. This script was for transfering and file naming of the images used for calibration of the scanner. At the time it was more convenient to duplicate the sshCopy script than the extend the functionality.

The standalone tools folder: These were single function scripts for managing the Pi's extraneous to the data capture process.

  • sshKill.py: remote shutdown of all the Pi's
  • sshRestart.py: remote restart of all the Pi's
  • sshSend.py: transfer updated version of raspiCam.py to all the devices
  • sshSendOne.py: transfer updated version of raspiCam.py to a specific device
  • scannerPingTest.py: Script to ping all Pi's to see if they are on and connected to the network.

capturpi's People

Contributors

amjaeger17 avatar danasolav avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.