Viewing Reflections in Low Resolution with the "Bad Mirror"

The "Bad Mirror" takes the concept of a mirror and flips it on its head by showing the subject in an extremely low resolution.

The concept

Mirrors have been around for thousands of years, and their primary purpose is to show a realistic representation of what is in front of them. But Nemecle had the idea to create a mirror that displays whatever is being reflected in an extremely low resolution of just 10 by 25 pixels, which he refers to as the "Bad Mirror." In very high-level terms, the mirror would consist of a camera, a processor, and some method of showing the image in a large format- about the size of a human.

Required hardware

This project uses a Raspberry Pi as its main computer due to its relatively small size, ample processing ability, and USB/wireless connectivity for remote access and plugging in a webcam. Connected to this were five strips of WS2801 individually addressable LEDs that could represent each pixel within the scaled-down picture. Power was provided to the system by a fairly large 5V/25A power supply in order to accommodate the maximum current draw of 15A with extra overhead for future expansions. Finally, Nemecle decided to construct 250 "water bomb" origami figures to act as light diffusers that gave the mirror a cool, irregular look.

Capturing images

To capture whatever might be in front of the mirror, a standard webcam was plugged in and a small Python script was written that captures each frame with OpenCV. However, there was a small problem: the order of pixel colors was incorrect, as the pixel contained data in BGR format whereas the LEDs needed it in RGB, so he created a small function that maps between the two.

Displaying a reflection

For the final step of this project, Nemecle added some more code to his script that integrated RGB LED output. It starts by setting up the LED strip with direct memory access in order to free the processor from having to clock out data on the output pin directly. Then inside of an infinite loop, a new frame is read from the webcam, the RGB data is converted, and finally, the new data gets placed into the LED strip's buffer and sent for display to the matrix.

To read more about this bad mirror project, you can read Nemecle's blog post here.

Evan Rust
IoT, web, and embedded systems enthusiast. Contact me for product reviews or custom project requests.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles