Coder Social home page Coder Social logo

sushirng's Introduction

SushiRNG

alt tag

Fish tank random number generator. This project uses a Raspberry Pi 3 with a camera to create a live stream of my fish tank. This live stream is then used to generate a random number.

Table of Contents

Image Processing

Raspberry Pi Setup

Install OpenCV

For this project we used a Raspberry pi 3 and installed OpenCV 3. Any Raspberry Pi and OpenCV version should work (installation took me about 6 hours). I used this tutorial from Adrian Roseblock to help me install OpenCV on the Pi.

Install Bitstream

For this project we used the python package Bitstream 2.0.3. Information about Bitstream can be located here. Please follow the instructions from that website.

Raspberry Pi Build

At this point we should have all dependencies installed on the Raspberry Pi, so go ahead and clone this repo

git clone https://github.com/FishyByte/SushiRNG.git

For the Raspberry Pi we only care about the rpi directory. Before we can fire up the OpenCV script we're going to need to tweak the color ranges in rpi/app.py. Grab some still images from the pi with the raspistill command and then use the provided range detector script to find the HSV color space range of the image. This is how the fish will be tracked.

cd rpi/testing
python range-detector -f HSV -i path/to/image.jpg

Take note of these values and adjust the color range parameters to match in the rpi/app.py file. Also while your in that file find line 97 and uncomment it out, this is turned off for production.

We are finally ready to test out the OpenCV code, make sure you are in the rpi directory and run

python app.py

Server

Server Setup

Server Build

NIST Testing

To test against our random numbers that we generate and make sure it's cryptographically secure we used the official NIST Testing Suite. (Credits to National Institute of Standards and Technology) This runs specific tests against a stream of binary bits that we have generated from our algorithm for randomness. To run these tests against your bits of data, first go the the NIST directory and run this command:

---NOTE: It would help to put your data set in the data directory---

python bitStreamTesting.py __NumberOfBitsToTest__ PATH_TO_FILE

Example command that you can try with one of our example data sets that come with this repo:

python bitStreamTesting.py 32768 data/fishBits3.txt

You can learn more about the statistical NIST Testing, the organization itself, and the NIST Test Suite at the provided link below

National Institute of Standards and Technology NIST Statistical Test Suite

Mobile Application

See our application Fish Fate. Which uses this project to generate random values.

Contributions

Open Source Community

Other Sources

Contact Information

To contact any specific member of the FishyByte team please refer to their personal github profiles.

Reporting Issues

Please report all issues on the github issue tracker

License

The MIT License

sushirng's People

Contributors

c-asakawa avatar nmchale avatar aingc avatar

Watchers

James Cloos 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.