Main menu

You are here

ChameleonPi - Camouflage your Pi using a camera and LedBorg

This is an old driver based LedBorg script
We recommend using the new driver free based scripts for LedBorg.
The new driver free examples can be found here, the installation can be found here.

Cameras and image processing can be really fun, but where do you get started?
How about getting your Raspberry Pi to blend in with it's surroundings using an LedBorg!
What we need is a simple cycle of events to do this:

Take a photo using the camera

Load the image data into our program

Crop the image so we focus on the center of our view

Average the remaining pixels into a single pixel

To cope with lighting changes, brighten the pixel up so one of red, green, or blue is fully on

Convert the pixel colour into an LedBorg code

Set the LedBorg to the calculated code

The crop will be like this:

with the green square being the region we analyse.
Sounds complicated, but we will use Python's image library PIL to do the heavy lifting for the most part.
You can download ChameleonPi.py as text here.
Save it on your Raspberry Pi as ChameleonPi.py
Make it executable usingchmod +x ChameleonPi.py
and run it using./ChameleonPi.py