Code Monkey home page Code Monkey logo

paintball-portraits's Introduction

paintball-paintings

Please check the online version of this repo, available here: https://github.com/vvzen/paintball-portraits

The installation works by getting the live feed from a PS3 eye camera, waiting for the user input, then processing the PS3 cam image by using the coherent line drawing algorithm, sampling the resulting black & white image with some dots and then streaming the coordinates of each point to the cnc machine via serial communication.

Below you can find an example of the sampling process applied to the processed image:

imgs/example_sampling.png

The serial communication is bundled inside the osc protocol for readability reasons: using raw byte buffers has definitely less overhead but there is no need for it in my case.

Everytime the of app sends a serial message to the arduino, it waits for the arduino to send back the same message as a response and then procedes with the next message, until each dot has been shot on the canvas.

The path of the gun is optimised using a nearest neighbour algorithm, which definitely outperforms any kind of genetic algorithm approach that I tested. (have a look here)

ARDUINO

Open the arduino sketch and upload it to the arduino. Check the required libraries by looking at the top of the arduino sketch.

OPENFRAMEWORKS

The openframeworks app requires several different addons:

  1. ofxOpenCv
  2. ofxPoco
  3. ofxGui
  4. ofxKinect (required for the libusb driver)
  5. ofxIO
  6. ofxSerial
  7. ofxCv
  8. ofxPS3EyeGrabber
  9. ofxFaceTracker

imgs/addons.png

Installing the addons

You can either run the setup.py using python3 (see below) or manually download each addon and put it in your openframeworks addons folder.

Using setup.py

The setup.py file will automagically download all the required addons that you don't have installed into your openframeworks addons folder.

  1. Open the setup.py with a text editor and set the OF_ROOT variable to your openframeworks installation folder. In my case, it is /Volumes/LaCie3TBYas/Code/c++/of_v0.10.0_osx_release so I will change it like this: OF_ROOT="/Volumes/LaCie3TBYas/Code/c++/of_v0.10.0_osx_release"

  2. open a terminal window and cd into the main folder of this repo (maca-final)

  3. run python3 setup.py

paintball-portraits's People

Contributors

vvzen avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.