GithubHelp home page GithubHelp logo

isabella232 / spectral-workbench.py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from publiclab/spectral-workbench.py

0.0 0.0 0.0 23 KB

Capture and upload a spectra to spectral workbench using raspberry pi.

License: GNU General Public License v3.0

Python 100.00%

spectral-workbench.py's Introduction

spectral-workbench.py

Capture and upload a spectrum to spectral workbench using raspberry pi.

Designed to work with the lego spectrometer from publiclab.org, details on how to build on can be found here:

https://publiclab.org/w/lego-spectrometer

The script can be initailised over SSH, but still requires the RPi to be connected to a monitor in order to show the camera preview. This will not work over a remote desktop.

What is does:

User inputs label for the spectrum.

The script will show a preview of the spectrum to be caputured, before saving the image to /home/pi/Pictures with the file name set as the spectrum label.

The middle row of pixels are then extracted and base64 encoded as a dataurl. The extracted pixels are also saved to the Pictures folder.

The encoded image and identifying information are uploded as a POST request to spectral workbench. The response code is then printed.

Areas for improvement:

Overlaying a guide across the camera preview to show where the specrum will be extracted for uploading.

Do the extracted pixels need to be saved as an image before being encoded? Early versions required the image to be opened with the 'rb' perameter or encoding to fail. Any way round this would make the code shorter.

spectral-workbench.py's People

Contributors

ian-antking 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.